1、时段限制
①建立一个时间段。名为work。时间定义为工作时间8:00~18:00
[MSR2021] time-range work 08:00 to 18:00 working-day
②静止上班时间所有IP访问优酷网(202.102.81.119)
[MSR20_21]acl number 3001 //高级ACL
[MSR20_21-acl-adv-3001]rule 10 deny ip source any destination 202.102.81.119 0.0.0.0 time-range work
2、限速配置
①对整个网段限速
[MSR20_21] qos carl 10 destination-ip-address subnet 192.168.1.1 24
②对整个网段中的每个IP限速
[MSR20_21] qos carl 10 destination-ip-address subnet 192.168.1.1 24 per-address
③对某一段IP限速
[MSR20_21]qos carl 10 destination-ip-address range 192.168.1.2 to 192.168.1.100
④对某一段内的每个IP
[MSR20_21]qos carl 10 destination-ip-address range 192.168.1.2 to 192.168.1.100 per-address
【实例】
每个网段对应路由器(MSR2021)接口以及ADSL端口(每条ADSL均为3M)情况如下:(限制为下行80K,上行30K)
interface Ethernet0/0 ----- dial-bundle-number 1 192.168.2.0
interface Ethernet1/0 ----- dial-bundle-number 2 192.168.1.0/192.168.3.0
interface Ethernet0/2 ----- dial-bundle-number 3 192.168.5.0
配置如下:
<MSR20_21>sys
[MSR20_21]qos carl 10 destination-ip-address range 192.168.1.2 to 192.168.1.100 per-address
qos carl 11 destination-ip-address range 192.168.1.125 to 192.168.1.200 per-address
qos carl 12 destination-ip-address range 192.168.1.206 to 192.168.1.253 per-address
qos carl 20 destination-ip-address range 192.168.2.2 to 192.168.2.253 per-address
qos carl 30 destination-ip-address range 192.168.3.2 to 192.168.3.253 per-address
//对所选网段内的每个IP地址限速
[MSR20_21]interface Ethernet 1/0
qos car inbound carl 10 cir 640 cbs 6400 ebs 0 green pass red discard
qos car inbound carl 11 cir 640 cbs 6400 ebs 0 green pass red discard
qos car inbound carl 12 cir 640 cbs 6400 ebs 0 green pass red discard
qos car inbound carl 30 cir 640 cbs 6400 ebs 0 green pass red discard
//访问外网流量最大80K
[MSR20_21-Ethernet1/0]interface dialer2
qos car inbound carl 10 cir 640 cbs 6400 ebs 0 green pass red discard
qos car inbound carl 11 cir 640 cbs 6400 ebs 0 green pass red discard
qos car inbound carl 12 cir 640 cbs 6400 ebs 0 green pass red discard
qos car inbound carl 30 cir 640 cbs 6400 ebs 0 green pass red discard
quit
//在对应端口应用
[MSR20_21]interface Ethernet 0/0
qos car inbound carl 20 cir 640 cbs 6400 ebs 0 green pass red discard
[MSR20_21-Ethernet0/0]interface dialer1
qos car inbound carl 20 cir 640 cbs 6400 ebs 0 green pass red discard
quit
//上传限制在30K
qos carl 15 source-ip-address range 192.168.1.2 to 192.168.1.100 per-address
interface Ethernet 1/0
qos car outbound carl 15 cir 240 cbs 2400 ebs 0 green pass red discard
quit
定义192.168.0.2 to 192.168.0.200内每台主机上传的流量
[Quidway] qos carl 1 source-ip-address range 192.168.0.2 to 192.168.0.200 per-address
定义192.168.0.2 to 192.168.0.200内每台主机下载的流量
[Quidway] qos carl 2 destination-ip-address range 192.168.0.2 to 192.168.0.200 per-address
[Quidway] interface ethernet 1/0
-------限制上行速率
[Qudiway-Ethernet1/0] qos car inbound carl 1 cir 200000 cbs 200000 ebs 200000 green pass red discard
------限制下行速率
[Qudiway-Ethernet1/0] qos car outbound carl 2 cir 300000 cbs 300000 ebs 300000 gr
een pass red discard