Watch on Instagram

Network Bytes · Episode 97 · CCNA 2.2

"The native VLAN"

On an 802.1Q trunk, frames in the native VLAN cross without a tag, and untagged frames that arrive are placed in it. It is VLAN 1 by default, both ends must match, and best practice is an unused VLAN.

Posted · About a 1 minute watch, 3 minute read · Take the quiz

Tags on a trunk

A trunk is one link between switches that carries many VLANs at once. To keep them apart, 802.1Q inserts a small tag into each frame as it enters the trunk. The tag holds the frame's VLAN number, so the far switch knows which VLAN to deliver it to, and it removes the tag before sending the frame out an access port.

The group with no wristband

Picture a shuttle bus where every group wears a colored wristband, except one group that rides with bare wrists. That bare-wristed group is the native VLAN:

  • Frames in the native VLAN are sent across the trunk without a tag.
  • Frames that arrive untagged on the trunk are placed into the native VLAN.

On Cisco switches the native VLAN is VLAN 1 unless you change it:

`` interface GigabitEthernet0/1 switchport mode trunk switchport trunk native vlan 999 ``

Both ends must match

Each end of the trunk decides for itself which VLAN untagged frames belong to. If one end says native VLAN 1 and the other says native VLAN 99, the trunk stays up, but an untagged frame sent from VLAN 1 on one side arrives in VLAN 99 on the other: traffic leaks between two different VLANs. CDP notices and logs:

`` %CDP-4-NATIVE_VLAN_MISMATCH ``

show interfaces trunk shows the native VLAN on each end so you can compare them.

Why an unused native VLAN

In a double-tagging VLAN-hopping attack, a host on the native VLAN sends a frame with two tags. The first switch strips the outer tag (it matches the native VLAN) and forwards the frame untagged, leaving the inner tag to steer it into a VLAN the attacker should not reach. Setting the native VLAN to an unused VLAN that carries no user traffic takes away the starting point for that trick.

Try it yourself

In Cisco Packet Tracer, connect two switches with a trunk and run show interfaces trunk on both: note the native VLAN. Then change it on only one side with switchport trunk native vlan 99 and watch for the CDP mismatch message. Finally set the same unused VLAN on both ends and check that the message stops.

Good to know

  • CCNA 2.2 covers configuring and verifying interswitch connectivity: trunk ports, 802.1Q and the native VLAN (EP31 covers trunks and 802.1Q tags).
  • On an 802.1Q trunk, native VLAN frames are sent untagged, and untagged frames received on the trunk are placed in the native VLAN.
  • On Cisco switches the native VLAN is VLAN 1 by default and is changed with switchport trunk native vlan <id>.
  • A mismatch doesn't bring the trunk down, but untagged traffic crosses between the two different native VLANs, and CDP logs %CDP-4-NATIVE_VLAN_MISMATCH (EP35). Spanning tree may also block the port (a PVST+ inconsistency), which the short leaves out.
  • Moving the native VLAN to an unused VLAN that carries no user traffic defends against double-tagging VLAN-hopping attacks. Some platforms can also tag native-VLAN traffic (vlan dot1q tag native), which the short leaves out.
  • Control traffic such as CDP, VTP and DTP is still sent on VLAN 1 regardless of the native VLAN setting (left out of the short).
  • "Shuttle bus wristbands" is the analogy.

For CCNA learners

CCNA exam topic 2.2 covers configuring and verifying trunks. Know that the native VLAN is the untagged one (VLAN 1 by default), that both ends must match, and how to change and verify it with switchport trunk native vlan and show interfaces trunk.

Answer to the comment question

3. VLANs 10, 20 and 30 get an 802.1Q tag. VLAN 1 is the native VLAN, so its frames cross the trunk untagged.

Test your knowledge

Quick quiz: "The native VLAN"

4 multiple-choice questions. Pick one answer for each, then check how you did.

1On an 802.1Q trunk, what happens to frames in the native VLAN?
2A switch receives an untagged frame on a trunk port. Where does it go?
3What happens when the two ends of a trunk use different native VLANs?
4Which is the best practice for the native VLAN?

Sources

Video transcript

On a trunk link, which VLAN's frames travel with no tag at all?

A trunk carries many VLANs, and 802.1Q tags each frame with its VLAN number.

Think of a shuttle bus with colored wristbands for each group. One group rides with no wristband.

That's the native VLAN. Its frames cross untagged, and untagged arrivals land in it. By default, it's VLAN 1.

Both ends must match. If not, frames land in the wrong VLAN, and CDP reports a native VLAN mismatch.

Best practice: set it to an unused VLAN, which blocks a VLAN-hopping trick.

A trunk carries VLANs 1, 10, 20 and 30, with native VLAN 1. How many of them get tagged? Comment your answer below!

That's your byte.

More from Network Bytes

All Network Bytes lessons