个人工具
登录
查看“IptablesHowTo”的源代码 - Ubuntu中文
页面
讨论
查看源代码
历史
搜索
导航
首页
最近更改
随机页面
页面分类
帮助
编辑
编辑指南
沙盒
新闻动态
字词处理
工具
链入页面
相关更改
特殊页面
页面信息
查看“IptablesHowTo”的源代码
来自Ubuntu中文
←
IptablesHowTo
跳转至:
导航
,
搜索
因为以下原因,你没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
=== Editing iptables 编辑iptables === The only problem with our setup so far is that even the loopback port is blocked. We could have written the drop rule for just eth0 by specifying -i eth0, but we could also add a rule for the loopback. If we append this rule, it will come too late - after all the traffic has been dropped. We need to insert this rule onto the fourth line. 进行至此,仍有一个问题,就是环回接口也被阻断了。刚才添加DROP规则的时候其实就可以使用-i eth0来解决这一问题。然而我们也可以为环回接口添加一条新规则来解决这个问题。但是不能将新规则追加到末尾,因为前一条规则已经把所有报文都丢弃了,而应该把它插到DROP规则前面,即规则表中第四行的位置。 <pre><nowiki> # iptables -I INPUT 4 -i lo -j ACCEPT # iptables -L Chain INPUT (policy ACCEPT) target prot opt source destination ACCEPT all -- anywhere anywhere state RELATED,ESTABLISHED ACCEPT tcp -- anywhere anywhere tcp dpt:ssh ACCEPT tcp -- anywhere anywhere tcp dpt:www ACCEPT all -- anywhere anywhere DROP all -- anywhere anywhere </nowiki></pre> The last two lines look nearly the same, so we will list iptables in greater detail. 规则表中的最后两行几乎一样,为了看看它们到底有什么不同,我们可以使用 <pre><nowiki> # iptables -L -v </nowiki></pre>
返回至
IptablesHowTo
。