ถ้าหากการ patch ไม่สำเร็จจะไม่มีฟังก์ชั่น Layer 7 match support ให้เลือก ให้ทำการ patch ใหม่อีกครั้ง
เมื่อทำการเลือกเสร็จแล้วให้ทำการบันทึก และ Exit ออกมาครับ จากนั้นใช้คำสั่งดังต่อไปนี้
#make dep
#make clean
#make bzImage
#make modules
#make modules_install
หรือจะใช้คำสั่ง
#make dep ; make clean ; make bzImage ; make modules; make modules_install
Commands:
Either long or short options are allowed.
--append -A chain Append to chain
--delete -D chain Delete matching rule from chain
--delete -D chain rulenum
Delete rule rulenum (1 = first) from chain
--insert -I chain [rulenum]
Insert in chain as rulenum (default 1=first)
LAYER7 match v1.3.6 options:
--l7dir <directory> : Look for patterns here instead of /etc/l7-protocols/
(--l7dir must be specified before --l7proto if used!)
--l7proto [!] <name> : Match the protocol defined in /etc/l7-protocols/name.pat
การใช้งาน L7-filter นำคำสั่งดังต่อไปนี้ไปใส่ไว้ในไฟล์ /etc/rc.d/rc.local เพื่อทำให้มันสตาร์ตทุกครั้งที่ Reboot เครื่อง
iptables -I FORWARD -s 192.168.2.3 -m time --timestart 8:00 --timestop 18:00 --days Mon,Tue,Wed,Thu,Fri -j ACCEPT
#. counterstrike
iptables -t mangle -A POSTROUTING -m layer7 --l7proto counterstrike -j DROP
#bittorrent
iptables -t mangle -A POSTROUTING -m layer7 --l7proto bittorrent -s 192.168.0.0/16 -j DROP
#msnmessenger
iptables -t mangle -A POSTROUTING -m layer7 --l7proto msnmessenger -s 192.168.0.0/16 -j DROP
#. QQ
iptables -t mangle -A POSTROUTING -m layer7 --l7proto qq -s 192.168.0.0/16 -j DROP
#. EXE
iptables -t mangle -A POSTROUTING -m layer7 --l7proto exe -s 192.168.0.0/16 -j DROP
#Fasttrack
iptables -t mangle -A POSTROUTING -m layer7 --l7proto fasttrack -s 192.168.0.0/16 -j DROP
#Examples.
iptables -A FORWARD -m iprange --src-range 192.168.1.5-192.168.1.124 -j ACCEPT
iptables -A FORWARD -m iprange --dst-range 10.0.0.0-10.5.255.255.255 -j ACCEPT
#. Bittorrent
iptables -t mangle -A POSTROUTING -m layer7 --l7proto bittorrent -s 192.168.0.0/16 -j DROP
#. Blocco di Download Audio/Video
iptables -t mangle -A POSTROUTING -m layer7 --l7proto fasttrack -j DROP
iptables -t mangle -A POSTROUTING -m layer7 --l7proto edonkey -j DROP
iptables -t mangle -A POSTROUTING -m layer7 --l7proto gnutella -j DROP
iptables -t mangle -A POSTROUTING -m layer7 --l7proto napster -j DROP
#. Blocco di Accesso Audio/Video
iptables -t mangle -A POSTROUTING -m layer7 --l7proto audiogalaxy -j DROP
iptables -t mangle -A POSTROUTING -m layer7 --l7proto httpaudio -j DROP
iptables -t mangle -A POSTROUTING -m layer7 --l7proto http-itunes -j DROP
iptables -t mangle -A POSTROUTING -m layer7 --l7proto httpvideo -j DROP
iptables -t mangle -A POSTROUTING -m layer7 --l7proto quicktime -j DROP
iptables -t mangle -A POSTROUTING -m layer7 --l7proto shoutcast -j DROP
#. Blocco di Download di file con estensioni particolari
iptables -t mangle -A POSTROUTING -m layer7 --l7proto exe -j DROP
iptables -t mangle -A POSTROUTING -m layer7 --l7proto ogg -j DROP
iptables -t mangle -A POSTROUTING -m layer7 --l7proto flash -j DROP
iptables -t mangle -A POSTROUTING -m layer7 --l7proto zip -j DROP
iptables -t mangle -A POSTROUTING -m layer7 --l7proto rar -j DROP
#. Blocco di sistemi di Chat/Scambio Files
iptables -t mangle -A POSTROUTING -m layer7 --l7proto msnmessenger -j DROP
iptables -t mangle -A POSTROUTING -m layer7 --l7proto aim -j DROP
iptables -t mangle -A POSTROUTING -m layer7 --l7proto msn-filetransfer -j DROP
iptables -t mangle -A POSTROUTING -m layer7 --l7proto irc -j DROP
iptables -t mangle -A POSTROUTING -m layer7 --l7proto jabber -j DROP
iptables -t mangle -A POSTROUTING -m layer7 --l7proto skypeout -j DROP
iptables -t mangle -A POSTROUTING -m layer7 --l7proto skypetoskype -j DROP
iptables -t mangle -A POSTROUTING -m layer7 --l7proto qq -j DROP
#. Blocco di sistemi di Giochi Online
iptables -t mangle -A POSTROUTING -m layer7 --l7proto battlefield2 -j DROP
iptables -t mangle -A POSTROUTING -m layer7 --l7proto doom3 -j DROP
iptables -t mangle -A POSTROUTING -m layer7 --l7proto halflife2-deathmatch -j DROP
iptables -t mangle -A POSTROUTING -m layer7 --l7proto quake-halflife -j DROP
iptables -t mangle -A POSTROUTING -m layer7 --l7proto quake1 -j DROP
iptables -t mangle -A POSTROUTING -m layer7 --l7proto worldofwarcraft -j DROP
iptables -t mangle -A POSTROUTING -m layer7 --l7proto xboxlive -j DROP
Comment