首先在vmware上新建了一个虚拟机,双网卡,eth0连接到vmnet2(另一台xp虚拟机也连接到vmnet2),eth1设置为桥接连到实际网络,测试网络结构大约为:
intelnet <===> gw(.2) <===192.168.8.0/24===> (.16)vyatta(.1) <===192.168.1.0/24===> (.2)XP虚拟机
interfaces { ethernet eth0 { address 192.168.1.1/24 duplex auto hw-id 00:0c:29:98:9e:cf speed auto } ethernet eth1 { address 192.168.8.16/24 duplex auto hw-id 00:0c:29:98:9e:d9 qos-policy { out OFFICE } speed auto } . . . } qos-policy { traffic-limiter OFFICEIN { class 10 { bandwidth 512Kbit burst 15k match IP5 { ip { source { address 192.168.1.2/24 } } } priority 20 } } traffic-shaper OFFICE { bandwidth 2048kbit class 10 { bandwidth 512kbit burst 15k ceiling 512kbit match IP2 { ip { source { address 192.168.1.2/24 } } } queue-type fair-queue } default { bandwidth 1024kbit burst 15k ceiling 1024kbit queue-type fair-queue } } } service { https nat { rule 1 { destination { address 0.0.0.0/0 } outbound-interface eth1 protocol all source { address 192.168.1.0/24 } type masquerade } } } system { gateway-address 192.168.8.2 host-name vyatta . . . name-server 202.96.128.166 name-server 202.96.128.143 . . . }
以上内容是下面第5个测试环境的配置
下面是测试结果(没有设置ceiling)
序号 类型 接口 方向 IP位置 速度
1 traffic-shaper WAN out source 2.6m
2 traffic-shaper WAN out dest 2.6m
3 traffic-limiter WAN in dest 4.6m
4 traffic-limiter WAN in source 4.6m(设置了ceiling)
5 traffic-shaper WAN out source 2.6m
6 traffic-shaper WAN out dest 2.6m
也就是说,限速不成功。