iptables is a software
Start command: service iptables start
reboot command: service iptables restart
shut down command: service iptables stop
[root@localhost init.d]# which iptables
/sbin/iptables
iptables configuration file /etc/init.d
# config: /etc/sysconfig/iptables
# config: /etc/sysconfig/iptables-config
vim /etc/sysconfig/iptables
Command:
-A: Chain Name Specifies
-p: Specifies the protocol type
-d: specifies the destination address
-dport: Targeting port (destination port and destination port)
-sport: source port (source port source port)
-j: Specifies the type of action
禁止所有80 input
iptables -t filter -A INPUT -p tcp --dpost 80 -j DROP
开启所有80 input
iptables -t filter -I INPUT -p tcp --dport 80 -j ACCEPT
Let into the valid configuration file
iptables-save> / etc / sysconfig / iptables
Note that if executed iptables -t filter -A INPUT -p tcp -dpost 80 -j DROP
So behind the implementation of all - do not take effect
Very good information: