免费注册 查看新帖 |

Chinaunix

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

[网络管理] platinum请进,有关IPTABLES的问题请教 [复制链接]

论坛徽章:
0
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2005-07-09 15:19 |只看该作者 |倒序浏览
想问一下IPTABLES的扩展模块能否同时调用。例如我想对部分地址段禁止BT,想同时使用iprange和ipp2p模块,是否能同时调用?如果可以规则应该怎样写?
这样写报错:
iptables -A FORWARD -m ipp2p --edk --kazaa --bit -m iprange --src-range 192.168.1.140-192.168.1.154 -j DROP
iptables v1.3.1:
ipp2p-parameter problem: for ipp2p usage type: iptables -m ipp2p --help

Try `iptables -h' or 'iptables --help' for more information.
如果改成:
iptables -A FORWARD -m ipp2p --edk --kazaa --bit iprange --src-range 192.168.1.140-192.168.1.154 -j DROP
Bad argument `iprange'
Try `iptables -h' or 'iptables --help' for more information.

论坛徽章:
0
2 [报告]
发表于 2005-07-09 15:24 |只看该作者

platinum请进,有关IPTABLES的问题请教

您至少应该贴出出错信息。

论坛徽章:
0
3 [报告]
发表于 2005-07-09 16:44 |只看该作者

platinum请进,有关IPTABLES的问题请教

已根据楼上意见帖出出错信息。

论坛徽章:
0
4 [报告]
发表于 2005-07-09 19:13 |只看该作者

platinum请进,有关IPTABLES的问题请教

iprange 是一个 module
你 --bit iprange 这么用是什么意思?

论坛徽章:
0
5 [报告]
发表于 2005-07-10 12:23 |只看该作者

platinum请进,有关IPTABLES的问题请教

咳咳……我在帖子里已经说得很明白了啊,我是想对部分地址段的IP禁止BT类的下载。不是有个模块是-m iprange和另外一个-m ipp2p的模块吗?我就是想问你这两个模块能不能重叠使用。如果可以应该怎么写规则?

论坛徽章:
0
6 [报告]
发表于 2005-07-10 12:27 |只看该作者

platinum请进,有关IPTABLES的问题请教

你没看懂我的意思啦
我是说 --bit iprange 是不行的
每个模块前面必须有个 -m
你 --bit iprange 叫什么?

iptables -m xxx -m yyy -m zzz
你如果同时用 3 个模块,应该这样来用

论坛徽章:
0
7 [报告]
发表于 2005-07-10 14:49 |只看该作者

platinum请进,有关IPTABLES的问题请教

原帖由 "platinum" 发表:
你没看懂我的意思啦
我是说 --bit iprange 是不行的
每个模块前面必须有个 -m
你 --bit iprange 叫什么?

iptables -m xxx -m yyy -m zzz
你如果同时用 3 个模块,应该这样来用

这个就是规则执行的错误提示,在首帖的时候搞忘了一个-m:
[root@Server1 root]# iptables -A FORWARD -m ipp2p --edk --kazaa --bit -m iprange --src-range 192.168.1.140-192.168.1.154 -j DROP
iptables v1.3.1:
ipp2p-parameter problem: for ipp2p usage type: iptables -m ipp2p --help

Try `iptables -h' or 'iptables --help' for more information.
[root@Server1 root]# iptables -A FORWARD -m ipp2p --edk --kazaa --bit iprange --src-range 192.168.1.140-192.168.1.154 -j DROP
Bad argument `iprange'
Try `iptables -h' or 'iptables --help' for more information.
[root@Server1 root]#

从以上的错误提示看当使用了-m ipp2p后如果还重叠使用-m iprange时iptables好象会认为-m iprange是-m ipp2p的另外一个参数,所以认为是非法的。如果在iprange前面不加-m的话iptables又会认为是iptables的基础模块而报非法参数的错误。你可以自己试一下是否能够多模块同时叠加使用。

论坛徽章:
0
8 [报告]
发表于 2005-07-10 14:53 |只看该作者

platinum请进,有关IPTABLES的问题请教

贴图为证:

error.jpg (47.71 KB, 下载次数: 70)

error.jpg

论坛徽章:
0
9 [报告]
发表于 2005-07-10 16:18 |只看该作者

platinum请进,有关IPTABLES的问题请教


  1. # iptables -A FORWARD -m iprange --src-range 192.168.1.140-192.168.1.154 -m ipp2p --edk --kazaa --bit -j DROP
复制代码

ipp2p 比较特殊,要注意顺序

论坛徽章:
0
10 [报告]
发表于 2005-07-11 09:38 |只看该作者

platinum请进,有关IPTABLES的问题请教

[quote]原帖由 "platinum"]ipp2p 比较特殊,要注意顺序[/quote 发表:


OK,规则没报错了。但未知是否起作用,有待观察。
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

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

清除 Cookies - ChinaUnix - Archiver - WAP - TOP