CentOS 7 使用iptables防火墙

# 停止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
原文地址:https://www.cnblogs.com/weifeng1463/p/7223114.html