一、firewalld的基本使用
systemctl start firewalld
systemctl stop firewalld
systemctl status firewalld
systemctl disable firewalld
systemctl enable firewalld
二、systemctl是CentOS7的服务管理工具中主要的工具,它融合之前service和chkconfig的功能于一体。
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
systemctl list-unit-files|grep enabled
systemctl --failed
三、配置firewalld-cmd
firewall-cmd --version
firewall-cmd --help
firewall-cmd --state
firewall-cmd --zone=public --list-ports
firewall-cmd --reload
firewall-cmd --get-active-zones
firewall-cmd --get-zone-of-interface=eth0
firewall-cmd --panic-on
firewall-cmd --panic-off
firewall-cmd --query-panic
四、那怎么开启一个端口呢
#--permanent永久生效,没有此参数重启后失效
firewall-cmd --zone=public --add-port=80/tcp --permanent
firewall-cmd --reload
firewall-cmd --zone= public --query-port=80/tcp
firewall-cmd --zone= public --remove-port=80/tcp --permanent
评论区