在跳出对话框中 选择 Networking --->
确定后 再选择 Networking options --->
确定后 再选择 [*] Network packet filtering framework (Netfilter) --->
确定后 再选择 Core Netfilter Configuration --->
确定后 再选择 "layer7" match support
退回上层菜单 选择 IP:Netfilter configuration -->
确定后 再选择
退回到第一层菜单 选择 Device drivers --->
确定后 再选择 [*] Network device support --->
确定后 再选择
安装核心
make
make modules
make modules_install
make install
安装iptables
[root@imq src]# cd iptables-1.4.1-rc3
[root@imq iptables-1.4.1-rc3]# ./configure --with-ksource=/usr/src/linux
[root@imq iptables-1.4.1-rc3]# make
[root@imq iptables-1.4.1-rc3]# make install
安装layer7 的协议文件
[root@imq iptables-1.4.1-rc3]# cd /usr/src/l7-protocols-2008-12-18
[root@imq l7-protocols-2008-12-18]# make install
[root@imq l7-protocols-2008-12-18]# mkdir -p /etc/l7-protocols
[root@imq l7-protocols-2008-12-18]# cp -R * /etc/l7-protocols
重启机器
[root@imq l7-protocols-2008-12-18]# reboot
检查配置结果
[root@imq ~]# uname -a; iptables -V
Linux imq.3322.org 2.6.26.6 #1 SMP Mon Feb 23 00:36:18 CST 2009 i686 i686 i386 GNU/Linux
iptables v1.4.1-rc3
检查是否支持HTB
[root@imq linux]# cat /usr/src/linux/.config | grep HTB
CONFIG_NET_SCH_HTB=m
检查是否安装了iproute TC命令在这个套件里
[root@imq linux]# yum list | grep iproute
iproute.i386 2.6.18-7.el5 installed
[root@imq ~]# modprobe imq 加载imq
[root@imq ~]# modprobe imq numdevs=2 设置imq设备的个数
[root@imq ~]# ip link set imq0 up 启动imq0设备
[root@imq ~]# ifconfig 查看网卡其中就有imq0
imq0 Link encap:UNSPEC HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
UP RUNNING NOARP MTU:16000 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:11000
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
可以看到imq0已经启用了
[root@imq ~]#
2009年4月9日星期四
iptables+tc+imq限制网络流量(二)
18:53 发帖者 frankzh
订阅:
博文评论 (Atom)
0 评论:
发表评论