Hone

Lessons · Network switches · a native VLAN mismatch

Two switches disagreeing, quietly

If the two ends of a trunk have different native VLANs, untagged traffic leaves one VLAN and arrives in another, and both switches think they are correct.

Hone is a place to practise programming. This is one of its lessons, written out in full and free to read without an account.

What it is for

It produces a fault with no error message: two networks that should be separate can suddenly reach each other, or a device stops seeing its own subnet for no visible reason.

How to think about it

Whenever you set a native VLAN, set it on both ends in the same sitting. When traffic appears in a VLAN it has no business being in, check this before anything else.

Worked example

enable
The # prompt.
configure terminal
Into configuration mode.
vlan 999
The native VLAN this site has agreed on.
name NATIVE-UNUSED
Named so it is obvious it is not for users.
exit
Out.
interface gi0/1
This end of the trunk.
switchport mode trunk
A trunk.
switchport trunk native vlan 999
This end says 999. If the far end still says 1, untagged frames change VLAN as they cross.
end
Out.
show running-config
Read the line back, then go and read the same line on the other switch. That comparison is the whole check.

Your turn

Set this end's untagged VLAN to 999.

switchport trunk native  999

The trap

Trusting that a mismatch will be reported. Some switches log it and some do not, and a logged message on a device nobody is watching is the same as no message.

Practise a native VLAN mismatch on HoneA question on it now, a coding challenge where there is one, and it is remembered for review. Free, no email needed.