Na forum
mastershapera kiedyś opisałem jak skompilować parę pakietów, żeby działał na nim mastershaper (ktoś chętny do przetłumaczenia na polski):
Just what I did to accomplish configuration (debian squeeze amd64 version):
1. preparations
Kod: Zaznacz cały
apt-get install kernel-package libncurses5-dev fakeroot wget bzip2 build-essential patch time checkinstall
2.download kernel latest stable source code
Kod: Zaznacz cały
cd /usr/src
apt-get source linux-image-2.6.32-5-amd64
ln -s /usr/src/linux-2.6-2.6.32 /usr/src/linux
3. layer7 for kernel
Kod: Zaznacz cały
cd /usr/src/linux
wget --no-check-certificate https://dev.openwrt.org/export/18900/trunk/target/linux/generic-2.6/patches-2.6.32/100-netfilter_layer7_2.21.patch
patch -p1 < 100-netfilter_layer7_2.21.patch
patching file include/linux/netfilter/xt_layer7.h
patching file include/net/netfilter/nf_conntrack.h
patching file net/netfilter/Kconfig
patching file net/netfilter/Makefile
patching file net/netfilter/nf_conntrack_core.c
patching file net/netfilter/nf_conntrack_standalone.c
patching file net/netfilter/regexp/regexp.c
patching file net/netfilter/regexp/regexp.h
patching file net/netfilter/regexp/regmagic.h
patching file net/netfilter/regexp/regsub.c
patching file net/netfilter/xt_layer7.c
4.imq for kernel
Kod: Zaznacz cały
cd /usr/src/linux
wget http://www.linuximq.net/patchs/linux-2.6.32-imq-test2.diff
patch -p1 < linux-2.6.32-imq-test2.diff
patching file drivers/net/imq.c
patching file drivers/net/Kconfig
patching file drivers/net/Makefile
patching file include/linux/imq.h
patching file include/linux/netdevice.h
patching file include/linux/netfilter/xt_IMQ.h
patching file include/linux/netfilter_ipv4/ipt_IMQ.h
patching file include/linux/netfilter_ipv6/ip6t_IMQ.h
patching file include/linux/skbuff.h
patching file include/net/netfilter/nf_queue.h
patching file net/core/dev.c
patching file net/core/skbuff.c
patching file net/netfilter/Kconfig
patching file net/netfilter/Makefile
patching file net/netfilter/nf_queue.c
patching file net/netfilter/xt_IMQ.c
5.kernel configuration before compilation
Kod: Zaznacz cały
cd /usr/src/linux
cp /boot/config-2.6.32-5-amd64 .config
perl -pi -e 's/CONFIG_VT6656=m/CONFIG_VT6656=n/g' .config #problem with compilation with that driver
make menuconfig
5a. imq
Kod: Zaznacz cały
Device Drivers --->
-*- Network device support --->
<M> IMQ (intermediate queueing device) support
IMQ behavior (PRE/POSTROUTING) (IMQ AB) --->
(X) IMQ AB
(16) Number of IMQ devices
5b. layer7
Kod: Zaznacz cały
-*- Networking support --->
Networking options --->
[*] Network packet filtering framework (Netfilter) --->
Core Netfilter Configuration --->
<M> Netfilter connection tracking support
<M> "layer7" match support
5c. Check 9b and copy xt_layer7.h file before you start compiling kernel
Kod: Zaznacz cały
cp /usr/src/linux/include/linux/netfilter/xt_layer7.h /usr/src/iptables/extensions/
5d. compilation
Kod: Zaznacz cały
fakeroot time make-kpkg --initrd --append_to_version=-layer7-imq-amd64 linux-image
6. download latest stable iptables source code
Kod: Zaznacz cały
cd /usr/src
apt-get source iptables
ln -s iptables-1.4.10 iptables
7. imq patch for iptables (i didn't find patch for 1.4.8 so i used 1.4.10)
Kod: Zaznacz cały
cd /usr/src/iptables
wget http://www.linuximq.net/patchs/iptables-1.4.10-imq.patch
patch -p1 < iptables-1.4.10-imq.patch
patching file extensions/libxt_IMQ.c
patching file extensions/libxt_IMQ.man
patching file include/linux/netfilter/xt_IMQ.h
8. download netfilter-layer7 package
Kod: Zaznacz cały
cd /tmp
wget http://downloads.sourceforge.net/project/l7-filter/l7-filter kernel version/2.22/netfilter-layer7-v2.22.tar.gz
tar -zxvf netfilter-layer7-v2.22.tar.gz
9. copy necessery files (layer7 support)
9a. from netfilter-layer7 package
Kod: Zaznacz cały
cp /tmp/netfilter-layer7-v2.22/iptables-1.4.3forward-for-kernel-2.6.20forward/libxt_layer7.* /usr/src/iptables/extensions/
9b. from patched kernel
Kod: Zaznacz cały
cp /usr/src/linux/include/linux/netfilter/xt_layer7.h /usr/src/iptables/extensions/
10. configure and compile iptables
Kod: Zaznacz cały
./configure --with-ksource=/usr/src/linux --prefix=/usr --with-xtlibdir=/lib/xtables --libdir=/lib --enable-libipq --enable-devel
make
checkinstall
11. download l7-protocols package
Kod: Zaznacz cały
cd /tmp
wget http://ufpr.dl.sourceforge.net/sourceforge/l7-filter/l7-protocols-2009-05-28.tar.gz
tar -zxvf l7-protocols-2009-05-28.tar.gz
mv l7-protocols-2009-05-28 /etc/l7-protocols
12. install xtables-addons from squeeze
After all install new kernel, reboot and you should have working modules and commands:
Kod: Zaznacz cały
iptables -m layer7 --help
iptables -m ipp2p --help
I hope it helps.