mls qos
Enables QoS globally on a Catalyst switch and enters MLS QoS configuration mode to configure trust settings, queueing, and policing.
mls qosWhen to Use This Command
- Enable QoS on a switch to prioritize VoIP traffic over data traffic.
- Configure trust boundaries to preserve DSCP markings from IP phones.
- Implement egress queue scheduling for different traffic classes.
- Apply ingress policing to limit traffic from untrusted ports.
Command Examples
Enable QoS and set trust to DSCP
mls qos
interface GigabitEthernet0/1
mls qos trust dscpSwitch(config)# mls qos Switch(config)# interface GigabitEthernet0/1 Switch(config-if)# mls qos trust dscp Switch(config-if)# end Switch# show mls qos interface GigabitEthernet0/1 GigabitEthernet0/1 trust state: trust dscp trust mode: trust dscp COS override: dis default COS: 0 DSCP mutation map: default dscp mutation trust device: none qos mode: port-based
Line 1: 'trust state: trust dscp' indicates the port trusts incoming DSCP values. Line 2: 'trust mode: trust dscp' confirms the trust mode. Line 3: 'COS override: dis' means COS override is disabled. Line 4: 'default COS: 0' is the default COS if no trust. Line 5: DSCP mutation map shows the map applied. Line 6: 'trust device: none' means no device trust. Line 7: 'qos mode: port-based' indicates per-port QoS.
Enable QoS with trust COS and set queueing
mls qos
interface GigabitEthernet0/2
mls qos trust cos
mls qos cos 5
mls qos queue-set output 1 buffers 10 30 30 30
mls qos queue-set output 1 threshold 1 80 100Switch(config)# mls qos
Switch(config)# interface GigabitEthernet0/2
Switch(config-if)# mls qos trust cos
Switch(config-if)# mls qos cos 5
Switch(config-if)# mls qos queue-set output 1 buffers 10 30 30 30
Switch(config-if)# mls qos queue-set output 1 threshold 1 80 100
Switch(config-if)# end
Switch# show mls qos interface GigabitEthernet0/2 queueing
GigabitEthernet0/2
Egress expedite queue: dis
WRR bandwidth ratios: 1[queue 1] 2[queue 2] 3[queue 3] 4[queue 4]
queue-limit ratios: 10[queue 1] 30[queue 2] 30[queue 3] 30[queue 4]
queue thresh buffers:
queue 1: 80 100
queue 2: 80 100
queue 3: 80 100
queue 4: 80 100Line 1: 'Egress expedite queue: dis' shows no strict priority queue. Line 2: WRR bandwidth ratios show the weight for each queue. Line 3: queue-limit ratios show the buffer allocation per queue. Lines 4-7: queue thresh buffers show the drop thresholds (first number is the minimum threshold, second is the maximum).
Understanding the Output
The 'show mls qos interface' command displays QoS trust state, mode, COS override, default COS, DSCP mutation map, trust device, and QoS mode. 'trust state' indicates whether the port trusts markings (trust dscp, trust cos, or untrusted). 'trust mode' shows the configured trust type. 'COS override' shows if COS override is enabled. 'default COS' is the COS assigned to untrusted frames. 'DSCP mutation map' shows the map used for DSCP translation. 'trust device' indicates if a specific device (e.g., Cisco IP phone) is trusted. 'qos mode' shows whether QoS is port-based or VLAN-based. For queueing, 'show mls qos interface queueing' shows egress queue settings: expedite queue status, WRR bandwidth ratios, queue-limit ratios, and threshold values. Good values: trust dscp for IP phones, proper queue allocation for voice queues (e.g., queue 1 with high priority). Watch for: 'trust state: untrusted' when trust should be enabled, or 'qos mode: vlan-based' when port-based is expected.
CCNA Exam Tips
CCNA exam may ask which command enables QoS globally: 'mls qos' is required before any per-port QoS commands.
Know that 'mls qos trust cos' is used for ports connecting to IP phones that mark COS, while 'mls qos trust dscp' is for routers or hosts that mark DSCP.
The 'mls qos' command is not needed on routers; it is specific to Catalyst switches.
Remember that 'mls qos' must be configured before applying any QoS policy-map or class-map on a switch.
Common Mistakes
Forgetting to issue 'mls qos' globally before configuring per-port trust, resulting in 'trust' commands being rejected.
Applying 'mls qos trust dscp' on a port that receives only COS markings, causing incorrect classification.
Misconfiguring queue-set buffers and thresholds, leading to tail drop for critical traffic.
Related Commands
Practice for the CCNA 200-301
Test your knowledge with hundreds of CCNA practice questions covering all exam domains.
Practice CCNA Questions