软件路由论坛 - Linux - 免升内核在nat上封杀p2p(已试验成功)
来源:百度文库 编辑:神马文学网 时间:2024/04/27 11:23:45
免升内核在nat上封杀p2p(已试验成功)
os:redhat9.0
kernels:2.4.20-8 uname -a
iptables:系统自带1.2.7a iptables -V
首先下载对应自己系统版本的iptables源码:www.iptables.org 使用wget
然后下载最新的ipp2p补丁:www.ipp2p.org
先看介绍:
kernel
It is always a good idea to use the latest stable kernel because of recent bugfixes and improved stability. During it‘s development IPP2P was successful used with the following kernel versions:
2.4.18, 2.4.19, 2.4.20, 2.4.21, 2.4.22, 2.4.23, 2.4.26
2.6.3, 2.6.4, 2.6.6
This does NOT mean that IPP2P may not run together with other kernel versions but it was not tested yet. If someone finds out that IPP2P also is running stable with other kernel versions feel free to inform the author (contact). A very important source for updates of the netfilter code is the patch-o-matic next generation system (POM-ng) available at the netfilter homepage. It contains the latest bugfixes and netfilter extensions (like CLASSIFY, CONNMARK, ...). The daily snapshots may be a good choice to get the very latest kernel updates. IPP2P is also included in POM-ng. If you don‘t want to use the source tarball grep latest POM-ng snapshot and run "./runme ipp2p" to install IPP2P only or "./runme extra" for IPP2P and some other updates. You‘ll need to enable IPP2P support in kernel config and recompile kernel and iptables.
iptables
As said with kernel try to use a recent version of iptables as well. We used the following versions of iptables without any problems:
1.2.7a, 1.2.8, 1.2.9rc1, 1.2.9, 1.2.11
It is also possible (and likely) that IPP2P runs together with older versions as well but we‘re lacking of experiences on this issue. New versions of iptables are released in unsteady intervals at the netfilter homepage.
呵呵最低支持标准啊!~~
解iptables源码至/usr/src/iptables-1.2.7a
解ipp2p-0.8.0_rc3.tar.gz至 /root/download/ipp2p-0.8.0_rc3
cd /root/download/ipp2p-0.8.0_rc3
vi Makefie
找到IPTABLES_SRC = /usr/src/iptables
改为IPTABLES_SRC = /usr/src/iptables-1.2.7a (刚才我们下载了对应系统的源码并解压到了这里)
好了,保存退出。在ipp2p-0.8.0_rc3目录下执行
make
cp libipt_ipp2p.so /lib/iptables/
cp ipt_ipp2p.o /lib/modules/
insmod ipt_ipp2p.o
好了,这就可以使用iptables的参数了。
iptables -A FORWARD -m ipp2p --ipp2p -j DROP
iptables -L 查看FORWARD多了条规则。
顺便自己做成脚本。添加3项:
/sbin/insmod /root/download/ipp2p-0.8.0_rc3/ipt_ipp2p.o #加载模块
/sbin/iptables -A FORWARD -m ipp2p --ipp2p -j DROP
/sbin/iptables -A INPUT -m ipp2p --ipp2p -j DROP
实测不加过滤下载神六飞船升空录像700kB-1.0mB,加载后68-80KB稳定下载速度。
呵呵ipp2p.org不断升级,应该能改善p2p的猖獗流量。
附howto部分内容:
The following table shows a lineup of all module options currently available for IPP2P. Make sure not to use --ipp2p together with any other option already included in --ipp2p !
option P2P network protocol quality
--edk eDonkey, eMule, Kademlia TCP and UDP very good
--kazaa KaZaA, FastTrack TCP and UDP good
--gnu Gnutella TCP and UDP good
--dc Direct Connect TCP only good
--bit BitTorrent, extended BT TCP and UDP good
--apple AppleJuice TCP only (need feedback)
--winmx WinMX TCP only (need feedback)
--soul SoulSeek TCP only good (need feedback)
--ares Ares, AresLite TCP only moderate (DROP only)
os:redhat9.0
kernels:2.4.20-8 uname -a
iptables:系统自带1.2.7a iptables -V
首先下载对应自己系统版本的iptables源码:www.iptables.org 使用wget
然后下载最新的ipp2p补丁:www.ipp2p.org
先看介绍:
kernel
It is always a good idea to use the latest stable kernel because of recent bugfixes and improved stability. During it‘s development IPP2P was successful used with the following kernel versions:
2.4.18, 2.4.19, 2.4.20, 2.4.21, 2.4.22, 2.4.23, 2.4.26
2.6.3, 2.6.4, 2.6.6
This does NOT mean that IPP2P may not run together with other kernel versions but it was not tested yet. If someone finds out that IPP2P also is running stable with other kernel versions feel free to inform the author (contact). A very important source for updates of the netfilter code is the patch-o-matic next generation system (POM-ng) available at the netfilter homepage. It contains the latest bugfixes and netfilter extensions (like CLASSIFY, CONNMARK, ...). The daily snapshots may be a good choice to get the very latest kernel updates. IPP2P is also included in POM-ng. If you don‘t want to use the source tarball grep latest POM-ng snapshot and run "./runme ipp2p" to install IPP2P only or "./runme extra" for IPP2P and some other updates. You‘ll need to enable IPP2P support in kernel config and recompile kernel and iptables.
iptables
As said with kernel try to use a recent version of iptables as well. We used the following versions of iptables without any problems:
1.2.7a, 1.2.8, 1.2.9rc1, 1.2.9, 1.2.11
It is also possible (and likely) that IPP2P runs together with older versions as well but we‘re lacking of experiences on this issue. New versions of iptables are released in unsteady intervals at the netfilter homepage.
呵呵最低支持标准啊!~~
解iptables源码至/usr/src/iptables-1.2.7a
解ipp2p-0.8.0_rc3.tar.gz至 /root/download/ipp2p-0.8.0_rc3
cd /root/download/ipp2p-0.8.0_rc3
vi Makefie
找到IPTABLES_SRC = /usr/src/iptables
改为IPTABLES_SRC = /usr/src/iptables-1.2.7a (刚才我们下载了对应系统的源码并解压到了这里)
好了,保存退出。在ipp2p-0.8.0_rc3目录下执行
make
cp libipt_ipp2p.so /lib/iptables/
cp ipt_ipp2p.o /lib/modules/
insmod ipt_ipp2p.o
好了,这就可以使用iptables的参数了。
iptables -A FORWARD -m ipp2p --ipp2p -j DROP
iptables -L 查看FORWARD多了条规则。
顺便自己做成脚本。添加3项:
/sbin/insmod /root/download/ipp2p-0.8.0_rc3/ipt_ipp2p.o #加载模块
/sbin/iptables -A FORWARD -m ipp2p --ipp2p -j DROP
/sbin/iptables -A INPUT -m ipp2p --ipp2p -j DROP
实测不加过滤下载神六飞船升空录像700kB-1.0mB,加载后68-80KB稳定下载速度。
呵呵ipp2p.org不断升级,应该能改善p2p的猖獗流量。
附howto部分内容:
The following table shows a lineup of all module options currently available for IPP2P. Make sure not to use --ipp2p together with any other option already included in --ipp2p !
option P2P network protocol quality
--edk eDonkey, eMule, Kademlia TCP and UDP very good
--kazaa KaZaA, FastTrack TCP and UDP good
--gnu Gnutella TCP and UDP good
--dc Direct Connect TCP only good
--bit BitTorrent, extended BT TCP and UDP good
--apple AppleJuice TCP only (need feedback)
--winmx WinMX TCP only (need feedback)
--soul SoulSeek TCP only good (need feedback)
--ares Ares, AresLite TCP only moderate (DROP only)
软件路由论坛 - Linux - 免升内核在nat上封杀p2p(已试验成功)
免升内核在nat上封杀p2p(已试验成功)
如何在Linux路由上设置IP和MAC绑定
在Linux路由上怎么设置IP和MAC绑定?
P2P的NAT研究
linux内核编程(一)
netfilter: Linux 防火墙在内核中的实现
【免费用手机打电话的软件(需试验)
在 Linux NAT 監看 MSN 聊天內容
常见问题 什么是P2P封杀
Linux 2.4 NAT HOWTO
Linux 2.4 NAT HOWTO
linux内核编程(一) - csdn 新闻
何把内核中的信息打印到文件 - 内核源码 - Linux论坛
ADSL路由方式的NAT(端口映射)专题
ADSL路由方式的NAT(端口映射)专题
SYN Cookie原理及其在Linux内核中的实现
正文 - PF_KEY接口在OpenBSD内核中的实现 - Linux文库
TCP三次握手在linux内核中的实现
专门网论坛 - ◇Linux,BSD等平台◇ - 怎样在移动硬盘上安装linux
Linux 2.4 NAT HOWTO 简体中文版
linux下路由设置
Linux 内核编程风格
Linux内核Makefile文件