Editing this file directly
/etc/sysconfig/iptables
can save me so much headaches so much time and so on...
and yet on the very top of the file it says..
Manual customization of this file is not recommended.
here is the '/etc/sysconfig/iptables' that just came with a brand new centos 6.4 cloud server.
# Firewall configuration written by system-config-firewall
# Manual customization of this file is not recommended.
*filter
:INPUT ACCEPT [0:0]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
-A INPUT -m state --state ESTABLISHED,RELATED -j ACCEPT
-A INPUT -p icmp -j ACCEPT
-A INPUT -i lo -j ACCEPT
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
-A INPUT -j REJECT --reject-with icmp-host-prohibited
-A FORWARD -j REJECT --reject-with icmp-host-prohibited
COMMIT
to open port 80 i can simply clone the line..
-A INPUT -m state --state NEW -m tcp -p tcp --dport 22 -j ACCEPT
and then change "22" to "80" and then save this file and then reboot the whole system.
this will open port 80 for me.
this is pretty simple operation. and yet the file says manual editing is not recommended.
why should i follow the advice ?