|
Block IP The command for a single IP is: iptables -I INPUT -s 211.1.0.0 -j DROP
The command to block the IP segment is iptables -I INPUT -s 211.1.0.0/16 -j DROP iptables -I INPUT -s 211.2.0.0/16 -j DROP iptables -I INPUT -s 211.3.0.0/16 -j DROP
The order to seal the entire paragraph is: iptables -I INPUT -s 211.0.0.0/8 -j DROP
The order to seal a few paragraphs is iptables -I INPUT -s 61.37.80.0/24 -j DROP iptables -I INPUT -s 61.37.81.0/24 -j DROP
The server starts from running There are three ways: 1. Add it to /etc/rc.local 2. iptables-save >;/etc/sysconfig/iptables can put your current iptables rules in /etc/sysconfig/iptables, and the system will automatically execute them when iptables is started. 3. Service iptables save can also put your current iptables rules in /etc/sysconfig/iptables, and the system will automatically execute them when you start iptables. The latter two are better for this, generally iptables services will be started before network services, which is more secure
Unblocking: iptables -L INPUT iptables -L --line-numbers then iptables -D INPUT serial number
|