Note: The basic operation of the firewall command:
Querying firewall Status:
[[Email protected] ~]# service iptables status< carriage return >
To stop the firewall:
[[Email protected] ~]# service iptables Stop < Enter >
To start the firewall:
[[Email protected] ~]# service iptables start < Enter >
To restart the firewall:
[[Email protected] ~]# service iptables Restart < Enter >
To permanently shut down the firewall:
[[email protected] ~]# chkconfig iptables off< Carriage return >
Enable after permanent shutdown:
[[email protected] ~]# chkconfig iptables on< Carriage return >
1. View firewall status
[[Email protected] ~]# service iptables status< carriage return >
2, edit the/etc/sysconfig/iptables file. We're going to open 8080 ports and 9990 ports in our instance.
Open/etc/sysconfig/iptables with editor
3, according to gourd painting scoop, we add 8080 ports and 9990 ports
4. Save the/etc/sysconfig/iptables file and execute it at the terminal
[[Email protected] ~]# service iptables Restart < Enter >
5. New view of firewall status
[[Email protected] ~]# service iptables status< carriage return >
6, this time, the server's 8080 and 9990 ports can provide services to the outside.
7, other ports open mode is similar to the open mode.
Excerpt from: http://blog.csdn.net/jemlee2002/article/details/7042991
CentOS Configuration Firewall Operation example