Note: Basic operation commands for firewalls:
| code is as follows |
copy code |
query Firewall status:
[root@localhost ~]# service Status
To stop the firewall:
[root@localhost ~]# service iptables stop
Start firewall:
[ Root@localhost ~]# service iptables start
Restart firewall:
[root@localhost ~]#] service iptables Restart
to permanently shut down the firewall:
[root@localhost ~]# chkconfig off
Iptables;
Enable after permanent shutdown:
[root@localhost ~]# chkconfig iptables on |
strong> The following is an example operation:
[Root@localhost ~]# service iptables status
2, edit/etc/sysconfig/iptables file. In our case, we're going to open port 8080 and port 9990.
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 in the terminal implementation
[root@localhost ~]# Service iptables restart
5, the new view firewall status
[Root@localhost ~]# service iptables status
6, this time, the server's 8080 and 9990 ports can provide services to the outside.
7, other ports open mode is similar to this open mode.