CentOS Configure the Firewall action instance (start, stop, open, closed port):
Note: Basic operation commands for firewalls:
Query firewall status: [root@localhost ~]# service iptables status
Stop firewall: [root@localhost ~]# service iptables stop
Start firewall: [root@localhost ~]# service iptables start
Reboot firewall: [root@localhost ~]# service iptables restart
Permanently shutdown firewall: [root@localhost ~]# chkconfig iptables off
Enable after permanent shutdown: [root@localhost ~]# chkconfig iptables on
1. View firewall status
[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.
Shutdown-h now--shut down immediately shutdown-h 10:53 to 10:53 shutdown, if the time is less than the current time, then the next day shutdown-h +10--10 minutes after the automatic shutdown shutdown-r --Immediately reboot Shutdown-r +30 ' The System'll Reboot in mins '--reboot after 30 minutes and send a notification to other online users