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
enableThe # prompt.
configure terminalInto configuration mode.
vlan 999The native VLAN this site has agreed on.
name NATIVE-UNUSEDNamed so it is obvious it is not for users.
exitOut.
interface gi0/1This end of the trunk.
switchport mode trunkA trunk.
switchport trunk native vlan 999This end says 999. If the far end still says 1, untagged frames change VLAN as they cross.
endOut.
show running-configRead 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
Console into a switch
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.