今天接着做实验,因为前面在WAN接口做限速的各种设置都测试过了,所以现在改在LAN接口,结果如下:
| 序号 | 接口 | 类型 | 方向 | 内网IP | IP位置 | 速度 | 备注 |
| 1 | LAN | traffic-shaper | out | 1.2 | destination | 55k | |
| 2 | LAN | traffic-shaper | out | 1.2 | source | 110k |
这就意味着限速成功,2号实验速度为110k,原因是它没有匹配class 10规则,所以就应用了default的规则。
下面是1号实验的相关配置
interfaces {
ethernet eth0 {
address 192.168.1.1/24
duplex auto
hw-id 00:0c:29:98:9e:cf
qos-policy {
out OFFICE
}
speed auto
}
ethernet eth1 {
address 192.168.8.16/24
duplex auto
hw-id 00:0c:29:98:9e:d9
speed auto
}
}
protocols {
static {
}
}
qos-policy {
traffic-shaper OFFICE {
bandwidth 2mbit
class 10 {
bandwidth 512kbit
burst .5k
ceiling 512kbit
match IP2 {
ip {
destination {
address 192.168.1.2/24
}
}
}
queue-type fair-queue
}
default {
bandwidth 1mbit
burst 1k
ceiling 1mbit
queue-type fair-queue
}
}
}