centos7操作/关闭防火墙

2023-05-16

前言:测试环境部署不同端口的服务,需要频繁使用防火墙放行端口,比较麻烦,所以需要彻底关闭防火墙,整理了以下命令,提供使用

systemctl status firewalld     #查看防火墙状态
systemctl stop firewalld       #关闭防火墙,停止 firewall 服务
systemctl start firewalld      #开启防火墙,启动 firewall 服务
systemctl restart firewalld    #重启防火墙,重启 firewall 服务		
systemctl is-enabled firewalld #查看 firewall 服务是否开机启动		
systemctl enable firewalld.service  #开机时自动启动 firewall 服务		
systemctl disable firewalld.service  #开机时自动禁用 firewall 服务		

要彻底关闭防火墙,先关闭防火墙,然后再禁用开机自启动。 

如果不需要彻底关闭,只是对某个端口放行,如8848端口:

防火墙未开放,8848端口不通:

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

更新防火墙规则

firewall-cmd --reload

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

centos7操作/关闭防火墙 的相关文章

随机推荐