Centos 5.6 can open the firewall normally through the interface, but it is often ineffective when you use commands to open the firewall. Currently, it is always possible that the parameters are incorrect. I reorganized the two methods and wrote down the steps.
1. Use the command to modify:
(We recommend that you change IPTABLES_SAVE_ON_STOP = "no" to yes in etc/sysconfig/iptables-config)
1./sbin/iptables-I INPUT-p tcp -- dport 2003-j ACCEPT
2./etc/rc. d/init. d/iptables save or service iptables save
3 service iptables restart
2. Modify etc/sysconfig/iptables
1. service iptables stop (if this step is missing, after this operation, the system will be restarted, and etc/sysconfig/iptables will be restored. )
2. Add A line after etc/sysconfig/iptables-A RH-Firewall-1-INPUT-p tcp-m state -- state NEW-m tcp -- dport 2002-j ACCEPT
3./etc/rc. d/init. d/iptables save or service iptables save
4. service iptables restart
5./etc/rc. d/init. d/iptables save or service iptables save (save again)