在linux as3中利用iptables+ipp2p限制bt、eMule等..
时间:2005-12-05 来源:vincent.shan
在linux as3中利用iptables+ipp2p限制bt、eMule等下载- -
Tag: linux as3 iptables ipp2p限制 bt
Tag: linux as3 iptables ipp2p限制 bt
在linux as3中利用iptables+ipp2p限制bt、eMule等下载==! |
为了减小网络负担限制bt等的软件下载可以通过iptables增加ipp2p的模块来实现 /etc/init.d/iptables stop rpm -q iptables 获取iptables 及patch-o-matic-ng cd /usr/src/ wget http://www.netfilter.org/files/iptables-1.3.3.tar.bz2 wget ftp://ftp.netfilter.org/pub/patch-o-matic-ng/snapshot/patch-o-matic-ng-20051015.tar.bz2 解压缩这两个压缩包 tar xjvf iptables-1.3.3.tar.bz2 tar xjvf patch-o-matic-ng-20051015.tar.bz2 给netfilter打补丁 cd /usr/src/linux-2.4 uname -r,可得到“2.4.21-15.EL”的信息 修改 Makefile,将“EXTRAVERSION = -15.ELcustom”改为“EXTRAVERSION = -15.EL” vi Makefile VERSION = 2 PATCHLEVEL = 4 SUBLEVEL = 21 EXTRAVERSION = -15.ELcustom 即: VERSION = 2 PATCHLEVEL = 4 SUBLEVEL = 20 EXTRAVERSION = 2.4.21-15.EL 保存推出 make mrproper make oldconfig 技巧:在make menuconfig时,我们面对众多的选项常常不知道该如何选择,此时可以把安装时的配置文件copy到/usr/src/linux-2.4中: cp /boot/config-2.4.* /usr/src/linux-2.4/.config 给netfilter打补丁 解开patch-o-matic-ng-20051015.tar.bz2 包后,进入该目录,就会发现有很多目录,其实每个目录对应一个模块. 我们可以这样来选择,根据不同贮仓库submitted|pending|base|extra, cd /usr/src/patch-o-matic-ng-20051015 例如:KERNEL_DIR=/usr/src/linux-2.4 IPTABLES_DIR=/usr/src/iptables-1.3.3 ./runme base . 或:KERNEL_DIR=/usr/src/linux-2.4 IPTABLES_DIR=/usr/src/iptables-1.3.3 ./runme extra 执行后,会测试是否已经应用和提示你是否应用该模块,但这样会遍历所有模块,有很多是用不着的,并且可能和系统版本有冲突,如果不管三七二十一全部选择的话, 一般都会在编译和使用时出错.所以推荐用cat /模块目录名/info 和cat /模块目录名/help 看过后,认为适合自己,才选择. 我是针对在上面看过后,有目的的一个一个的应用的,这样做: KERNEL_DIR=/usr/src/linux-2.4 IPTABLES_DIR=/usr/src/iptables-1.3.3 ./runme string (新版本已经没有这个选项) 执行后,会测试是否已经应用和提示你是否应用该模块,按"y"应用.然后继续下一个 KERNEL_DIR=/usr/src/linux-2.4 IPTABLES_DIR=/usr/src/iptables-1.3.3 ./runme comment KERNEL_DIR=/usr/src/linux-2.4 IPTABLES_DIR=/usr/src/iptables-1.3.3 ./runme connlimit KERNEL_DIR=/usr/src/linux-2.4 IPTABLES_DIR=/usr/src/iptables-1.3.3 ./runme time KERNEL_DIR=/usr/src/linux-2.4 IPTABLES_DIR=/usr/src/iptables-1.3.3 ./runme iprange KERNEL_DIR=/usr/src/linux-2.4 IPTABLES_DIR=/usr/src/iptables-1.3.3 ./runme geoip KERNEL_DIR=/usr/src/linux-2.4 IPTABLES_DIR=/usr/src/iptables-1.3.3 ./runme nth KERNEL_DIR=/usr/src/linux-2.4 IPTABLES_DIR=/usr/src/iptables-1.3.3 ./runme ipp2p KERNEL_DIR=/usr/src/linux-2.4 IPTABLES_DIR=/usr/src/iptables-1.3.3 ./runme quota 上面全部完成后, cd /usr/src/linux-2.4 make menuconfig, 确认
|
相关阅读 更多 +