L2 Interface
The following steps describe how to configure Marking/Remarking.
#configure terminal | Enter configure mode. |
(config)#bridge 1 protocol rstp vlan-bridge | Configure bridge 1 as RSTP-VLAN aware. |
(config)#interface xe2 | Enter interface mode. |
(config-if)#switchport | Configure xe2 as a Layer 2 port. |
(config-if)#bridge-group 1 | Associate bridge to an interface. |
(config-if)#switchport mode trunk | Configure port as a trunk. |
(config-if)#switchport trunk allowed vlan all | Allow all the VLANs on the xe2 interface. |
(config-if)#exit | Exit the xe2 interface mode. |
(config)#qos enable | Enable QoS globally. |
(config)#qos statistics | Enable QoS statistics. |
(config)#class-map type qos cmap1 | Enter Class-map mode |
(config-cmap-qos)#match cos 2 | Configure match criteria as CoS with Value 2 |
(config-cmap-qos)#exit | Exit Class-map mode |
(config)#policy-map type qos pmap1 | Enter policy-map mode |
(config-pmap-qos)#class type qos cmap1 | Assign Class cmap1 to Policy-map pmap1 |
(config-pmap-c-qos)#set cos 5 | Remark cos from cos 2 to cos 5 |
(config-pmap-c-qos)#exit | Exit out of policy-class-map mode |
(config-pmap-qos)#exit | Exit out of Policy-map mode |
(config)#interface xe2 | Enter xe2 interface |
(config-if)#service-policy type qos input pmap1 | Assign service-policy to interface on in-direction |
(config-if)#exit | Exit the xe2 interface mode. |
(config)#commit | Committing the configured line |
(config)#interface xe3 | Enter interface mode. |
(config-if)#switchport | Configure xe3 as a Layer 2 port. |
(config-if)#bridge-group 1 | Associate bridge to an interface. |
(config-if)#switchport mode trunk | Configure port as a trunk. |
(config-if)#switchport trunk allowed vlan all | Allow all the VLANs on the xe3 interface. |
(config-if)#exit | Exit the xe3 interface mode. |
(config)#class-map type qos cmap2 | Enter Class-map mode |
(config-cmap-qos)#match protocol arp 2 | Configure match criteria as protocol with arp |
(config-cmap-qos)#exit | Exit Class-map mode |
(config)#policy-map type qos pmap2 | Enter policy-map mode |
(config-pmap-qos)#class type qos cmap2 | Assign Class cmap2 to Policy-map pmap2 |
(config-pmap-c-qos)#set cos 6 | Remark all frame with ethertype as arp to cos 6 |
(config-pmap-c-qos)#exit | Exit out of policy-class-map mode |
(config-pmap-qos)#exit | Exit out of Policy-map mode |
(config)#interface xe3 | Enter xe3 interface |
(config-if)#service-policy type qos input pmap2 | Assign service-policy to interface on in-direction |
(config-if)#exit | Exit out of interface mode |
(config)#bridge 1 protocol rstp vlan-bridge | Specify VLAN for bridge 1. |
(config)#vlan database | Enter the VLAN configuration mode. |
(config-vlan)#vlan 2-3 bridge 1 state enable | Enable VLAN (2-3) on bridge 1. Specifying the enable state. |
(config-vlan)#exit | Exit the VLAN configuration mode. |
(config)#interface vlan1.2 | Enter interface mode. |
(config-if)# ip address 10.1.1.2/24 | Configure the IP address. |
(config-if)#exit | Exit the interface mode. |
(config)#interface vlan1.3 | Enter interface mode. |
(config-if)# ip address 20.1.1.1/24 | Configure the IP address. |
(config-if)#exit | Exit the interface mode. |
(config)#commit | Committing the configured line |
Validation
Enter the commands listed in the sections below to confirm the configurations.
#show running-config qos
qos enable
!
qos statistics
!
class-map type qos cmap1
match cos 2
!
class-map type qos cmap2
match protocol arp
!
policy-map type qos pmap1
class type qos cmap1
set cos 5
exit
!
policy-map type qos pmap2
class type qos cmap2
set cos 6
exit
!
!
!
interface xe2
service-policy type qos input pmap1
!
interface xe3
service-policy type qos input pmap2
!
#show class-map cmap1
Type qos class-maps
===================
class-map type qos cmap1
match cos 2
#show policy-map
Type qos policy-maps
====================
policy-map type qos pmap1
class type qos cmap1
set cos 5
exit
policy-map type qos pmap2
class type qos cmap2
set cos 6
exit
Type queuing policy-maps
========================
policy-map type queuing default default-out-policy
class type queuing default q0
priority
exit
class type queuing default q1
priority
exit
class type queuing default q2
priority
exit
class type queuing default q3
priority
exit
class type queuing default q4
priority
exit
class type queuing default q5
priority
exit
class type queuing default q6
priority
exit
class type queuing default q7
priority
exit
#show policy-map interface xe2
Interface xe2
Global statistics status : enabled
Class-map (qos): cmap1 (match all)
match cos 2
set cos 5
matched : 8 packets, 680 bytes
transmitted : 8 packets, 680 bytes
Service-policy (queuing) output: default-out-policy
-----------------------------------
Class-map (queuing): q0
priority
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): q1
priority
output : 12 packets, 1416 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): q2
priority
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): q3
priority
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): q4
priority
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): q5
priority
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): q6
priority
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): q7
priority
output : 589 packets, 37876 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): mc-q0
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): mc-q1
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): mc-q2
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): mc-q3
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): mc-q4
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): mc-q5
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): mc-q6
output : 7 packets, 448 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): mc-q7
output : 12 packets, 852 bytes
dropped : 0 packets, 0 bytes
Wred Drop Statistics :
----------------------
green : 0 packets
yellow : 0 packets
red : 0 packets
OcNOS#show policy-map interface xe3
Interface xe3
Type QoS statistics status : enabled
Class-map (qos): cmap2 (match all)
match protocol arp
set cos 6
matched : 7 packets, 448 bytes
transmitted : 7 packets, 448 bytes
Service-policy (queuing) output: default-out-policy
-----------------------------------
Class-map (queuing): q0
priority
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): q1
priority
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): q2
priority
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): q3
priority
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): q4
priority
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): q5
priority
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): q6
priority
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): q7
priority
output : 699 packets, 59550 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): mc-q0
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): mc-q1
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): mc-q2
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): mc-q3
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): mc-q4
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): mc-q5
output : 1 packets, 64 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): mc-q6
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): mc-q7
output : 2 packets, 136 bytes
dropped : 0 packets, 0 bytes
Wred Drop Statistics :
----------------------
green : 0 packets
yellow : 0 packets
red : 0 packets