linux下清空iptables规则具体方法如下:

  iptables -t nat -F

  iptables -t nat -X

  iptables -t nat -P PREROUTING ACCEPT

  iptables -t nat -P POSTROUTING ACCEPT

  iptables -t nat -P OUTPUT ACCEPT

  iptables -t mangle -F

  iptables -t mangle -X

  iptables -t mangle -P PREROUTING ACCEPT

  iptables -t mangle -P INPUT ACCEPT

  iptables -t mangle -P FORWARD ACCEPT

  iptables -t mangle -P OUTPUT ACCEPT

  iptables -t mangle -P POSTROUTING ACCEPT

  iptables -F

  iptables -X

  iptables -P FORWARD ACCEPT

  iptables -P INPUT ACCEPT

  iptables -P OUTPUT ACCEPT

  iptables -t raw -F

  iptables -t raw -X

  iptables -t raw -P PREROUTING ACCEPT

  iptables -t raw -P OUTPUT ACCEPT

  通过上本文的代码,我们可以清楚的知道了linux下清空所有iptables规则的方法,希望对大家有所帮助!