Loading

Firewall

查看状态

systemctl status firewalld

启动防火墙

systemctl start firewalld

停止防火墙

systemctl stop firewalld

重启防火墙

systemctl restart firewalld

开机启动防火墙

systemctl enable firewalld

开机禁用防火墙

systemctl disable firewalld

开放端口(--permanent 永久生效)

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

设置完成后需要重载以生效

firewall-cmd --reload

查看规则

iptables -L -n 

关闭端口

firewall-cmd --remove-port=80/tcp --permanent

查询端口是否开启

firewall-cmd --query-port=80/tcp

posted @ 2022-02-01 17:16  BigBender  阅读(55)  评论(0编辑  收藏  举报