一、基于端口的流量整形
1、创建CAR模板
qos car car-name cir cir-value [ cbs cbs-value [ pbs pbs-value ] | pir pir-value [ cbs cbs-value pbs pbs-value ] ]
2、端口下引入CAR模板
qos car inbound car-name,在接口应用CAR模板。
二、基于流的流量整形
1、创建流分类
对不同的VLAN进行匹配限制
[Switch] traffic classifier c1 operator and [Switch-classifier-c1] if-match vlan-id 120
2、创建流行为
[Switch] traffic behavior b1 [Switch-behavior-b1] car cir 2000 pir 10000 green pass \\\限制带宽 [Switch-behavior-b1] statistic enable \\\使能分析功能
3、配置流量监管策略并应用到接口上
[Switch] traffic policy p1 [Switch-trafficpolicy-p1] classifier c1 behavior b1
[Switch] interface gigabitethernet 1/0/1 [Switch-GigabitEthernet1/0/1] traffic-policy p1 inbound \\端口下inbound方向引入
三、对端口策略查看
[Switch] display traffic policy statistics interface gigabitethernet 1/0/1 inbound