centos7 iptables 规则保存

centos 7 默认使用了firewalld ,iptables-service 没有安装

所以,如果要用iptables,首先要禁用firewalld,同时安装iptables-service 。否则不会在开机时去读iptables设置的规则

systemctl stop firewalld
systemctl disable firewalld
yum install iptables-services -y
systemctl enable iptables

保存规则

/usr/libexec/iptables/iptables.init save

##或者
iptables-save > /etc/sysconfig/iptables

猜你喜欢

转载自neo-it.iteye.com/blog/2398275
今日推荐