# 停止firewalld服務
systemctl stop firewalld
systemctl mask firewalld
# 安裝iptables-services
yum install iptables-services
Enable the service at boot-time:
# 啟動iptables服務
systemctl enable iptables
# 管理iptables
systemctl [stop|start|restart] iptables
# 保存規則
service iptables save 或者 /usr/libexec/iptables/iptables.init save
?
centos7不再使用iptables,而是使用firewalld
若不想使用firewalld,繼續使用iptables,可以停掉firewalld,并且安裝iptables-services包
systemctl stop firewalld
systemctl disable firewalld
yum install -y iptables-services
systemctl enable iptables
systemctl start iptables