Courseiva
QoSInterface Config

mls qos cos [value]

Sets the default CoS (Class of Service) value for incoming packets on an interface when the packet does not already carry a CoS marking, used to prioritize traffic at Layer 2.

Definition: mls qos cos [value] is a Cisco IOS interface config command. Sets the default CoS (Class of Service) value for incoming packets on an interface when the packet does not already carry a CoS marking, used to prioritize traffic at Layer 2.

Overview

The `mls qos cos [value]` interface configuration command sets the default Class of Service (CoS) value for incoming packets on a switch interface when those packets do not already carry a CoS marking. CoS is a 3-bit field in the 802.1Q VLAN tag header used for Layer 2 traffic prioritization, allowing switches to differentiate and treat traffic with different priority levels. This command is critical in QoS designs where trust boundaries are defined: on access ports connecting to end devices (like IP phones or PCs) that may not mark packets, the switch can assign a default CoS value to ensure proper classification and queuing.

Without this command, unmarked packets might receive a default CoS of 0 (best effort), potentially causing delay-sensitive traffic like voice to be treated poorly. The command is typically used in conjunction with `mls qos trust` to define whether the switch trusts existing markings or overrides them. For example, on a port connecting to an IP phone, you might set `mls qos trust cos` to trust the phone's markings, but on a port connecting to a PC, you might set `mls qos cos 5` to mark all PC traffic as high priority.

This command fits into the broader QoS configuration workflow: first, classify traffic (using CoS, DSCP, or ACLs); second, mark or trust markings; third, apply policy maps for policing, shaping, or queuing. The command is available in IOS (including IOS-XE) on Catalyst switches that support MLS QoS. It requires global QoS to be enabled (`mls qos` global command).

The change takes effect immediately and is stored in the running configuration; a `write memory` is needed to make it persistent. Privilege level 15 (enable) is required. Note that on some platforms, the command may be `qos cos` or `priority-queue cos-map` depending on the hardware.

Understanding this command is essential for CCNA and CCNP candidates as it appears in QoS exam topics and real-world network designs.

Syntax·Interface Config
mls qos cos [value]

When to Use This Command

  • Assigning a default CoS value to untagged traffic on an access port connected to a legacy device that does not mark packets.
  • Setting a higher default CoS for voice VLAN traffic to ensure voice quality on a switch port.
  • Configuring a default CoS for traffic from a specific department to match a QoS policy.
  • Overriding the default CoS of 0 on a trunk port to prioritize certain VLAN traffic.

Parameters

ParameterSyntaxDescription
value<0-7>The CoS value to assign to incoming packets that do not already carry a CoS marking. Valid values are 0 through 7, where 0 is best effort, 5 is typically used for voice, and 7 is network control. Common mistake: setting a value outside 0-7 or forgetting that this only applies to unmarked packets; if the packet already has a CoS, this command has no effect unless combined with `mls qos trust cos` override.

Command Examples

Set default CoS to 5 on an interface

mls qos cos 5
Switch(config-if)# mls qos cos 5
Switch(config-if)#

The command sets the default CoS value to 5 for all incoming packets that do not already have a CoS marking. No output is shown if successful; the prompt returns without error.

Verify default CoS configuration

show mls qos interface gigabitethernet0/1
GigabitEthernet0/1
  trust state: not trusted
  trust mode: untrusted
  trust enabled: no
  COS override: no
  default COS: 5
  pass-through: none
  untagged frames: not trusted
  DSCP mutation map: default
  trust device: none
  qos mode: port-based

The output shows the QoS settings for the interface. 'default COS: 5' confirms the configured value. 'trust state: not trusted' indicates the interface does not trust incoming CoS markings, so the default CoS is applied.

Understanding the Output

The 'show mls qos interface' command displays the QoS configuration for a specific interface. Key fields include: 'trust state' indicates whether the interface trusts incoming CoS/DSCP markings; 'trust mode' shows the trust mode (untrusted, trusted, etc.); 'default COS' shows the CoS value assigned to untagged or unmarked frames; 'COS override' indicates if the interface overrides incoming CoS with the default; 'qos mode' shows whether QoS is port-based or VLAN-based. A default COS of 0 is typical for best-effort traffic, while values 5-7 are used for high-priority traffic like voice.

If the default COS is set incorrectly, low-priority traffic might be treated as high priority, causing congestion for critical applications.

