一、关闭防火墙

关闭防火墙

sudo systemctl stop firewalld.service

开机不自动启动防火墙

sudo systemctl disable firewalld.service

二、开启防火墙

开启防火墙

sudo systemctl start firewalld.service

开机自动启动防火墙

sudo systemctl enable firewalld.service

查看防火墙状态

sudo systemctl status firewall.service

重新启动防火墙

sudo systemctl restart firewall.service

三、CentOS7 启动关闭服务命令(附加)

systemctl start firewalld.service  #启动一个服务

systemctl stop firewalld.service  #关闭一个服务

systemctl restart firewalld.service  #重启一个服务

systemctl status firewalld.service  #显示一个服务的状态

systemctl enable firewalld.service  #在开机时启用一个服务

systemctl disable firewalld.service  #在开机时禁用一个服务

systemctl is-enabled firewalld.service;echo $?  #查看服务是否开机启动

systemctl list-unit-files|grep enabled  #查看已启动的服务列表

 

版权声明:本文为songcloud原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。
本文链接:https://www.cnblogs.com/songcloud/p/15040626.html