โดย : อดิศร ขาวสังข์
เขียนเมื่อ : 2/12/2006
โปรแกรมที่ใช้ื : p2pblock (เป็น Addons สำหรับ IPCop)
ทดลองใช้งานบน : IPCop
บทนำ
ในที่นีู้้ใช้โปรแกรม p2pblock ซึ่งเป็นโปรแกรมประเภท Addon ที่ต้องติดตั้งบน IPCop แต่ในการใช้่งาน p2pblock จะต้องใช้โปรแกรม Addon อีกตัวที่ชื่อว่า layer7-filter ร่วมด้วย ซึ่งถ้าไม่ติดตั้ง layer7-filter ไว้ก่อน ก็จะไม่สามารถติดตั้งโปรแกรม p2pblock ได้
แนะนำ p2pblock
This Addon uses iptables,string-match, layer7-Filter and ipp2p-filter to block p2p-Traffic.
There is a site in the Webinterface in which you could choose, which protocolls to block.
Even after a reboot the selected protocolls will be blocked.
It is not possible to stop existing connections, but new connections are impossible after starting p2pblock.
แนะนำ L7-filter
L7-filter is a classifier for Linux's Netfilter that identifies packets based on application layer data. It can classify packets as Kazaa, HTTP, Jabber, Citrix, Bittorrent, FTP, Gnucleus, eDonkey2000, etc., regardless of port. It complements existing classifiers that match on IP address, port numbers and so on.
ขั้นตอนการตั้งตั้งโปรแกรม
- ดาวน์โหลดโปรแกรม p2pblock และ layer7-filter จากหัวข้อ Download ของ http://www.mhaddons.tk/
- อัพโหลดโปรแกรมทั้งสองไปยัง IPCop Server ซึ่งอาจใช้โปรแกรม WinSCP ในการถ่ายโอน
- การติดตั้ง layer-7 filter มีขี้นตอนดังนี้
- แตกไฟล์โปรแกรม layer-7 filter ด้วยคำสั่ง :
tar xfz layer7_ipcop_1.4.11.tar.gz
- เข้าไปยังไำดเร็คทอรี่ที่ถูกสร้างขึ้นมาใหม่ชื่อว่า layer7 และติดตั้งโปรแกรม ด้วยคำสั่ง:
./install
ดังรูป

- การ uninstall Layer7-filter ใช้คำสั่ง:
l7uninstall
- การอัพเดต layer7-Patterns แบบ manual ทำได้ด้วยคำสั่ง :
/var/ipcop/l7filter/l7update
- การติดตั้งโปรแกรม p2pblock มีขั้นตอนดังนี้
- แตกไฟล์ด้วยคำสั่ง
tar xvfz p2pblock_ipcop_1.4.11.tar.gz
- เข้าไปยังไดเร็คทอรี่ p2pblock และติดตั้งโปรแกรมด้วยคำสั่ง :
./install
ดังรูป

- ในระหว่างการติดตั้งจะมีคำถามว่าต้องการจะ enable การ automatic versioncheck หรือไม่ ก็ควรจะตอบ Y
- หลังจากติดตั้งเสร็จแล้ววควรจะทำการ update pattern ของ layer7-filter ด้วยคำสั่ง
/var/ipcop/l7filter/l7update
ซึ่งการอัพเดตจะูถูกทำโดย cronjob ทุกคืนอยู่แล้ว
- การ uninstall โปรแกรม p2pblock ทำได้ด้วยคำสั่ง :
/var/ipcop/p2pblock/setup/setup -u
- เมื่อติดตั้งโปรแกรมเสร็จแล้วจะมีโปรแกรม p2pblock ปรากฎที่หน้า web ของ IPCop ดังรูป
- ให้ทดลองบล็อกการใช้งาน Bittorent หรือ Application อื่น ๆ ดู ซึ่งในที่นี้ผู้เขียนได้ลองบล็อก Bittorent ปรากฎว่า ได้ผลจริง ๆ ครับ
จบครับ