<?xml version="1.0" encoding="gbk"?>
<rss version="2.0">
  <channel>
    <title>曲径通幽论坛 - iptables</title>
    <link>http://www.groad.net/bbs/forum.php?mod=forumdisplay&amp;fid=129</link>
    <description>Latest 20 threads of iptables</description>
    <copyright>Copyright(C) 曲径通幽论坛</copyright>
    <generator>Discuz! Board by Comsenz Inc.</generator>
    <lastBuildDate>Sun, 12 Apr 2026 04:21:01 +0000</lastBuildDate>
    <ttl>60</ttl>
    <image>
      <url>http://www.groad.net/bbs/static/image/common/logo_88_31.gif</url>
      <title>曲径通幽论坛</title>
      <link>http://www.groad.net/bbs/</link>
    </image>
    <item>
      <title>通过 u32 匹配屏蔽 SSLv3 或 TLSv1+</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=8946</link>
      <description><![CDATA[谈到这个话题时，有人会问，直接屏蔽 443 端口即可，大费周章的通过 u32 去屏蔽，意义何在？
没错，通过屏蔽 443 端口后，任何 SSLv3 或 TLSv1+ 也就废了。但这里仍然讨论此话题，一来的目的是加深 u32 匹配操作的认识；二来，实际上，有些基于 SSL 协议的，并没有完整 ...]]></description>
      <category>iptables</category>
      <author>beyes</author>
      <pubDate>Sun, 14 Jun 2015 02:50:42 +0000</pubDate>
    </item>
    <item>
      <title>--fragment 选项</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=8943</link>
      <description><![CDATA[--fragment，中文是碎片之意。在一些网络接口上，经常会用到 MTU 这个参数对数据包的大小进行限制，该参数定义了可以通过的数据包的最大尺寸。如果一个数据包的尺寸大于这个参数时，系统会将这个数据包分成更小的数据包（IP 碎片）来传输，在接收方一边，会对这些 IP 碎 ...]]></description>
      <category>iptables</category>
      <author>beyes</author>
      <pubDate>Thu, 11 Jun 2015 16:00:42 +0000</pubDate>
    </item>
    <item>
      <title>使用 u32 模块匹配</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=8942</link>
      <description><![CDATA[在 netfilter 下有一个叫 u32 的多功能匹配模块，允许我们检查数据包内各包头的任意数据，其使用方法也比其他模块要复杂许多，下面是几个实例。

不允许 TCP 协议的连接进来：

这里用 -I 插入确保规则生效，这是因为，如果用 -A 的话，可能会由于系统已经内置放行 ...]]></description>
      <category>iptables</category>
      <author>beyes</author>
      <pubDate>Thu, 11 Jun 2015 09:07:13 +0000</pubDate>
    </item>
    <item>
      <title>指定 DNS 查询</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=8913</link>
      <description><![CDATA[一般情况下，DNS 使用 53 端口查询，可通过 UDP 或 TCP 来传输，在网关上，可以将通过 53 端口的流量劫持到指定的 DNS 服务器上，方法是：

其中 eth1 为 wan 口网口，因为用户可能指定外网的一个 DNS 服务器。

这里解释一下，为什么要用 PREROUTING 链。记住一点 ...]]></description>
      <category>iptables</category>
      <author>beyes</author>
      <pubDate>Sun, 03 May 2015 07:16:35 +0000</pubDate>
    </item>
    <item>
      <title>iptables error: unknown option --dport</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=8872</link>
      <description><![CDATA[有时可能遇到：
不认识 --dport 选项，一个很可能的原因是你指定了 -p all ，如果是 ICMP 协议，那么不存在端口概念，因此这里就会出错，应该指定为 -p tcp 或 -p udp 。]]></description>
      <category>iptables</category>
      <author>beyes</author>
      <pubDate>Thu, 02 Apr 2015 01:46:56 +0000</pubDate>
    </item>
    <item>
      <title>用ipset配置linux防火墙</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=8844</link>
      <description><![CDATA[iptables是在linux内核里配置防火墙规则的用户空间工具,它实际上是netfilter框架的一部分.可能因为iptables是netfilter框架里最常见的部分,所以这个框架通常被称为iptables,iptables是linux从2.4版本引入的防火墙解决方案.

ipset是iptables的扩展,它允许你创建 匹配 ...]]></description>
      <category>iptables</category>
      <author>easy</author>
      <pubDate>Fri, 13 Feb 2015 02:24:17 +0000</pubDate>
    </item>
    <item>
      <title>multiport 匹配</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=8823</link>
      <description><![CDATA[使用 xt_multiport.ko 模块提供的 multiport 功能可以一次匹配多个端口，multiport 必须与 -p tcp 或 -p udp 一起使用，比如：]]></description>
      <category>iptables</category>
      <author>beyes</author>
      <pubDate>Wed, 21 Jan 2015 16:24:17 +0000</pubDate>
    </item>
    <item>
      <title>屏蔽网游服务器IP</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=8818</link>
      <description><![CDATA[如果家里有小孩在玩某个网游，可以对该网游服务器的 IP 进行屏蔽。假设路由器装有 Openwrt ，那么运行下面命令：

之所以使用 FORWARD ，是因为数据是经由路由来转发的。又由于连接网游服务器，是从客户端连向服务器，因此使用 -d 选项。]]></description>
      <category>iptables</category>
      <author>beyes</author>
      <pubDate>Wed, 14 Jan 2015 06:14:30 +0000</pubDate>
    </item>
    <item>
      <title>加入新规则和插入新规则有什么不同？</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=8816</link>
      <description><![CDATA[加入新规则和插入新规则有什么不同？

加入新规则使用选项 -A (add)，插入新规则使用选项 -I (insert)。

加入新规则将新添的规则添加到原有规则的后边，比如原来已经有了 5 条规则，那么加入的新规则就为第 6 条。

插入新规则默认（没有指定插入的位置）是将新 ...]]></description>
      <category>iptables</category>
      <author>beyes</author>
      <pubDate>Sun, 11 Jan 2015 08:25:07 +0000</pubDate>
    </item>
    <item>
      <title>NAPT 设置</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=8791</link>
      <description><![CDATA[在 《一对一 NAT 》中提到的 NAT 有一个好处是你的公司有许多个固定外网 IP 可用，但这种福利比较少，更多的情况是使用 ADSL 拨号而只有一个公网 IP （这里假设是 10.0.1.200，位于网卡 eth0），那么遇到这种情况该怎么处理内网服务器问题呢？方法是使用 NAPT (Network  ...]]></description>
      <category>iptables</category>
      <author>beyes</author>
      <pubDate>Wed, 10 Dec 2014 06:53:48 +0000</pubDate>
    </item>
    <item>
      <title>一对一 NAT</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=8790</link>
      <description><![CDATA[现在假设路由上安装了 3 个网卡，分别是 eth0, eth1, eth2 。

假设内网有两台服务器，其内网 IP 分别为 192.168.0.1 （WEB 服务器）和 192.168.0.2（MAIL 服务器） ，服务器接在 eth1 所在网段。

内网其它普通主机位于 eth2 所在网段 192.168.1.0/24 。

eth0  ...]]></description>
      <category>iptables</category>
      <author>beyes</author>
      <pubDate>Wed, 10 Dec 2014 06:42:43 +0000</pubDate>
    </item>
    <item>
      <title>多对多 NAT</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=8789</link>
      <description><![CDATA[多对多 NAT 是你拥有一组连续的公网 IP，当内网对外发起的第一个链接请求时，会用上第一个公网 IP；发起第二个链接请求时，用上第二个公网IP... ...直到用完所有公网 IP ，然后再返回从第一条。多对多 NAT 的规则很简单，参考 《一对多 NAT》的模型，只需要简单的执行下 ...]]></description>
      <category>iptables</category>
      <author>beyes</author>
      <pubDate>Wed, 10 Dec 2014 04:06:56 +0000</pubDate>
    </item>
    <item>
      <title>一对多 NAT</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=8788</link>
      <description><![CDATA[一对多 NAT 是常见的一种 NAT，像家庭网络中通过路由器来上网一般就属于这种 NAT 。“多” 表示局域网中多个客户机； “一” 是拨号获得的公网 IP 。

假设路由上有两张网卡，分别是 eth0 和 eth1，eth0 对外，eth1 对内。eth0 上假设有公网 IP 103.22.39.24，eth1 上 ...]]></description>
      <category>iptables</category>
      <author>beyes</author>
      <pubDate>Wed, 10 Dec 2014 03:58:45 +0000</pubDate>
    </item>
    <item>
      <title>iptables详解</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=8787</link>
      <description><![CDATA[一：前言


]]></description>
      <category>iptables</category>
      <author>easy</author>
      <pubDate>Wed, 10 Dec 2014 03:07:35 +0000</pubDate>
    </item>
    <item>
      <title>REDIRECT 目标</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=8744</link>
      <description><![CDATA[REDIRECT 目标用来将数据包重定向到机器的本身上，比如在 squid 中，我们可以将所有的 HTTP 数据包都重定向到 HTTP 代理（Squid）上来，这就形成一种透明代理机制，也就是 LAN 中的客户端完全感觉不到代理的存在。
需要注意的是，REDIRECT 一般仅用在 PREROUTING 和 OU ...]]></description>
      <category>iptables</category>
      <author>beyes</author>
      <pubDate>Wed, 05 Nov 2014 06:26:21 +0000</pubDate>
    </item>
    <item>
      <title>RETURN</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=8740</link>
      <description><![CDATA[RETURN 结束在目前规则炼中的过滤程序，返回主规则炼继续过滤，如果把自订规则炼看成是一个子程序，那么这个动作，就相当 提早结束子程序并返回到主程序中。 


RETURN means stop traversing this chain and resume at the next rule in the previous (calling) c ...]]></description>
      <category>iptables</category>
      <author>easy</author>
      <pubDate>Mon, 03 Nov 2014 09:24:16 +0000</pubDate>
    </item>
    <item>
      <title>使用IPTABLES限制IP上传下载速度</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=8734</link>
      <description><![CDATA[iptables 限制某 IP 的上传速度为 1000KB/秒（8Mbps，流入服务器带宽），即在此IP所在的服务器或VPS上wget的速度



取消 iptables 限速：


 

限制某IP的上传速度为2000KB/秒（16Mbps，流入服务器带宽），即在此IP所在的服务器或VPS上wget的速度


取消限 ...]]></description>
      <category>iptables</category>
      <author>beyes</author>
      <pubDate>Thu, 30 Oct 2014 03:50:23 +0000</pubDate>
    </item>
    <item>
      <title>POSTROUTING 和 PREROUTING 应用举例</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=8352</link>
      <description><![CDATA[1. POSTROUTING 举例


-t nat :  选择表，表示使用 Netfilter 的 NAT 机制。

-A POSTROUTING : 选择功能，表示要执行的操作为 SNAT 机制。

-o eth0 : 选择数据包流向的网口，在执行 SNAT 或 DNAT 时该项必选，否则出错。

-s 192.168.0.0/24 : 指定来源网段 ...]]></description>
      <category>iptables</category>
      <author>beyes</author>
      <pubDate>Wed, 16 Apr 2014 03:08:31 +0000</pubDate>
    </item>
    <item>
      <title>-A RH-Firewall-1-INPUT -j REJECT --reject-with icmp-host-prohibited</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=7507</link>
      <description><![CDATA[在一次使用 rsync 做同步服务时，明明已经正确添加了 accept rsync 服务端口(873)的 iptables 规则，却发现怎么都连不上。由于该规则简单且不会有误，也没有怀疑是 iptables 的问题，直到绕了个大圈子去排除了 rsync 的问题后，才将注意力重新集中在 iptables 上来。

 ...]]></description>
      <category>iptables</category>
      <author>beyes</author>
      <pubDate>Sun, 11 Nov 2012 15:40:11 +0000</pubDate>
    </item>
    <item>
      <title>浅析 /proc/net/nf_conntrack 文件</title>
      <link>http://www.groad.net/bbs/forum.php?mod=viewthread&amp;tid=7091</link>
      <description><![CDATA[/proc/net/nf_contrack 是连接跟踪文件，它里面的内容由 nf_conntrack.ko 模块写入。在 iptables 中使用 -m state 选项时，iptables 不但加载 xt_state.ko 模块，且 nf_conntrack.ko 模块也会被加载进来。一般而言，xt_state.ko 和 nf_conntrack.ko 这两个模块在许多 Li ...]]></description>
      <category>iptables</category>
      <author>beyes</author>
      <pubDate>Wed, 23 May 2012 09:47:14 +0000</pubDate>
    </item>
  </channel>
</rss>