iptables install

https://blog.csdn.net/piaocoder/article/details/53887933


关闭fireware

···
systemctl status firewalld.service #检测是否开启了firewall

systemctl stop firewalld.service #关闭firewall

sytsemctl disable firewalld.service #禁止firewall开机自启


*filter

:INPUT ACCEPT [0:0]

:FORWARD ACCEPT [0:0]

:OUTPUT ACCEPT [0:0]

-A INPUT -m state --state RELATED,ESTABLISHED -j ACCEPT

-A INPUT -p icmp -j ACCEPT -A INPUT -i lo -j ACCEPT

-A INPUT -p tcp -m state --state NEW -m tcp --dport 22 -j ACCEPT

-A INPUT -p tcp -m state --state NEW -m tcp --dport 80 -j ACCEPT

-A INPUT -p tcp -m state --state NEW -m tcp --dport 8080 -j ACCEPT

-A INPUT -p tcp -m state --state NEW -m tcp --dport 3306 -j ACCEPT

-A INPUT -j REJECT --reject-with icmp-host-prohibited

-A FORWARD -j REJECT --reject-with icmp-host-prohibited

COMMIT

---------------------

作者:piaocoder

来源:CSDN

原文:https://blog.csdn.net/piaocoder/article/details/53887933

版权声明:本文为博主原创文章,转载请附上博文链接!

你可能感兴趣的:(iptables install)