centos7 防火墙配置

centos hykeda 641℃ 0评论

centos7 防火墙 变成了firewall,而不是原先的iptables。具体操作方式如下:

##Add
firewall-cmd –permanent –zone=public –add-port=80/tcp
##Remove
firewall-cmd –permanent –zone=public –remove-port=80/tcp
##Reload
firewall-cmd –reload

复制代码

检查是否生效

firewall-cmd –zone=public –query-port=80/tcp

列出所有的开放端口

firewall-cmd –list-all

查看防火墙状态

systemctl status firewalld.service

启动防火墙

systemctl start firewalld.service

关闭防火墙

systemctl stop firewalld.service

重新启动防火墙

systemctl restart firewalld.service

转载请注明:雕木乱 » centos7 防火墙配置

喜欢 (0)

您必须 登录 才能发表评论!