linux关闭防火墙

// 1.检验防火墙是否启动
firewall-cmd --state

// 2. 检查8080 端口是否启动:
firewall-cmd --permanent --zone=public --list-ports

//3.开启 8080 端口:
firewall-cmd --zone=public --add-port=8080/tcp --permanent

//4.重新启动防护墙
firewall-cmd --reload

// 5.验证8080 端口是否生效
firewall-cmd --zone=public --query-port=8080/tcp

Centos 7中默认的linux的系统默认防火墙不是iptables,而是firewall,此时应该使用以下方式关闭防火墙了。

//1.关闭防火墙
systemctl stop firewalld.service #停止firewall
systemctl disable firewalld.service #禁止firewall开机启动

posted @ 2022-07-25 15:44  花田007  阅读(11736)  评论(0编辑  收藏  举报