service firewalld start //启动
service firewalld restart //重启
service firewalld stop //关闭
systemctl stop firewalld.service //关闭防火墙(关闭后续可以重新开启)
systemctl disable firewalld.service //永久关闭防火墙
systemctl status firewalld.service //查看firewall服务状态
firewall-cmd --state //查看firewall的状态
firewall-cmd --list-all //查看防火墙规则
firewall-cmd --query-port=80/tcp //查询端口是否开放
firewall-cmd --permanent --add-port=80/tcp //开放80端口
firewall-cmd --permanent --remove-port=8080/tcp //移除8080端口
firewall-cmd --reload //重启防火墙(修改配置后要重启防火墙)
参数解释 1、firwall-cmd:操作firewall的工具; 2、--permanent:永久; 3、--add-port:标识添加的端口;
标签:service,--,cmd,防火墙,firewalld,CentOS7,firewall,关闭 From: https://www.cnblogs.com/colcat/p/17348768.html