linux下清空所有iptables规则


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

  1. iptables -t nat -F  
  2.  
  3. iptables -t nat -X  
  4.  
  5. iptables -t nat -P PREROUTING ACCEPT  
  6.  
  7. iptables -t nat -P POSTROUTING ACCEPT  
  8.  
  9. iptables -t nat -P OUTPUT ACCEPT  
  10.  
  11. iptables -t mangle -F  
  12.  
  13. iptables -t mangle -X  
  14.  
  15. iptables -t mangle -P PREROUTING ACCEPT  
  16.  
  17. iptables -t mangle -P INPUT ACCEPT  
  18.  
  19. iptables -t mangle -P FORWARD ACCEPT  
  20.  
  21. iptables -t mangle -P OUTPUT ACCEPT  
  22.  
  23. iptables -t mangle -P POSTROUTING ACCEPT  
  24.  
  25. iptables -F  
  26.  
  27. iptables -X  
  28.  
  29. iptables -P FORWARD ACCEPT  
  30.  
  31. iptables -P INPUT ACCEPT  
  32.  
  33. iptables -P OUTPUT ACCEPT  
  34.  
  35. iptables -t raw -F  
  36.  
  37. iptables -t raw -X  
  38.  
  39. iptables -t raw -P PREROUTING ACCEPT  
  40.  
  41. iptables -t raw -P OUTPUT ACCEPT  
  42.  

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

相关内容