Configuration Scenarios

Set default CoS for PC traffic on an access port

A company wants to prioritize all traffic from a critical application server connected to a switch port. The server does not mark its frames with CoS. The network engineer needs to assign CoS 5 to all incoming traffic from that server to ensure high priority in the switch fabric.

Topology

Server(Gi0/1)---Gi0/1(Switch)---Trunk to Core

Steps

  1. 1.Step 1: Enter global configuration mode: configure terminal
  2. 2.Step 2: Enable MLS QoS globally: mls qos
  3. 3.Step 3: Enter interface configuration mode for the server port: interface GigabitEthernet0/1
  4. 4.Step 4: Set the interface as an access port: switchport mode access
  5. 5.Step 5: Assign the default CoS value: mls qos cos 5
  6. 6.Step 6: Optionally, trust the CoS if the server starts marking: mls qos trust cos
  7. 7.Step 7: Exit and save: end, write memory
Configuration
!
mls qos
!
interface GigabitEthernet0/1
 switchport mode access
 mls qos cos 5
!

Verify: Use `show mls qos interface GigabitEthernet0/1` to verify the default CoS. Expected output includes 'trust state: not trusted' and 'default cos: 5'.

Watch out: If `mls qos trust cos` is also configured, the switch will trust incoming CoS markings, overriding the default CoS. Ensure you only set default CoS when you want to assign a value to unmarked packets, not to override existing markings.

Set default CoS for voice VLAN on a phone port

A Cisco IP phone is connected to a switch port configured with a voice VLAN. The phone marks its voice traffic with CoS 5, but the PC connected through the phone does not mark traffic. The engineer wants to ensure PC traffic gets CoS 0 (best effort) while trusting the phone's CoS markings.

Topology

PC---Phone---Gi0/2(Switch)---Trunk to Core

Steps

  1. 1.Step 1: Enter global configuration mode: configure terminal
  2. 2.Step 2: Enable MLS QoS globally: mls qos
  3. 3.Step 3: Enter interface configuration mode: interface GigabitEthernet0/2
  4. 4.Step 4: Configure the interface as a trunk for voice VLAN: switchport mode trunk (or access with voice VLAN)
  5. 5.Step 5: Set the voice VLAN: switchport voice vlan 10
  6. 6.Step 6: Trust CoS markings from the phone: mls qos trust cos
  7. 7.Step 7: Set default CoS for unmarked traffic (PC traffic): mls qos cos 0
  8. 8.Step 8: Exit and save: end, write memory
Configuration
!
mls qos
!
interface GigabitEthernet0/2
 switchport mode trunk
 switchport voice vlan 10
 mls qos trust cos
 mls qos cos 0
!

Verify: Use `show mls qos interface GigabitEthernet0/2` to verify. Expected output: 'trust state: trust cos', 'default cos: 0'. Also use `show mls qos interface GigabitEthernet0/2 statistics` to see CoS distribution.

Watch out: The `mls qos cos` command sets the default CoS only for packets that arrive without a CoS tag. On a trunk port, all frames are tagged, so this command may have no effect unless the phone does not tag PC traffic. Ensure the phone is configured to pass PC traffic untagged.

Troubleshooting with This Command

When troubleshooting QoS issues related to CoS marking, the `mls qos cos` command is often a starting point. A healthy configuration shows the expected default CoS value on the interface, and the trust state should match the design intent. Use `show mls qos interface [interface]` to display the current default CoS, trust state, and whether QoS is enabled.

For example, if the output shows 'default cos: 0' but you expected 5, the command may not have been applied correctly or the interface may be in a different mode. Another key indicator is the 'trust state' field: if it says 'trust cos', the switch will use the CoS value in the incoming frame; if 'not trusted', it will use the default CoS. A common symptom is that voice traffic is being dropped or delayed, which could indicate that the CoS marking is not being trusted or the default CoS is too low.

To diagnose, first verify global QoS is enabled with `show mls qos`. Then check the interface with `show mls qos interface Gi0/1`. If the trust state is 'not trusted' and the default CoS is 0, all traffic gets best-effort treatment.

If you intended to trust CoS, add `mls qos trust cos`. If you intended to assign a default CoS, ensure `mls qos cos <value>` is configured. Use `show mls qos interface Gi0/1 statistics` to see the number of packets received with each CoS value; this helps confirm whether packets are being marked as expected.

