Centos7 Firewall配置

创建区域、添加接口到区域、设置区域

firewall-cmd --permanent --new-zone=dn42
firewall-cmd --permanent --zone=dn42 --set-target=DROP
firewall-cmd --permanent --zone=dn42 --add-interfaces=as0158_ex
firewall-cmd --permanent --zone=dn42 --add-service=dns
firewall-cmd --permanent --zone=dn42 --add-port=53/udp
firewall-cmd --permanent --zone=dn42 --add-protocol=icmp

查看

firewall-cmd --permanent --zone=dn42 --get-target
firewall-cmd --permanent --zone=dn42 --list-all
Share

You may also like...