mls qos cos
To define the default Multilayer Switching (MLS) class of service (CoS) value of a port or to assign the default CoS value to all incoming packets on the port, use the mls qos cos command in interface configuration mode. To return to the default CoS setting, use the no form of this command.
mls qos cos {default-cos | override}
no mls qos cos {default-cos | override}
Syntax Description
Defaults
The default CoS value for a port is 0.
CoS override is disabled.
CoS override is disabled.
Command Modes
Interface configuration
Command History
Usage Guidelines
You can assign the default CoS and DSCP value to all packets entering a port if the port has been configured by use of the override keyword.
Use the override keyword when all incoming packets on certain ports deserve a higher or lower priority than packets entering from other ports. Even if a port was previously set to trust DSCP or CoS, this command overrides that trust state, and all the CoS values on the incoming packets are changed to the default CoS value that is configured with the mls qos cos command. If an incoming packet is tagged, the CoS value of the packet is modified at the ingress port. It is changed to the default CoS of that port.
Use the show mls qos interface privileged EXEC command to verify your settings.
Examples
The following example shows how to assign 4 as the default port CoS:
Router(config)# interface gigabitethernet0/1
Router(config-if)# mls qos trust cos
Router(config-if)# mls qos cos 4
The following example shows how to assign 4 as the default port CoS value for all packets entering the port:
Router(config)# interface gigabitethernet0/1
Router(config-if)# mls qos cos 4
Router(config-if)# mls qos cos override
Related Commands
mls qos map
To define the Multilayer Switching (MLS) class of service (CoS)-to-Differentiated Services Code Point (DSCP) map or DSCP-to-CoS map, use the mls qos map command in global configuration mode. To return to the default map, use the no form of this command.
mls qos map {cos-dscp dscp1...dscp8 | dscp-cos dscp-list to cos}
no mls qos map {cos-dscp | dscp-cos}
Syntax Description
Defaults
Table 1 shows the default CoS-to-DSCP map.
Table 2 shows the default DSCP-to-CoS map.
DSCP Values |
0 |
8, 10 |
16, 18 |
24, 26 |
32, 34 |
40, 46 |
48 |
56 |
CoS Value |
0 |
1 |
2 |
3 |
4 |
5 |
6 |
7 |
Command Modes
Global configuration
Command History
Usage Guidelines
All of the CoS-to-DSCP and DSCP-to-CoS maps are globally defined. You apply all maps to all ports.
If you enter the mls qos trust cos command, the default CoS-to-DSCP map is applied.
If you enter the mls qos trust dscp command, the default DSCP-to-CoS map is applied.
After a default map is applied, you can define the CoS-to-DSCP or DSCP-to-CoS map by entering consecutive mls qos map commands.
If the mls qos trust dscp command is entered and a packet with an untrusted DSCP value is at an ingress port, the packet CoS value is set to 0.
Use the show mls qos maps privileged EXEC command to verify your settings.
Examples
The following example shows how to define the DSCP-to-CoS map. DSCP values 16, 18, 24, and 26 are mapped to CoS 1. DSCP values 0, 8, and 10 are mapped to CoS 0.
Router# configure terminal
Router(config)# mls qos map dscp-cos 16 18 24 26 to 1
Router(config)# mls qos map dscp-cos 0 8 10 to 0
The following example shows how to define the CoS-to-DSCP map. CoS values 0 to 7 are mapped to DSCP values 8, 8, 8, 8, 24, 32, 56, and 56.
Router# configure terminal
Router(config)# mls qos map cos-dscp 8 8 8 8 24 32 56 56
Related Commands
本文出自 51CTO.COM技術博客