For deeper troubleshooting, use `debug mls qos` (caution: can be CPU-intensive) to see per-packet CoS decisions. Correlate with `show policy-map interface` if a service policy is applied. On some platforms, the command `show platform qos` provides hardware-level details.

Remember that CoS is only relevant on trunk ports or access ports with VLAN tagging; on pure access ports without voice VLAN, all frames are untagged and the switch assigns the default CoS. If you see unexpected behavior, check the interface configuration for `switchport mode access` vs `trunk` and whether a voice VLAN is configured. Also verify that the connected device is actually sending 802.1Q tags; if not, the default CoS applies.

Finally, ensure the QoS queueing configuration (like `wrr-queue` or `priority-queue`) is mapped to CoS values appropriately using `mls qos srr-queue` commands.

CCNA Exam Tips

1.

CCNA exam tip: 'mls qos cos' only applies when 'mls qos' is globally enabled; otherwise, the command is accepted but has no effect.

2.

CCNA exam tip: The default CoS is applied only to untagged frames; tagged frames retain their original CoS unless 'mls qos trust cos' is configured.

3.

CCNA exam tip: CoS values range from 0 to 7; common values: 5 for voice, 4 for video, 0 for best effort.

4.

CCNA exam tip: On a trunk port, 'mls qos cos' sets the default CoS for the native VLAN only if the native VLAN frames are untagged.

Common Mistakes

Mistake: Forgetting to enable 'mls qos' globally before configuring interface QoS commands; the command is accepted but QoS does not function.

Mistake: Setting a default CoS on a trunk port expecting it to apply to all VLANs; it only applies to untagged frames (native VLAN).

Mistake: Confusing 'mls qos cos' with 'mls qos trust cos'; the former sets a default, the latter trusts incoming markings.

mls qos cos [value] vs mls qos

Both commands are part of Cisco's MLS QoS feature on Catalyst switches, often confused because 'mls qos cos' requires 'mls qos' to be globally enabled to take effect. The global command activates QoS processing, while the interface command sets a default CoS marking for untagged packets.

Aspectmls qos cos [value]mls qos
ScopeInterface-specific (single port)Global (entire switch)
Configuration ModeInterface Configuration modeGlobal Configuration mode
EffectSets default CoS value (0-7) for packets without a CoS markingEnables QoS globally; allows trust, queueing, and policing configuration
DependenciesRequires 'mls qos' to be enabled globally; otherwise command accepted but inactiveNo prerequisite, but per-interface CoS commands depend on it
PersistenceStored per interface in running-config (e.g., 'mls qos cos 3')Stored in global running-config as 'mls qos'

Use mls qos cos [value] when you need to assign a default Layer 2 priority to untagged ingress traffic on a specific interface that does not trust incoming markings.

Use mls qos when you need to globally enable QoS processing on the switch to support trust settings, egress queues, or policing policies.

Platform Notes

On IOS-XE (e.g., Catalyst 3650/3850/9300), the command syntax is identical: `mls qos cos [value]` under interface configuration. However, the output of `show mls qos interface` may differ slightly, showing additional fields like 'trust device' or 'cos override'. On NX-OS (e.g., Nexus 9000), the equivalent command is `qos cos [value]` under interface configuration, but QoS configuration is fundamentally different: NX-OS uses class maps and policy maps with type qos, and the default CoS is set via `set qos cos` in a policy map.

There is no direct `mls qos cos` equivalent; instead, you would create a policy map that sets the CoS and apply it to the interface. On ASA firewalls, CoS is not typically manipulated; instead, DSCP is used for QoS. The command does not exist on IOS-XR; XR uses a modular QoS CLI (MQC) with `set cos` in a policy map.

Between IOS versions, the command has been consistent from 12.x to 16.x, but on older Catalyst 2950/3550 switches running IOS 12.1, the command may be `qos cos` instead of `mls qos cos`. Always check the platform documentation. On Catalyst 6500 with hybrid mode (CatOS), the command is `set port qos cos [mod/port] [value]`.

For CCNA/CCNP exams, focus on the IOS syntax as it is the most common.

Related Commands

Practice for the CCNA 200-301

Test your knowledge with practice questions covering all CCNA 200-301 exam domains.

Practice CCNA 200-301 Questions