linux下清空所有iptables规则

运维 系统运维
iptables 是与最新的 2.6.x 版本Linux 内核集成的 IP 信息包过滤系统。我们在使用iptables时,有许多iptables垃圾规则不想要,如何清空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规则的方法,希望对大家有所帮助!

【编辑推荐】

  1. 如何清空其中一条iptables规则
  2. 如何清空iptables规则
  3. 如何保存iptables配置
  4. 保存iptables的防火墙规则的方法
  5. iptables日志通过MySQL来保存
  6. 关掉Iptables防火墙的相关的命令
  7. 教你如何关闭iptables网络端口
责任编辑:赵鹏 来源: 网络转载
相关推荐

2011-03-16 16:41:57

清空iptables

2011-03-16 16:48:32

iptables 清空

2011-03-17 17:45:45

iptables规则

2017-09-11 20:16:58

2009-11-30 09:56:16

2011-03-14 16:46:40

Linuxiptables上网

2011-03-18 09:26:13

Iptables规则

2011-03-16 10:59:57

2011-03-16 09:30:47

iptables过滤

2011-03-16 16:59:46

iptables 映射

2011-03-16 09:05:33

2011-04-21 09:54:14

Linuxiptables

2011-03-18 10:16:13

LinuxiptablesIP

2011-03-14 15:46:35

Iptables语法

2011-03-15 15:47:26

LinuxIptables防火墙

2011-03-16 10:12:27

LinuxIptables端口转发

2012-10-10 17:45:49

JavaScriptJavaScript规JavaScript控

2011-03-15 17:12:11

2011-03-15 15:47:34

netfilteriptables

2011-03-17 12:25:55

iptables ft
点赞
收藏

51CTO技术栈公众号