使用iptables封杀内网的bt软件(1)


iptables很好很强大,看下例子就是其中之一。

我所在的网络情况是这样的!1台FC3和3台win2000组成一个局域网!四台机都接在100m的交换机上.在FC3上有两个网卡eth0接外网 adsl eth1接在交换机.FC3做nat带3台win2000上网!由于ADSL的带宽本来就慢如果内网有人用BT的话那就更慢啦!所有找了一下资料!决定封杀内网的bt软件!

用到cvs版本的iptables在ftp://ftp.netfilter.org/pub/iptables/snapshot/有下载 还要iptables的扩展包

patch-o-matic-ng在ftp://ftp.netfilter.org/pub/patch-o-matic-ng/snapshot/ 也有下载.

把patch-o-matic-ng-20041231.tar.bz2和 iptables-1.3.0-20041231.tar.bz2 拷贝到/usr/local/src目录下

首先先卸载了系统原先的iptables软件包

rpm -qa |grep iptables

rpm -e --nodeps iptables-devel

rpm -e --nodeps iptables

为了安装方便用 root用户登录

然后

tar -jxvf iptables-1.3.0-20041231.tar.bz2

tar -jxvf patch-o-matic-ng-20041231.tar.bz2

cd patch-o-matic-ng-20041231

./runme extra

输入你内核源代码的路径/usr/src/linux-2.6.10

输入你iptables源代码的路径/usr/local/src/iptables-1.3.0-20041231

然后按你自己的需要把iptables的扩展补丁打到内核(要实现封杀bt一定要选上ipp2p这扩展)

cd /usr/src/linux-2.6.10

make xconfig

把networking support-->networking options-->networking packet filtering-->IP:netfilter configruation-->ipp2p match选上

make

make modules_install

make install

新得带有ipp2p模块的新内核就安装好了

现在iptables有安装

cd /usr/local/src/iptables-1.3.0-20041231

make KERNEL_DIR=/usr/src/linux-2.6.10

make install KERNEL_DIR=/usr/src/linux-2.6.10

make install-devel

reboot


相关内容