Linux系统的防火墙管理

Centos7以下的版本

查看防火墙状态:
service iptables status
iptables:未运行防火墙。
Linux系统的防火墙管理
开启状态。
开启防火墙:
[[email protected] ~]# service iptables start
关闭防火墙:
[[email protected] ~]# service iptables stop
Linux系统的防火墙管理

Centos7及以上的版本

firewall-cmd –state 查看防火墙状态
Linux系统的防火墙管理
停止/重启/启动firewall
systemctl stop/restart/start firewalld.service
Linux系统的防火墙管理
禁止/启用 firewall开机启动
systemctl disable/enable firewalld.service