配置对不同VLAN业务分别限速示例
组网需求
网络中的语音业务对应的VLAN ID为120,视频业务对应的VLAN ID为110,数据业务对应的VLAN ID为100。
在Switch上需要对不同业务的报文分别进行流量监管,以将流量限制在一个合理的范围之内,并保证各业务的带宽需求。
具体配置需求如表9-1所示。
配置思路
- 创建VLAN,并配置各接口,使用户能够通过Switch访问网络。
- 在Switch上配置ACL匹配不同的VLAN ID以区分不同的业务。
- 在Switch上配置基于ACL的流量监管,对报文分别限速。
操作步骤
- 创建VLAN并配置各接口
# 在Switch上创建VLAN 100、110、120。
<HUAWEI> system-view [HUAWEI] sysname Switch [Switch] vlan batch 100 110 120
# 将接口GE1/0/1、GE2/0/1的接入类型分别配置为trunk,并分别将接口GE1/0/1和GE2/0/1加入VLAN 100、VLAN 110、VLAN 120。
[Switch] interface gigabitethernet 1/0/1 [Switch-GigabitEthernet1/0/1] port link-type trunk [Switch-GigabitEthernet1/0/1] port trunk allow-pass vlan 100 110 120 [Switch-GigabitEthernet1/0/1] quit [Switch] interface gigabitethernet 2/0/1 [Switch-GigabitEthernet2/0/1] port link-type trunk [Switch-GigabitEthernet2/0/1] port trunk allow-pass vlan 100 110 120 [Switch-GigabitEthernet2/0/1] quit
- 配置ACL
# 在Switch上创建二层ACL,对不同业务流按照其VLAN ID进行分类。
[Switch] acl 4001 [Switch-acl-L2-4001] rule 1 permit vlan-id 120 [Switch-acl-L2-4001] quit [Switch] acl 4002 [Switch-acl-L2-4002] rule 1 permit vlan-id 110 [Switch-acl-L2-4002] quit [Switch] acl 4003 [Switch-acl-L2-4003] rule 1 permit vlan-id 100 [Switch-acl-L2-4003] quit
- 配置流量监管
# 在Switch的接口GE1/0/1入方向上配置流量监管,对报文进行限速。
[Switch] interface gigabitethernet 1/0/1 [Switch-GigabitEthernet1/0/1] traffic-limit inbound acl 4001 cir 2000 pir 10000 [Switch-GigabitEthernet1/0/1] traffic-limit inbound acl 4002 cir 4000 pir 10000 [Switch-GigabitEthernet1/0/1] traffic-limit inbound acl 4003 cir 4000 pir 10000 [Switch-GigabitEthernet1/0/1] quit
- 验证配置结果
# 查看设备接口入方向上应用的ACL规则和流动作信息。
[Switch] display traffic-applied interface gigabitethernet 1/0/1 inbound ----------------------------------------------------------- ACL applied inbound interface GigabitEthernet1/0/1 ACL 4001 rule 1 permit vlan-id 120 ACTIONS: limit cir 2000 ,cbs 250000 pir 10000 ,pbs 1250000 green : pass yellow : pass red : drop ----------------------------------------------------------- ACL 4002 rule 1 permit vlan-id 110 ACTIONS: limit cir 4000 ,cbs 500000 pir 10000 ,pbs 1250000 green : pass yellow : pass red : drop ----------------------------------------------------------- ACL 4003 rule 1 permit vlan-id 100 ACTIONS: limit cir 4000 ,cbs 500000 pir 10000 ,pbs 1250000 green : pass yellow : pass red : drop -----------------------------------------------------------
配置文件
Switch的配置文件
# sysname Switch # vlan batch 100 110 120 # acl number 4001 rule 1 permit vlan-id 120 acl number 4002 rule 1 permit vlan-id 110 acl number 4003 rule 1 permit vlan-id 100 # interface GigabitEthernet1/0/1 port link-type trunk port trunk allow-pass vlan 100 110 120 traffic-limit inbound acl 4001 cir 2000 pir 10000 cbs 250000 pbs 1250000 traffic-limit inbound acl 4002 cir 4000 pir 10000 cbs 500000 pbs 1250000 traffic-limit inbound acl 4003 cir 4000 pir 10000 cbs 500000 pbs 1250000 # interface GigabitEthernet2/0/1 port link-type trunk port trunk allow-pass vlan 100 110 120 # return