Centos7 防火墙开发端口

一、原来的iptables不用了

输入:service iptables restart

爆出这个错误: Redirecting to /bin/systemctl restart iptables.service

 说白了,就是centos的防火墙改为了改为firewalld,用原来的iptables不能用了

二、命令

1、添加开放端口

firewall-cmd --zone=public --add-port=80/tcp --permanent

2、重启防火墙

systemctl restart firewalld.service

三:参考文章

https://www.cnblogs.com/moxiaoan/p/5683743.html

猜你喜欢

转载自www.cnblogs.com/zhengyihuoban/p/10899047.html