CentOS7默認的防火牆不是iptables,而是firewalle.spa
出現此狀況多是iptables防火牆未安裝。rest
#中止firewalld服務code
systemctl stop firewalld
#禁用firewalld服務blog
systemctl mask firewalld
開啓ip
systemctl unmask firewalld
安裝iptables-services:it
yum install iptables-services
設置開機啓動:table
systemctl enable iptables systemctl [stop|start|restart] iptables #or service iptables [stop|start|restart] service iptables save #or /usr/libexec/iptables/iptables.init save
而後class
service iptables status
開啓: service iptables startiptables
關閉: service iptables stopservice