Firewalld
檢視防火牆狀態
systemctl status firewalld
開啟防火牆
systemctl start firewalld
關閉防火牆
systemctl stop firewalld
新增新規則
firewall-cmd --zone=public --add-source=172.43.0.0/16 --permanent
新增指定埠規則
firewall-cmd --zone=public --add-port=80/tcp --permanent
移除指定埠規則
firewall-cmd --zone=public --remove-port=80/tcp --permanent
重新載入Firewalld
firewall-cmd --reload
檢視防火牆規則
firewall-cmd --zone=public --list-all
直接編輯配置檔案
vi /etc/firewalld/zones/public.xml
<port port="80" protocol="tcp"/>
<rule family="ipv4">
<source address="172.43.12.1"/>
<accept/>
</rule>
<rule family="ipv4">
<source address="172.43.12.1"/>
<port port="80" protocol="tcp"/>
<reject/>
</rule>