关于开启关闭防火墙、开机启动等。我的系统是CentOs7,重装换了CentOs8
systemctl |grep firewalld.service
systemctl stop firewalld.service
systemctl start firewalld.service systemctl restart firewalld.service
# 关闭自启动
systemctl disable firewalld.service
# 打开自启动
systemctl enable firewalld.service
# 查询自启动服务
systemctl list-unit-files|grep firewalld.service
扩展知识:systemctl is-enabled iptables.service#查询服务是否开机启动systemctl is-enabled servicename.service #开机运行服务systemctl enable *.service #取消开机运行systemctl disable *.service #启动服务systemctl start *.service #停止服务systemctl stop *.service #重启服务systemctl restart *.service #重新加载服务配置文件systemctl reload *.service #查询服务运行状态systemctl status *.service #显示启动失败的服务systemctl --failed
Copyright: 采用 知识共享署名4.0 国际许可协议进行许可 Links: https://lixj.fun/archives/centos防火墙开启关闭方法