centOS7 防火墙

查看已经开放的端口:

firewall-cmd --list-ports

开启端口:

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

关闭端口:

firewall-cmd --permanent --zone=public --remove-port=8080/tcp

开启防火墙:

systemctl start firewalld

重启防火墙:

firewall-cmd --reload #重启
firewall-cmd systemctl stop firewalld.service #停止
firewall-cmd systemctl disable firewalld.service #禁止firewall开机启动 

posted @ 2022-08-23 13:09  mrt_yy  阅读(19)  评论(0编辑  收藏  举报