There are two commands to enable and disable the firewall in CentOS Linux, one is temporary, and it will be restored after restarting; the other is permanent, and it will not be restored after restarting.
Check firewall status: service iptables status
1) Temporarily effective, restore after restart
: service iptables start
Close: service iptables stop
2) Permanent effect, will not be restored after restarting
: chkconfig iptables on
Close: chkconfig iptables off
For other services under Linux, you can use the above commands to perform opening and closing operations.