(http://www.hadyaiinternet.com/images/kernell7support.jpg)
สำหรับ Ubuntu 8.04 ต้องดัดแปลงนิดหน่อย
ตรง download source code ก็สามารถใช้
cd /usr/src
apt-get source linux-source-2.6.24
chmod -R a-s /usr/src
และตรงเลือก option สำหรับ compile
ก็เลือกเฉพาะ L7 เนื่องจาก Connection Tracking ตัว Ubuntu ได้ Compile ใส่มาให้แล้ว
และให้เอา Xen guest support ออก ตรง
Processor type and features >> Paravirtualized guest support >> Xen guset support
เนื่องจาก Source Code ไม่มี Code ของ XEN
เสร็จแล้วก็ Compile ได้เลย ด้วยคำสั่ง
make-kpkg clean
make-kpkg --rootcmd fakeroot --initrd --append-to-version=-l7support kernel-image kernel-headers
หรือ
make-kpkg clean
fakeroot make-kpkg --initrd --append-to-version=-l7support kernel_image kernel_headers
ถ้า compile ipp2p แล้ว error ให้แก้ไฟล์ Makefile
---------
libipt_ipp2p.so: libipt_ipp2p.c ipt_ipp2p.h
$(CC) $(CFLAGS) $(IPTABLES_OPTION) $(IPTABLES_INCLUDE) -I$(KERNEL_SRC)/include -fPIC -c libipt_ipp2p.c
$(CC) -shared -o libipt_ipp2p.so libipt_ipp2p.o
clean:
-rm -f *.o *.so *.ko .*.cmd *.mod.c
endif
---------
เมื่อติดตั้งเสร็จก็ทำการทดสอบ จะได้
root@Happy2:~# uname -a
Linux Happy2 2.6.24.3-l7support #1 SMP Fri May 30 14:02:09 ICT 2008 i686 GNU/Linux
root@Happy2:~# iptables -nvL
Chain INPUT (policy ACCEPT 276K packets, 17M bytes)
pkts bytes target prot opt in out source destination
Chain FORWARD (policy ACCEPT 0 packets, 0 bytes)
pkts bytes target prot opt in out source destination
0 0 DROP all -- * * 0.0.0.0/0 0.0.0.0/0 ipp2p v0.8.2 --ipp2p
0 0 DROP all -- * * 0.0.0.0/0 0.0.0.0/0 LAYER7 l7proto bittorrent
Chain OUTPUT (policy ACCEPT 252K packets, 267M bytes)
pkts bytes target prot opt in out source destination
root@Happy2:~#