centos learning: iptables learning

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:

http://blog.csdn.net/guochunyang/article/details/49865441

Published 65 original articles · won praise 3 · views 50000 +

Guess you like

Origin blog.csdn.net/web_orange/article/details/73912597