| The
described process below works for Kernel 2.6.24 and has been tested on Debian Etch 4.0 If you have questions contact me at nicolas_henry [(]At})] orange.fr So here is the deal. I wanted to have my Debian 4.0 box filter P2P trafic, like Bittorrent and Edonkey, and this under the Kernel 2.6.24. Well that is of course possible, but it involves to patch things at multiple level, and finally the solution for ipp2p came from a web site in Thailand (?unsure) that located Gentoo (!) patches that applies and fix latest build/compile issues with ipp2p. Suchart Blog : http://suchart.wordpress.com/2008/02/02/kernel-2624-iptables-140-l7-filter-217-ipp2p-082-on-debian-40/ I also copied on my site the Gentoo ipp2P patches to make sure they do not disapear from the cyberspace : Patch for Iptables : ipp2p-0.8.2-iptables-1.4.0.patch Patch for Kernel 2.6.24 : ipp2p-0.8.2-kernel-2.6.22.patch and I made a patch for the ipp2p Makefile changes, that is a bit tricky to handle : Patch for ipp2p Makefile : ipp2p-0.8.2-makefile-patch The patch for Kernel 2.6.22 works fine for Kernel 2.6.24. 1. Install the needed sources in the /usr/src directory. cd /usr/src/
2. Patch the Kernel
cd /usr/src/linux
3. Patch iptables
cd ../iptables
4. Configure and compile the Kernel
cd /usr/src/linux
Configure your Kernel with your modules and drivers has needed. Make sure to select the right option to activate Layer 7 filtering :
Networking
I have not activated the debugging on my machineIn the options "Netfilter Configuration", I suggest you to check all as modules, specifically Full NAT and connection tracking support otherwise the ipp2p and L7 won't be able to track the connection and identify who is P2P and who is not.
make (I have grub as boot manager on my machine)reboot and boot to the new kernel 5. Compile and install ip-tables 1.4.0
cd /usr/src/iptables
6. Install the list of protocol for L7
mv /usr/src/l7-protocols-2008-02-20 /etc/l7-protocols
7. Patch and compile ipp2p (that was the tough part for me)
cd /usr/src/ipp2p-0.8.2
8. Load the modules and have a look
iptables -A FORWARD -m ipp2p --ipp2p -j DROP This should load both modules and will drop connections identified as P2P/bittorrent You can also run iptables to list the rules in FILTER or MANGLE (the one before was a FILTER rule).
iptables -nvL
An lsmod should also report the ipp2p module and the layer7 module loaded. ENJOY ! |