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 


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