CentOS 6+ / Debian 6+ / Ubuntu 14.04 +
Recommend Debian 8 x64, this is the system I have been using, my script has the lowest error rate on this system.
Execute the code below to download and run the script.
wget -N --no-check-certificate https://raw.githubusercontent.com/ToyoDAdoubiBackup/doubi/master/ban_iptables.sh && chmod +x ban_iptables.sh && bash ban_iptables.sh
After running the script, the script operation menu will appear, select and enter the corresponding number to operate.
Instructions for use
Go to the directory where the script is downloaded and run the script:
Then select the option you want to execute.
iptables firewall block management script [vX.X.X]
- Toyo | doub.io/shell-jc2 -
0. View current banned list
1. Ban BT, PT
2. Block SPAM (Spam)
3. Ban BT, PT+SPAM
4. Block custom ports
5. Block custom keywords
6. Unblock BT, PT
7. Unblock SPAM (spam)
8. Unblock BT, PT+SPAM
9. Unblock custom port
10. Unblock custom keywords
11. Unblock all keywords
12. Upgrade script
Please enter the number [0-11]:
For convenience, I also made a few quick commands, without having to enter the menu to select the corresponding option, you can directly block/unblock it.
# Block BT, PT
# Block SPAM (spam)
# Block BT, PT+SPAM
# Unblock BT, PT
# Unblock SPAM (spam)
# Unblock BT, PT+SPAM
Prompt wget: unknown host "raw.githubusercontent.com" and other errors
This is because my domain name cannot be resolved. It is mostly a DNS problem. Please change the DNS to Google DNS (copy the following two lines and execute them together).
echo -e "nameserver 18.104.22.168
nameserver 22.214.171.124"> /etc/resolv.conf
Prompt wget: command not found error
This is your system is streamlined and too clean, wget is not installed, so you need to install wget.
# CentOS system:
yum install -y wget
# Debian/Ubuntu system:
apt-get install -y wget
To reprint, please indicate the hyperlink: "Original" iptables block BT/PT/SPAM (spam) and custom port/keywords One-click script