Network4 min read· 3 practice problems

Native VLAN mismatch detected: causes and fix (CDP warning, trunk config on both ends, server uplinks)

The %CDP-4-NATIVE_VLAN_MISMATCH warning and the one-VLAN-fails symptom come from trunk ends that disagree on the native VLAN or the allowed list. Compare both sides with show interfaces trunk, align them, and handle server uplinks and VLAN hopping.

On this page
  1. Short answer: the two ends of the trunk use different native VLANs
  2. How to read the warning
  3. Diagnosis: run the same commands on both ends
  4. Cause 1: different native VLANs — set the same value on both ends
  5. Cause 2: different allowed VLAN lists
  6. Cause 3: the other end is a server or hypervisor
  7. Security: keep the native VLAN empty
  8. What not to do
  9. The order to work in
  10. Quick diagnostic checklist

Short answer: the two ends of the trunk use different native VLANs

An 802.1Q trunk sends only the native VLAN untagged, and the receiving side puts untagged frames into its own native VLAN. If the two ends disagree, VLAN 1 traffic from this side lands in VLAN 99 on the other. Tagged VLANs keep working, so it looks like a partial outage: "only one VLAN fails", "only the switch management IP is unreachable". The cause is usually one of three:

  1. The native VLAN differs between the two ends — the CDP warning keeps repeating
  2. The allowed VLAN lists differ — one VLAN fails with no warning at all
  3. The other end is a server or hypervisor — the two sides expect different tagging

How to read the warning

%CDP-4-NATIVE_VLAN_MISMATCH: Native VLAN mismatch discovered on GigabitEthernet1/0/8 (1), with SW-CORE-02 GigabitEthernet1/0/24 (99).

Cisco IOS compares the native VLAN its neighbor advertises over CDP with its own. The first part is your port and your native VLAN; after with come the neighbor's device name, port and native VLAN. Here your Gi1/0/8 uses 1 and the neighbor's Gi1/0/24 uses 99. Depending on the device and OS the wording and port name differ, as in "native vlan mismatch detected on interface gi8", but the meaning is the same. Switches running PVST+ may also block the native VLAN on that port in STP (%SPANTREE-2-BLOCK_PVID_PEER, %SPANTREE-2-BLOCK_PVID_LOCAL).

Diagnosis: run the same commands on both ends

show interfaces trunk
show interfaces gi1/0/8 switchport
show cdp neighbors gi1/0/8 detail
Port        Mode         Encapsulation  Status        Native vlan
Gi1/0/8     on           802.1q         trunking      1

Port        Vlans allowed on trunk
Gi1/0/8     1,10,20,99
  • Native vlan column — does it match on both ends? If not, cause 1
  • Vlans allowed on trunk — is the failing VLAN listed on both ends? If not, cause 2
  • Cross-check with Trunking Native Mode VLAN in the switchport output and Native VLAN in the CDP detail

Cause 1: different native VLANs — set the same value on both ends

interface GigabitEthernet1/0/8
 switchport mode trunk
 switchport trunk native vlan 999

If your management session rides this link's native VLAN, it drops the moment you change one side. Change the far end first, or have a console ready.

Cause 2: different allowed VLAN lists

There is no CDP warning for this one. Add the VLAN missing on one side. Without add, the command replaces the whole list and cuts every other VLAN at once.

switchport trunk allowed vlan add 30

Cause 3: the other end is a server or hypervisor

The switch's native VLAN reaches the server untagged. If the native VLAN is 10, Linux receives it on eth0, not on eth0.10; a VMware port group set to the switch's native VLAN ID never matches because the frames carry no tag (use VLAN ID 0 for the port group that should receive native traffic). Check on the server whether frames really arrive tagged.

tcpdump -e -nn -i eth0 vlan
bridge vlan show      # Linux bridge: "PVID Egress Untagged" plays the native role

Security: keep the native VLAN empty

If the native VLAN equals a user access VLAN, double tagging lets an attacker push frames into another VLAN (VLAN hopping). Use a dedicated native VLAN that no access port uses (for example 999), and on platforms that support it, tag the native VLAN too with vlan dot1q tag native (the same on both ends). Turn DTP off with switchport nonegotiate.

What not to do

  • Silencing the warning with no cdp enable — the mismatch is still there.
  • Typing switchport trunk allowed vlan without add on a live trunk.

The order to work in

  1. Read both native VLANs from the two values in brackets in the warning
  2. Compare Native vlan and the allowed list in show interfaces trunk on both ends
  3. Set the same dedicated native VLAN; add missing VLANs with add
  4. For server uplinks, check tagging with tcpdump -e

To practise the case where one VLAN fails because of the allowed list, try A trunk link comes up and one VLAN still fails.

Quick diagnostic checklist

  • The two numbers in brackets in the warning are your port's and the neighbor's native VLAN.
  • Compare the Native vlan column of show interfaces trunk on both switches.
  • Check that the failing VLAN appears in Vlans allowed on trunk on both ends.
  • Confirm the neighbor's advertised Native VLAN with show cdp neighbors <if> detail.
  • Set switchport trunk native vlan <id> to the same value on both ends.
  • When adding a VLAN, use switchport trunk allowed vlan add so the list is not replaced.
  • On server or hypervisor uplinks, check tagging with tcpdump -e -nn -i eth0 vlan.
  • Keep the native VLAN dedicated and unused on access ports to prevent VLAN hopping.

Practice with this guide

Reviewed problems about the same failure. Write the cause, recovery, and prevention yourself, then compare with the model answer.

Read next