Sometimes, we need to operate the firewall of the system, and today we will explain how to turn on and off the firewall under the CentOS6.9 system.
Input: Cat/etc/issue view version
(i) Through service orders
Service command on and off firewall for immediate effect, the next time you restart the machine will automatically recover.
View firewall Status: Service iptables status, remember in CentOS6.9 is input iptables, some online tutorials using service iptable Status command is not feasible.
Shutdown Firewall: Service iptables stop
Open firewall: Service iptables start
Summarize:
Open firewall: Service iptables start
Shutdown Firewall: Service iptables stop
View firewall Status: Service iptables status
(ii) through:/etc/init.d/iptables operation
View firewall Status:/etc/init.d/iptables/status
Shutdown firewall:/etc/init.d/iptables Stop (this is a temporary shutdown, shutdown is currently running the firewall, reboot after the firewall will start, because it is boot-initiated)
This is a temporary shutdown, shutdown is currently running the firewall, reboot after the firewall will start, because it is boot, it is equivalent to/etc/init.d/iptables start
(iii) need to turn on the boot does not start, using the Chkconfig command
Permanently open firewall: Chkconfig iptables on
View status: Chkconfig--list iptables
To permanently shut down the firewall:
Chkconfig iptables off