Iptable开机不启动

来自ling
跳转至: 导航搜索

即使systemctl enable iptables也不行,原来是firewalld没有开机禁止启动导致

systemctl disable firewalld

systemctl stop firewalld

yum -y install iptables-services

vi /etc/sysconfig/iptables 

-A INPUT -m state –state NEW -m tcp -p tcp –dport 80 -j ACCEPT 
-A INPUT -m state –state NEW -m tcp -p tcp –dport 3306 -j ACCEPT
-A INPUT -m state –state NEW -m tcp -p tcp –dport 443 -j ACCEPT
-A INPUT -m state –state NEW -m tcp -p tcp –dport 60:80 -j ACCEPT


systemctl enable iptables

systemctl start iptables

systemctl status iptables

systemctl status firewalld