Chinaunix首页 | 论坛 | 博客
  • 博客访问: 3286527
  • 博文数量: 266
  • 博客积分: 3081
  • 博客等级: 中校
  • 技术积分: 2640
  • 用 户 组: 普通用户
  • 注册时间: 2005-07-04 10:35
个人简介

没什么好介绍的!穷屌丝一个~

文章分类

全部博文(266)

文章存档

2021年(3)

2020年(1)

2019年(2)

2016年(5)

2015年(1)

2014年(1)

2011年(9)

2010年(16)

2009年(31)

2008年(58)

2007年(111)

2006年(2)

2005年(26)

我的朋友

分类: LINUX

2007-06-03 00:31:52

L7-filter (Application Layer Packet Classifier for Linux), 是 Linux netfilter 的外掛模組, 它能讓 Linux 的 iptables 支援 Layer 7 (Application 應用層) 封包過濾功能, 限制 P2P、即時通訊等使用動態埠口的網路軟體.
下载:
 
1.安装:
cd /usr/src/linux
patch -p1 < /usr/local/src/netfilter-layer7-v2.0/kernel-2.6.13-2.6.14-layer7-2.0.patch
(選用與核心版本對應的 patch 檔)

重點 (以 kernel 2.6.13 為例, 不同的核心版本排列方式不一定相同):

Code maturity level options --> [*] Prompt for development and/or incomplete code/drivers

Networking --> Networking options -->
    [*] Network packet filtering (replaces ipchains) -->
        IP: Netfilter Configuration -->
            Connection tracking (required for masq/NAT)
            [*] Connection tracking flow accounting
            IP tables support (required for filtering/masq/NAT)
            Layer 7 match support

make bzImage (kernel 2.4 需先執行 make dep)
make modules
make modules_install
make install

安裝 Layer 7 Patches 更新過的 iptables

至 下載 iptables source

解包至 /usr/local/src, 本篇以 iptables-1.3.7 為例

cd /usr/local/src/iptables-1.3.7
patch -p1 < ../netfilter-layer7-v2.0/iptables-layer7-2.0.patch
chmod +x ./extensions/.layer7-test
make KERNEL_DIR=/usr/src/linux
make install KERNEL_DIR=/usr/src/linux

若原本已安裝 iptables 套件的處理
cd /sbin
mv iptables iptables.old
ln -s /usr/local/sbin/iptables iptables

chkconfig iptables on
vi /boot/grub/menu.lst
(改成預設以新的 kernel 開機)
reboot

使用 iptables layer-7 filter

iptables -t mangle -A PREROUTING -m layer7 --l7proto yahoo -j DROP (禁止 Yahoo! Messenger 封包)


2.使用-j MARK 参数与TC搭配:http://cha.homeip.net/blog/archives/2005/07/cbqinit.html

相关网址:
1.下载与说明:

2.支持协议:
3.其它"



支持协议

流程图:

阅读(1854) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~