免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 2076 | 回复: 3
打印 上一主题 下一主题

[系统管理] 求iptables各链区别的详细资料。。。。 [复制链接]

论坛徽章:
1
狮子座
日期:2014-04-19 19:35:43
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2014-08-25 17:00 |只看该作者 |倒序浏览
各位大神。。。最近在看iptables,但是对3个表中的重合链的区别分的不是很清楚,比如说filter中的output链和nat中的output链的区别。。。能给出点例子说明一下吗?麻烦懂的讲解一下哈。。。。

论坛徽章:
33
荣誉会员
日期:2011-11-23 16:44:17天秤座
日期:2014-08-26 16:18:20天秤座
日期:2014-08-29 10:12:18丑牛
日期:2014-08-29 16:06:45丑牛
日期:2014-09-03 10:28:58射手座
日期:2014-09-03 16:01:17寅虎
日期:2014-09-11 14:24:21天蝎座
日期:2014-09-17 08:33:55IT运维版块每日发帖之星
日期:2016-04-17 06:23:27操作系统版块每日发帖之星
日期:2016-04-18 06:20:00IT运维版块每日发帖之星
日期:2016-04-24 06:20:0015-16赛季CBA联赛之天津
日期:2016-05-06 12:46:59
2 [报告]
发表于 2014-08-25 17:26 |只看该作者
man iptables
  1. TABLES
  2.        There are currently three independent tables (which tables are present at any time depends on the kernel configuration options and which modules are present).

  3.        -t, --table table
  4.               This option specifies the packet matching table which the command should operate on.  If the kernel is configured with automatic module loading, an attempt will be made  to
  5.               load the appropriate module for that table if it is not already there.

  6.               The tables are as follows:

  7.               filter:
  8.                   This  is the default table (if no -t option is passed). It contains the built-in chains INPUT (for packets destined to local sockets), FORWARD (for packets being routed
  9.                   through the box), and OUTPUT (for locally-generated packets).

  10.               nat:
  11.                   This table is consulted when a packet that creates a new connection is encountered.  It consists of three built-ins: PREROUTING (for altering packets as  soon  as  they
  12.                   come in), OUTPUT (for altering locally-generated packets before routing), and POSTROUTING (for altering packets as they are about to go out).

  13.               mangle:
  14.                   This  table  is  used  for specialized packet alteration.  Until kernel 2.4.17 it had two built-in chains: PREROUTING (for altering incoming packets before routing) and
  15.                   OUTPUT (for altering locally-generated packets before routing).  Since kernel 2.4.18, three other built-in chains are also supported: INPUT (for packets coming into the
  16.                   box itself), FORWARD (for altering packets being routed through the box), and POSTROUTING (for altering packets as they are about to go out).

  17.               raw:
  18.                   This  table  is used mainly for configuring exemptions from connection tracking in combination with the NOTRACK target.  It registers at the netfilter hooks with higher
  19.                   priority and is thus called before ip_conntrack, or any other IP tables.  It provides the following built-in chains: PREROUTING (for packets arriving  via  any  network
  20.                   interface) OUTPUT (for packets generated by local processes)
复制代码

论坛徽章:
1
狮子座
日期:2014-04-19 19:35:43
3 [报告]
发表于 2014-08-26 11:05 |只看该作者
老大,能给点详细的例子不。。。回复 2# q1208c


   

论坛徽章:
33
荣誉会员
日期:2011-11-23 16:44:17天秤座
日期:2014-08-26 16:18:20天秤座
日期:2014-08-29 10:12:18丑牛
日期:2014-08-29 16:06:45丑牛
日期:2014-09-03 10:28:58射手座
日期:2014-09-03 16:01:17寅虎
日期:2014-09-11 14:24:21天蝎座
日期:2014-09-17 08:33:55IT运维版块每日发帖之星
日期:2016-04-17 06:23:27操作系统版块每日发帖之星
日期:2016-04-18 06:20:00IT运维版块每日发帖之星
日期:2016-04-24 06:20:0015-16赛季CBA联赛之天津
日期:2016-05-06 12:46:59
4 [报告]
发表于 2014-08-26 11:09 |只看该作者
本帖最后由 q1208c 于 2014-08-26 11:09 编辑

回复 3# 驱魔圣手

上面的 man 中 已经说明的很明白了.

我不是很常用 iptables. 也没有很多现成的例子.

下面的图出自 http://en.wikipedia.org/wiki/Netfilter, 可以参考一下.



   
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP