Chinaunix首页 | 论坛 | 博客
  • 博客访问: 5348454
  • 博文数量: 890
  • 博客积分: 12876
  • 博客等级: 上将
  • 技术积分: 10760
  • 用 户 组: 普通用户
  • 注册时间: 2004-10-04 14:18
个人简介

猝然临之而不惊,无故加之而不怒。

文章分类

全部博文(890)

文章存档

2016年(1)

2014年(18)

2013年(41)

2012年(48)

2011年(65)

2010年(84)

2009年(121)

2008年(101)

2007年(129)

2006年(95)

2005年(118)

2004年(69)

分类: LINUX

2007-01-25 16:47:12

显示当前防火墙规则表:
iptables -L -n
删除一条规则表:
iptables -D chain N
eg:
iptables -D INPUT 2
删除INPUT链中第2条规则

运行iptables --help得到的
简单翻译一下
--numeric     -n              numeric output of addresses and ports
/* 输出地址或端口的号码 */
--delete  -D chain            Delete matching rule from chain
/* 从链中删除匹配的规则 */
--delete  -D chain rulenum    Delete rule rulenum (1 = first) from chain
/* 从链中第N(rule num)条规则

使用service iptables save 也可以保存防火墙规则。

IPTABLES-SAVE
总览
iptables-save [-c] [-t table]
说明
       通过简单的语法格式把一个IP TABLE的内容转储到STDOUT(标准输出).可以
       用由shell提供I/0重定向写到一个文件中
       -c, --counters
 输出中包括所有包和字节计数器的当前值
       -t, --table tablename
 仅输出指定表名的那个表,若没有指定,将输出所有可用的表
 
IPTABLES-RESTORE
总览
       iptables-restore [-c] [-n]
说明
       iptables-restore的作用是通过STDIN(标准输入)上指定的数据来恢复IP Table。
       由你的shell提供的I/O重定向功能从一个文件中读取。
       -c, --counters
 恢复所有包和字节计数器的当前值
       -n, --noflush
 不删除表中以前的内容,如果没有指定(这一参数),iptables-restore会清空(删除)所有以前表中的内容。
阅读(1901) | 评论(0) | 转发(0) |
0

上一篇:sed学习笔记

下一篇:iptables + squid脚本

给主人留下些什么吧!~~