ipp2p限制BT

RH AS3 内核为: 2.4.21-15.EL。iptables版本为:1.2.9

1. 下载最新的patch-o-matic-ng补丁和最新的iptables源代码。放到/usr/src 下

http://ftp.netfilter.org/pub/patch-o-matic-ng/snapshot/   patch-o-matic-ng

http://www.netfilter.org/files/iptables-1.3.1.tar.bz2  iptables

2. 如果你的系统里没有安装内核源码请自行安装。解压缩patch-o-matic-ng和iptables包

  tar –jxvf patch-o-matic-ng-20050302.tar.bz2

  tar –jxvf  iptables-1.31..tar.bz2

3. 给内核打补丁

  cd  /usr/src/patch-o-matic-ng-20050302

  #KERNEL_DIR=/usr/src/linux-2.4 IPTABLES_DIR=/usr/src/iptables-1.3.1 ./runme extra

按照提示打相应的补丁就可以了。我只选择了ipp2p,connlimit,time模块

4. 编译内核

  cd /usr/src/linux-2.4

  make prproper

  make config

在这里的前半部分一直安回车就可以了。遇到network option的部分时候选择需要的模块即可。

然后在一路回车至结束。

make dep

make clean

make bzImage

make modules

make modules_install

make install

reboot

启动新内核

5. 编译iptables

cd /usr/src/iptables-1.3.1

make KERNEL_DIR=/usr/src/linux-2.4
make BINDIR=/sbin LIBDIR=/lib MANDIR=/usr/share/man install
如果没什么错误的话iptables就升级到1.3.1的版本了
6. 测试
Iptables –m ip2p2 –help
iptables -A FORWARD -m ipp2p --edk --kazaa --bit -j DROP

在我的机器上测试后发现,可以限制BT下载速率最高为30-40K。(总带宽为6M)

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值