CentOS 7打开关闭防火墙相关命令

2025-10-30 03:12:40

1、查看centos 版本:cat /etc/redhat-release

CentOS 7打开关闭防火墙相关命令

CentOS 7打开关闭防火墙相关命令

2、启动服务:systemctl start firewalld.service

如果服务报错Failed to start firewalld.service: Unit is masked

执行systemctl unmask firewalld.service

再启动 systemctl start firewalld.service

CentOS 7打开关闭防火墙相关命令

CentOS 7打开关闭防火墙相关命令

3、关闭服务:systemctl stop firewalld.service

CentOS 7打开关闭防火墙相关命令

4、重启服务:systemctl restart firewalld.service

CentOS 7打开关闭防火墙相关命令

5、显示服务的状态:systemctl status firewalld.service

CentOS 7打开关闭防火墙相关命令

6、在开机时启用/关闭服务

systemctl enable firewalld.service

systemctl disable firewalld.service

CentOS 7打开关闭防火墙相关命令

7、查看已启动的服务列表

systemctl list-unit-files|grep enabled

CentOS 7打开关闭防火墙相关命令

8、停止 firewalld

# systemctl stop firewalld

 

# systemctl mask firewalld

CentOS 7打开关闭防火墙相关命令

声明:本网站引用、摘录或转载内容仅供网站访问者交流或参考,不代表本站立场,如存在版权或非法内容,请联系站长删除,联系邮箱:site.kefu@qq.com。
猜你喜欢