开启 ECN 功能(可选,如果不需要开启 ECN,无需配置)
#配置优先级 3 及优先级 6 的 ECN 策略
#配置优先级 3 及优先级 6 的 ECN 策略
switch#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
switch(config)#class-map type traffic-class ecn-pri-3
switch(config-cmap-tc)#match traffic-class 3
switch(config-cmap-tc)#exit
switch(config)#class-map type traffic-class ecn-pri-6
switch(config-cmap-tc)#match traffic-class 6
switch(config-cmap-tc)#exit
switch(config)#policy-map type traffic-class ecn-pmap
switch(config-pmap-tc)#class type traffic-class ecn-pri-3
switch(config-pmap-tc-c)#random-detect maximum-threshold 8192 minimum-threshold 64
switch(config-pmap-tc-c)#exit
switch(config-pmap-tc)#class type traffic-class ecn-pri-6
switch(config-pmap-tc-c)#random-detect maximum-threshold 8192 minimum-threshold 64
switch(config-pmap-tc-c)#end
### 配置脚本
configure terminal
class-map type traffic-class ecn-pri-3
match traffic-class 3
class-map type traffic-class ecn-pri-6
match traffic-class 6
policy-map type traffic-class ecn-pmap
class type traffic-class ecn-pri-3
random-detect maximum-threshold 8192 minimum-threshold 64
class type traffic-class ecn-pri-6
random-detect maximum-threshold 8192 minimum-threshold 64
####
#将 ECN 策略应用至对应的物理接口
switch#configure terminal
switch(config)#interface eth-0-1
switch(config-if)#service-policy type traffic-class ecn-pmap
switch(config-if)#exit
switch(config)#interface eth-0-2
switch(config-if)#service-policy type traffic-class ecn-pmap
switch(config-if)#end
### 配置脚本
configure terminal
interface eth-0-30
service-policy type traffic-class ecn-pmap
interface eth-0-31
service-policy type traffic-class ecn-pmap
end
####
创建业务 Vlan
#创建业务 Vlan10,并将对应物理接口加入到业务 Vlan
#创建业务 Vlan10,并将对应物理接口加入到业务 Vlan
switch#configure terminal
switch(config)#vlan database
switch(config-vlan)#vlan 10
switch(config-vlan)#exit
switch(config)#interface eth-0-1
switch(config-if)#switchport access vlan 10
switch(config)#interface eth-0-2
switch(config-if)#switchport access vlan 10
配置 PFC
#将 DSCP=26(af31)映射到优先级 3,将 DSCP=48(CS6)映射到优先级 6
#将 DSCP=26(af31)映射到优先级 3,将 DSCP=48(CS6)映射到优先级 6
switch#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
switch(config)#class-map type qos pfc-pri-3
switch(config-cmap-qos)#match dscp af31
switch(config-cmap-qos)#exit
switch(config)#class-map type qos pfc-pri-6
switch(config-cmap-qos)#match dscp cs6
switch(config-cmap-qos)#exit
switch(config)#policy-map type qos pfc-pmap
switch(config-pmap-qos)#class type qos pfc-pri-3
switch(config-pmap-qos-c)#set traffic-class 3
switch(config-pmap-qos-c)#exit
switch(config-pmap-qos)#class type qos pfc-pri-6
switch(config-pmap-qos-c)#set traffic-class 6
switch(config-pmap-qos-c)#end
### 配置脚本
configure terminal
class-map type qos pfc-pri-3
match dscp af31
class-map type qos pfc-pri-6
match dscp cs6
policy-map type qos pfc-pmap
class type qos pfc-pri-3
set traffic-class 3
class type qos pfc-pri-6
set traffic-class 6
end
#####
#将映射策略应用到对应的物理接口,并开启对应物理接口优先级 3 和优先级 6 的 PFC 功能
switch#configure terminal
switch(config)# interface eth-0-1
switch(config-if)#priority-flow-control mode on
switch(config-if)#priority-flow-control enable priority 3 6
switch(config-if)#service-policy type qos input pfc-pmap
switch(config)# interface eth-0-2
switch(config-if)#priority-flow-control mode on
switch(config-if)#priority-flow-control enable priority 3 6
switch(config-if)#service-policy type qos input pfc-pmap
### 配置脚本
configure terminal
interface eth-0-30
priority-flow-control mode on
priority-flow-control enable priority 3 6
service-policy type qos input pfc-pmap
interface eth-0-31
priority-flow-control mode on
priority-flow-control enable priority 3 6
service-policy type qos input pfc-pmap
#####