Marking/Remarking Configuration
This chapter contains a complete sample of configuring Marking/Remarking.
Topology
Simple configuration of Marking/Remarking
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)#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. |
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
L3 Interface
#configure terminal | Enter configure mode. |
(config)#interface xe3 | Enter interface mode. |
(config-if)#ip address 10.1.1.1/24 | Assign IP Address on interface to 10.1.1.2 with mask 255.255.255.0 |
(config-if)#exit | Exit out of interface mode |
(config)#qos enable | Enable QoS globally. |
(config)#qos statistics | Enable QoS statistics. |
(config)#class-map type qos cmap3 | Configure class-map of type qos with name cmap3 and enter into Class-map mode |
(config-cmap-qos)#match dscp 10 | Configure match criteria as dscp with a value of 10. |
(config-cmap-qos)#exit | Exit Class-map mode |
(config)#policy-map type qos pmap3 | Enter policy-map mode |
(config-pmap-qos)#class type qos cmap3 | Assign Class cmap3 to Policy-map pmap3 |
(config-pmap-c-qos)#set dscp ef | Remark frames with dscp value 10 to dscp 46 |
(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 pmap3 | Assign service-policy pmap3 to interface xe3 on in-direction |
(config-if)#exit | Exit out of interface mode |
(config)#ip access-list 101 | Configure access-list 101 with action as permit for tcp traffic with destination port as ftp port |
(config-ip-acl)#permit tcp any any eq ftp | Permit for tcp traffic with destination port as ftp port. |
(config-ip-acl)#exit | Exit access list mode |
(config)#class-map type qos match-any cmap4 | Enter Class-map mode |
(config-cmap-qos)#match access-group 101 | Configure access-group 101 as match criteria |
(config-cmap-qos)#exit | Exit class-map mode |
(config)#policy-map type qos pmap4 | Enter policy map mode |
(config-pmap-qos)#class cmap4 | Assign Class cmap4 to Policy-map pmap4 |
(config-pmap-c-qos)#set precedence 7 | Remark frames matching access-group 101 to precedence 7 |
(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 interface mode. |
(config-if)#ip address 20.1.1.1/24 | Assign IP Address on interface to 20.1.1.1 with mask 255.255.255.0 |
(config-if)#service-policy type qos input pmap4 | Assign service-policy to interface on in-direction |
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 cmap3
match dscp af11
!
class-map type qos match-any cmap4
match access-group 101
!
policy-map type qos pmap3
class type qos cmap3
set dscp ef
exit
policy-map type qos pmap4
class type qos cmap4
set precedence network
exit
!
interface xe2
service-policy type qos input pmap4
!
interface xe3
service-policy type qos input pmap3
#show class-map type qos
Type qos class-maps
===================
class-map type qos match-any class-default
class-map type qos cmap3
match dscp af11
class-map type qos match-any cmap4
match access-group 101
#show policy-map
Type qos policy-maps
====================
policy-map type qos pmap3
class type qos cmap3
set dscp ef
policy-map type qos pmap4
class type qos cmap4
set precedence network
Type queuing policy-maps
========================
policy-map type queuing default default-out-policy
class type queuing default q0
priority
class type queuing default q1
priority
class type queuing default q2
priority
class type queuing default q3
priority
class type queuing default q4
priority
class type queuing default q5
priority
class type queuing default q6
priority
class type queuing default q7
priority
#show policy-map interface xe2
Interface xe2
Type Qos statistics status : enabled
--------------------------------
Class-map (qos): cmap4 (match any)
match access-group 101
set precedence 7
matched : 375594046 packets, 25540397168 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 : 391282612 packets, 25042086656 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 : 4 packets, 256 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 : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): mc-q7
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Wred Drop Statistics :
----------------------
green : 0 packets
yellow : 0 packets
red : 0 packets
#show policy-map interface xe3
Interface xe3
Global statistics status : enabled
--------------------------------
Class-map (qos): cmap3 (match all)
match dscp af11
set dscp 46
matched : 401497149 packets, 25695819008 bytes
Service-policy (queuing) output: default-out-policy
--------------------------------
Class-map (queuing): q0
priority level 1
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 : 382211720 packets, 25990396484 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 : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Class-map (queuing): mc-q7
output : 0 packets, 0 bytes
dropped : 0 packets, 0 bytes
Wred Drop Statistics :
----------------------
green : 0 packets
yellow : 0 packets
red : 0 packets