Vi/etc/sysconfig/iptables
-A input-m state–state new-m tcp-p tcp–dport 80-j ACCEPT (allow 80 ports via firewall)-A input-m state–state new-m tcp-p tcp–d Port 3306-j ACCEPT (allow port 3306 through the firewall) Special Note: Many netizens add these two rules to the last line of the firewall configuration, causing the firewall to fail to start, the correct should be added to the default port 22 below the rule
After adding the firewall rules as follows:
###################################### # Firewall configuration written by system-config-firewall # Manual Customization of this file was 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-m state–state New-m tcp-p tcp–dport 80-j accept -a input-m state–state new-m tcp-p tcp–dport 3306-j ACCEPT -a INP Ut-j reject–reject-with icmp-host-prohibited -A forward-j reject–reject-with icmp-host-prohibited COMMIT& nbsp #####################################
/etc/init.d/iptables Restart #最后重启防火墙使配置生效
Article from "Http://www.myhack58.com/Article/48/66/2012/34999.htm"
Linux configuration Fire wall open port