iptables -- firewalld防火牆

firewalld防火牆

public:僅允許訪問本機的sshd等少數幾個服務

trusted:允許任何訪問

block:阻塞任何來訪請求

drop:丟棄任何來訪的數據包

查看安全域 firewall-cmd  --get-default-zone

修改安全域 firewall-cmd  --set-default-zone=trusted

查看規則   firewall-cmd  --list-all  --zone=block

設置規則   firewall-cmd  --permanent  --zone=block  --add-source=172.34.0.0/24

                 firewall-cmd  --permanent  --zone=trusted  --add-forward-port=port=5423:proto=tcp:toport=80


firewalld 最終還是通過創建iptables規則來實現的


刪除規則

# iptables-save

# iptables -t nat -F

# iptables -t nat -X

# iptables-save 


# rmmod iptable_nat

# rmmod iptable_filter


mangle

# iptables -t mangle -F

# iptables -t mangle -X

# rmmod iptable_mangle

# iptables-save 

filter

iptables -t filter -F

# iptables -t filter -X

# rmmod iptable_filter

# iptables-save






 513  iptables-save 

  514  iptables -F

  515  iptables -X

  516  iptables -t nat -F

  517  iptables -t nat -X

  518  rmmod iptable_nat

  519  rmmod iptable_filter

  520  iptables-save 

  521  iptables -t mangle -F

  522  iptables -t mangle -X

  523  rmmod iptable_mangle

  524  iptables-save 

  525  history 


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章