1) 重启后生效
开启: chkconfig iptables on
关闭: chkconfig iptables off
2) 即时生效,重启后失效
开启: service iptables start
关闭: service iptables stop
3)利用CentOS7的的服务管理工具systemctl是CentOS7,它融合之前service和chkconfig的功能于一体。
开启: systemctl start firewalld
关闭: systemctl stop firewalld