Native VLAN Configuration and Security on Cisco Switches

Master native VLAN configuration on Cisco Catalyst switches, understand VLAN hopping attacks, and implement security best practices to protect your switched network.

Native VLAN Configuration and Security on Cisco Switches - PingLabz VLAN article title card

The native VLAN is one of the most overlooked and misunderstood aspects of VLAN trunking. Leaving it at the default (VLAN 1) introduces a serious security vulnerability and creates operational complications. Understanding native VLAN configuration, detection of mismatches, and protection against VLAN hopping attacks is essential for secure network design.

(This article is part of the PingLabz VLAN series - the full VLAN and Layer 2 switching guide maps the whole cluster in reading order.)

What is the Native VLAN?

The native VLAN is the VLAN assigned to untagged frames on a trunk link. When a switch receives an untagged frame on a trunk port, it automatically assigns the frame to the native VLAN. Similarly, when a switch transmits a frame belonging to the native VLAN on a trunk port, it sends the frame untagged (without the 802.1Q tag).

Why Untagged Frames Exist

This behavior originates from 802.1Q's historical design. When 802.1Q was new, many older network devices didn't support 802.1Q tagging. By sending the native VLAN untagged, those legacy devices could still communicate on the shared trunk link without understanding tags. Modern networks no longer need this compatibility, but the behavior persists for backward compatibility.

Native VLAN and Management Traffic

Historically, the native VLAN was used for management traffic on switches:

VLAN 1 (native) on trunk:
 - Management IP address (192.168.1.1)
 - SNMP community strings
 - SSH/Telnet access
 - Spanning Tree Protocol frames
 - Other management protocols

In this design, management frames sent untagged on a trunk would reach the switch management interface, allowing remote management via the trunk link. This became the default behavior because VLAN 1 was automatically the native VLAN on all trunks.

The Security Problem with VLAN 1

Leaving VLAN 1 as the native VLAN on production trunks is a security vulnerability because:

  1. Default connectivity: VLAN 1 exists on all switches by default, so any switch automatically has a management interface in VLAN 1
  2. Untagged traffic: Any untagged frame on a trunk reaches VLAN 1 and potentially the management interface
  3. Attack vector: An attacker who gains access to any switch port (even a compromised access port) could send untagged frames to the trunk, and those frames would reach VLAN 1 and the management interface

VLAN Hopping Attack Scenario

Consider an access switch with an attacker-controlled machine on an access port that was never configured, so it is still in VLAN 1, the same VLAN the trunk uses as its native VLAN:

Topology:
Attacker PC on ACC-SW1 Et0/2, an unused access port left in the default VLAN 1
ACC-SW1 Et0/1 trunk → DIST-SW1 Et0/1 (native VLAN 1, the default)
DIST-SW1 management: default VLAN 1, no IP configured at the start; after the fix it moves to Vlan30 (10.10.30.2/24)

Double-tagging attack (works only when the trunk native VLAN = the attacker's access VLAN, here VLAN 1):
1. Attacker crafts a frame with TWO 802.1Q tags: an outer tag for VLAN 1, an inner tag for the target VLAN (for example VLAN 10)
2. ACC-SW1 receives the frame on Et0/2, its access port in VLAN 1
3. ACC-SW1 forwards to DIST-SW1 over the trunk. Because VLAN 1 is the native VLAN, ACC-SW1 strips the outer tag and sends the frame with only the inner tag left
4. DIST-SW1 receives a single-tagged frame and forwards it into the inner-tag VLAN
5. The frame has hopped from VLAN 1 into a VLAN the attacker was never a member of
6. The hop is one-way (no return path), but it is enough to reach a victim or a management interface
Starting state: the attacker port ACC-SW1 Et0/2 is in VLAN 1, and the Et0/1 trunk to DIST-SW1 uses native VLAN 1. A double-tagged frame with outer tag 1 has that tag stripped on the trunk, and DIST-SW1 forwards it into the inner-tag VLAN. The fix is native VLAN 99 and management on Vlan30.

I built this starting state in my home lab on two Cisco IOL-L2 switches (IOS XE 17.18.2). The attacker port, Et0/2, is in VLAN 1 and the trunk's native VLAN is 1:

ACC-SW1# show vlan brief

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Et0/2, Et0/3
10   Users                            active
20   Voice                            active
30   Mgmt                             active
40   Printers                         active
50   Guest                            active
99   Native                           active
1002 fddi-default                     act/unsup
1003 token-ring-default               act/unsup
1004 fddinet-default                  act/unsup
1005 trnet-default                    act/unsup

ACC-SW1# show interfaces Ethernet0/1 trunk

Port           Mode             Encapsulation  Status        Native vlan
Et0/1          on               802.1q         trunking      1

Port           Vlans allowed on trunk
Et0/1          10,20,30,40,50,99

Port           Vlans allowed and active in management domain
Et0/1          10,20,30,40,50,99

Port           Vlans in spanning tree forwarding state and not pruned
Et0/1          10,20,30,40,50,99

This attack is called VLAN hopping, and it hinges entirely on the native VLAN: it only works while the trunk's native VLAN matches a VLAN an attacker can land on (VLAN 1, by default, on every port). Change the native VLAN to an unused VLAN like VLAN 99 that no access port uses, and the outer tag never gets stripped, so the attack vector is gone.

Changing the Native VLAN

Change the native VLAN from VLAN 1 to an unused VLAN on all trunk ports. In the lab, the trunk is Ethernet0/1 on both switches:

ACC-SW1# configure terminal
ACC-SW1(config)# interface Ethernet0/1
ACC-SW1(config-if)# switchport trunk native vlan 99
ACC-SW1(config-if)# end

DIST-SW1# configure terminal
DIST-SW1(config)# interface Ethernet0/1
DIST-SW1(config-if)# switchport trunk native vlan 99
DIST-SW1(config-if)# end

After changing the native VLAN, both sides of the trunk must use the same native VLAN or communication fails. Change both ends as close together as you can.

Verification After Native VLAN Change

Verify the native VLAN on each trunk:

ACC-SW1# show interfaces Ethernet0/1 trunk

Port           Mode             Encapsulation  Status        Native vlan
Et0/1          on               802.1q         trunking      99

Port           Vlans allowed on trunk
Et0/1          10,20,30,40,50,99

Port           Vlans allowed and active in management domain
Et0/1          10,20,30,40,50,99

Port           Vlans in spanning tree forwarding state and not pruned
Et0/1          10,20,30,40,50,99

DIST-SW1# show interfaces Ethernet0/1 trunk

Port           Mode             Encapsulation  Status        Native vlan
Et0/1          on               802.1q         trunking      99

Port           Vlans allowed on trunk
Et0/1          10,20,30,40,50,99

Port           Vlans allowed and active in management domain
Et0/1          10,20,30,40,50,99

Port           Vlans in spanning tree forwarding state and not pruned
Et0/1          10,20,30,40,50,99

Both sides now use VLAN 99 as the native VLAN. Untagged frames on these trunks belong to VLAN 99, not VLAN 1.

Native VLAN change in three steps: both ends on native 1; then ACC-SW1 on 99 and DIST-SW1 on 1, with CDP NATIVE_VLAN_MISMATCH logged on both switches and VLAN 99 missing from the forwarding list; then both on 99, with CDP reporting Native VLAN 99 and VLANs 10, 20, 30, 40, 50 and 99 forwarding.

Detecting Native VLAN Mismatches

If the native VLAN differs between the two ends of a trunk, Cisco Discovery Protocol (CDP) detects the mismatch and issues a warning. This is a critical detection mechanism for catching configuration errors. In the lab, ACC-SW1 was changed about 80 seconds before DIST-SW1, and both switches logged it during that window:

! ACC-SW1 moved to native VLAN 99 first (20:20:56); DIST-SW1 still has native VLAN 1
ACC-SW1# show logging | include NATIVE
*Oct 20 20:21:35.246: %CDP-4-NATIVE_VLAN_MISMATCH: Native VLAN mismatch discovered on Ethernet0/1 (99), with DIST-SW1.lab Ethernet0/1 (1).
ACC-SW1# show interfaces Ethernet0/1 trunk

Port           Mode             Encapsulation  Status        Native vlan
Et0/1          on               802.1q         trunking      99

Port           Vlans allowed on trunk
Et0/1          10,20,30,40,50,99

Port           Vlans allowed and active in management domain
Et0/1          10,20,30,40,50,99

Port           Vlans in spanning tree forwarding state and not pruned
Et0/1          10,20,30,40,50
ACC-SW1# show interfaces Ethernet0/1 switchport | include Native
Trunking Native Mode VLAN: 99 (Native)
Administrative Native VLAN tagging: disabled
Administrative private-vlan trunk Native VLAN tagging: enabled
ACC-SW1# show cdp neighbors Ethernet0/1 detail | include Device ID|Interface|Native
Device ID: DIST-SW1.lab
Interface: Ethernet0/1,  Port ID (outgoing port): Ethernet0/1
Native VLAN: 1 (Mismatch)

! DIST-SW1 logs the same fault with its own number first
DIST-SW1# show logging | include NATIVE
*Oct 20 20:21:41.078: %CDP-4-NATIVE_VLAN_MISMATCH: Native VLAN mismatch discovered on Ethernet0/1 (1), with ACC-SW1.lab Ethernet0/1 (99).

Even though CDP warns of the mismatch, the trunk stays up and the tagged VLANs keep forwarding. Untagged frames sent by ACC-SW1 (VLAN 99) arrive at DIST-SW1 and are assigned to DIST-SW1's native VLAN (1), and the reverse, so the two VLANs are bridged and VLAN 99 traffic breaks. Note the last line of the trunk output too: while the mismatch lasted, VLAN 99 dropped out of the spanning-tree forwarding list on ACC-SW1. It came back once both ends matched.

Always fix native VLAN mismatches immediately. The warning indicates a serious configuration error.

One point the warning implies but never states: CDP only reports the mismatch, it is not what bridges the two VLANs together, so switching CDP off on the trunk hides the message and leaves the fault running. Decoding the two VLAN numbers in that log line walks the detection-to-fix path on captured output.

VLAN 1 Never Fully Disappears

VLAN 1 is special on all Cisco switches. You cannot delete it; IOS rejects the command and VLAN 1 stays active:

ACC-SW1# configure terminal
ACC-SW1(config)# no vlan 1
%Default VLAN 1 may not be deleted.
ACC-SW1(config)# end
ACC-SW1# show vlan brief | include ^1
1    default                          active    Et0/2, Et0/3

This is intentional. VLAN 1 is the default VLAN every switchport starts in, which is also why the attacker port in this lab (Et0/2) is still listed in it. Do not use VLAN 1 for user traffic or management. Leave it unused.

Security Best Practice: Move Management Out of VLAN 1

Beyond changing the native VLAN, move management traffic out of VLAN 1 entirely. Configure the switch management IP in an unused VLAN:

ACC-SW1# configure terminal
ACC-SW1(config)# vlan 30
ACC-SW1(config-vlan)# name Mgmt
ACC-SW1(config-vlan)# exit
ACC-SW1(config)# interface Vlan30
ACC-SW1(config-if)# ip address 10.10.30.11 255.255.255.0
ACC-SW1(config-if)# description Management-Interface
ACC-SW1(config-if)# no shutdown
ACC-SW1(config-if)# exit
ACC-SW1(config)# interface Ethernet0/3
ACC-SW1(config-if)# switchport mode access
ACC-SW1(config-if)# switchport access vlan 30
ACC-SW1(config-if)# description Management-Access
ACC-SW1(config-if)# no shutdown
ACC-SW1(config-if)# exit
ACC-SW1(config)# end

ACC-SW1# show interfaces Vlan30 | include line protocol|Internet
Vlan30 is up, line protocol is up , Autostate Enabled
  Internet address is 10.10.30.11/24

Now the management interface lives in VLAN 30, not in the default VLAN 1. Untagged frames arriving on a trunk land in the native VLAN (VLAN 99 after the change above), which carries no hosts and no management interface, so they reach nothing useful.

Blocking Management VLAN from Trunks

For additional security, remove the management VLAN from the allowed VLAN list on user-facing trunks. This prevents users from seeing or accessing management traffic:

! Before: ACC-SW1 reaches DIST-SW1's management SVI in-band
ACC-SW1# ping 10.10.30.2 repeat 5
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.10.30.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/1/2 ms

ACC-SW1# configure terminal
ACC-SW1(config)# interface Ethernet0/1
ACC-SW1(config-if)# switchport trunk allowed vlan 10,20,40,50,99
ACC-SW1(config-if)# end
ACC-SW1# show interfaces Ethernet0/1 trunk

Port           Mode             Encapsulation  Status        Native vlan
Et0/1          on               802.1q         trunking      99

Port           Vlans allowed on trunk
Et0/1          10,20,40,50,99

Port           Vlans allowed and active in management domain
Et0/1          10,20,40,50,99

Port           Vlans in spanning tree forwarding state and not pruned
Et0/1          10,20,40,50,99
! Note: VLAN 30 (Management) is no longer in the allowed list

! After: the in-band management path is gone
ACC-SW1# ping 10.10.30.2 repeat 5
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.10.30.2, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)

Management traffic stays on the switch; only user VLANs cross to the distribution switch. That includes the switch's own in-band management: before the change ACC-SW1 pinged DIST-SW1's Vlan30 (10.10.30.2) 5/5, afterwards 0/5. Only prune the management VLAN from trunks that don't need to carry it, or manage the switch through its out-of-band port. In the lab I added VLAN 30 back with switchport trunk allowed vlan add 30.

VLAN Tagging on the Native VLAN: Advanced Configuration

In some edge cases, you might want the switch to tag frames even in the native VLAN. This is rare but useful for troubleshooting or special configurations. The vlan dot1q tag native command enables this:

ACC-SW1# configure terminal
ACC-SW1(config)# vlan dot1q tag native
ACC-SW1(config)# end

ACC-SW1# show interfaces Ethernet0/1 switchport | include Native
Trunking Native Mode VLAN: 99 (Native)
Administrative Native VLAN tagging: enabled
Administrative private-vlan trunk Native VLAN tagging: enabled
ACC-SW1# show interfaces Ethernet0/1 trunk

Port           Mode             Encapsulation  Status        Native vlan
Et0/1          on               802.1q         trunking      99

Port           Vlans allowed on trunk
Et0/1          10,20,30,40,50,99

Port           Vlans allowed and active in management domain
Et0/1          10,20,30,40,50,99

Port           Vlans in spanning tree forwarding state and not pruned
Et0/1          10,20,30,40,50,99

After executing this command, the native VLAN frames on trunks will be tagged with a 802.1Q header. show interfaces trunk looks the same; the change shows up as "Administrative Native VLAN tagging: enabled" in show interfaces switchport. This breaks compatibility with devices expecting untagged native VLAN frames, so use it only if you understand the consequences. I enabled it on ACC-SW1 for this test only and removed it afterwards with no vlan dot1q tag native.

Complete Native VLAN Configuration Example

Here is the finished trunk configuration from both lab switches. The same settings belong on every trunk in the network:

! Finished trunk configuration on both lab switches
ACC-SW1# show running-config interface Ethernet0/1
Building configuration...

Current configuration : 227 bytes
!
interface Ethernet0/1
 description trunk-to-DIST-SW1
 switchport trunk encapsulation dot1q
 switchport trunk native vlan 99
 switchport trunk allowed vlan 10,20,30,40,50,99
 switchport mode trunk
 switchport nonegotiate
end

DIST-SW1# show running-config interface Ethernet0/1
Building configuration...

Current configuration : 226 bytes
!
interface Ethernet0/1
 description trunk-to-ACC-SW1
 switchport trunk encapsulation dot1q
 switchport trunk native vlan 99
 switchport trunk allowed vlan 10,20,30,40,50,99
 switchport mode trunk
 switchport nonegotiate
end

! Repeat the same native VLAN, allowed list and nonegotiate on every trunk

Verification and Troubleshooting

Symptom: Native VLAN mismatch warning appears

Cause: The two ends of a trunk have different native VLANs.

Fix: Ensure both sides match. Find the mismatch:

! ACC-SW1 (already on native VLAN 99) logs the mismatch
ACC-SW1# show logging | include NATIVE
*Oct 20 20:21:35.246: %CDP-4-NATIVE_VLAN_MISMATCH: Native VLAN mismatch discovered on Ethernet0/1 (99), with DIST-SW1.lab Ethernet0/1 (1).
ACC-SW1# show interfaces Ethernet0/1 switchport | include Native
Trunking Native Mode VLAN: 99 (Native)
Administrative Native VLAN tagging: disabled
Administrative private-vlan trunk Native VLAN tagging: enabled
ACC-SW1# show cdp neighbors Ethernet0/1 detail | include Device ID|Interface|Native
Device ID: DIST-SW1.lab
Interface: Ethernet0/1,  Port ID (outgoing port): Ethernet0/1
Native VLAN: 1 (Mismatch)

! Check the remote switch
DIST-SW1# show interfaces Ethernet0/1 switchport | include Native
Trunking Native Mode VLAN: 1 (default)
Administrative Native VLAN tagging: disabled
Administrative private-vlan trunk Native VLAN tagging: enabled

! The mismatch is clear. Fix DIST-SW1
DIST-SW1# configure terminal
DIST-SW1(config)# interface Ethernet0/1
DIST-SW1(config-if)# switchport trunk native vlan 99
DIST-SW1(config-if)# end

! Verify: CDP now reports a matching native VLAN, and no new messages
! arrived after the 20:22:17 fix (CDP sends every 60 seconds)
ACC-SW1# show clock
*20:26:56.444 UTC Tue Oct 20 2026
ACC-SW1# show cdp | include Sending|holdtime
	Sending CDP packets every 60 seconds
	Sending a holdtime value of 180 seconds
	Sending CDPv2 advertisements is enabled
ACC-SW1# show logging | include NATIVE
*Oct 20 20:21:35.246: %CDP-4-NATIVE_VLAN_MISMATCH: Native VLAN mismatch discovered on Ethernet0/1 (99), with DIST-SW1.lab Ethernet0/1 (1).
ACC-SW1# show cdp neighbors Ethernet0/1 detail | include Device ID|Native
Device ID: DIST-SW1.lab
Native VLAN: 99

DIST-SW1# show clock
*20:26:59.410 UTC Tue Oct 20 2026
DIST-SW1# show logging | include NATIVE
*Oct 20 20:21:41.078: %CDP-4-NATIVE_VLAN_MISMATCH: Native VLAN mismatch discovered on Ethernet0/1 (1), with ACC-SW1.lab Ethernet0/1 (99).
DIST-SW1# show cdp neighbors Ethernet0/1 detail | include Device ID|Native
Device ID: ACC-SW1.lab
Native VLAN: 99

Symptom: Management access lost after changing native VLAN

Cause: You changed the native VLAN but didn't move the management IP to a proper management VLAN, so management traffic is now in an isolated VLAN.

Fix: Configure a management VLAN and move the management IP. On DIST-SW1 in the lab:

DIST-SW1# configure terminal
DIST-SW1(config)# vlan 30
DIST-SW1(config-vlan)# name Mgmt
DIST-SW1(config-vlan)# exit
DIST-SW1(config)# interface Vlan30
DIST-SW1(config-if)# ip address 10.10.30.2 255.255.255.0
DIST-SW1(config-if)# no shutdown
DIST-SW1(config-if)# exit
DIST-SW1(config)# interface Ethernet0/3
DIST-SW1(config-if)# switchport mode access
DIST-SW1(config-if)# switchport access vlan 30
DIST-SW1(config-if)# description Management-Access
DIST-SW1(config-if)# no shutdown
DIST-SW1(config-if)# end

! Verify management interface
DIST-SW1# show interfaces Vlan30 | include Vlan30 is|Hardware|Internet
Vlan30 is up, line protocol is up , Autostate Enabled
  Hardware is Ethernet SVI, address is aabb.cc80.0200 (bia aabb.cc80.0200)
  Internet address is 10.10.30.2/24

Symptom: Untagged frames reaching the wrong VLAN on the far end of a trunk

Cause: Native VLAN mismatch. Untagged frames sent by one switch arrive at the other in the wrong VLAN.

Fix: Ensure native VLANs match on both sides of the trunk:

! Verify both sides
ACC-SW1# show interfaces Ethernet0/1 switchport | include Native
Trunking Native Mode VLAN: 99 (Native)
Administrative Native VLAN tagging: disabled
Administrative private-vlan trunk Native VLAN tagging: enabled

DIST-SW1# show interfaces Ethernet0/1 switchport | include Native
Trunking Native Mode VLAN: 99 (Native)
Administrative Native VLAN tagging: disabled
Administrative private-vlan trunk Native VLAN tagging: enabled

! If they match and the problem persists, check that the native VLAN exists and is active
ACC-SW1# show vlan brief | include ^99
99   Native                           active

Symptom: Can't manage switch via trunk after changing native VLAN

Cause: Management traffic is not properly configured or routed after the native VLAN change.

Fix: Ensure management VLAN has connectivity and proper routing:

! Verify the management interface
DIST-SW1# show interfaces Vlan30 | include Vlan30 is|Hardware|Internet
Vlan30 is up, line protocol is up , Autostate Enabled
  Hardware is Ethernet SVI, address is aabb.cc80.0200 (bia aabb.cc80.0200)
  Internet address is 10.10.30.2/24

! Verify VLAN 30 exists, is active and has ports (Et0/3 access, Et0/1 trunk)
DIST-SW1# show vlan id 30

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
30   Mgmt                             active    Et0/1, Et0/3

VLAN Type  SAID       MTU   Parent RingNo BridgeNo Stp  BrdgMode Trans1 Trans2
---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------
30   enet  100030     1500  -      -      -        -    -        0      0

Remote SPAN VLAN
----------------
Disabled

Primary Secondary Type              Ports
------- --------- ----------------- ------------------------------------------

! Test the management path across the trunk to ACC-SW1
DIST-SW1# ping 10.10.30.11 repeat 5
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 10.10.30.11, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 2/2/3 ms

Key Takeaways

  • Change the native VLAN from VLAN 1 to an unused VLAN (like VLAN 99) on all trunks to prevent VLAN hopping attacks
  • Native VLAN mismatch is detected by CDP and prevents proper communication across trunks; always ensure both ends match
  • Move management traffic into a dedicated management VLAN (VLAN 30) out of the vulnerable VLAN 1, and assign an out-of-band management port
  • VLAN 1 cannot be deleted (IOS rejects no vlan 1); leave it unused and avoid using it for any traffic
  • Verify native VLAN configuration with show interfaces <port> trunk and immediately fix any mismatches detected by CDP
  • Use vlan dot1q tag native only in rare edge cases where native VLAN tagging is required for specific network scenarios
Build this yourself, on real gear
The PingLabz lab library: 74 hands-on labs on real Cisco IOS XE in Cisco Modeling Labs. Seven are free, no card required.
Browse the labs

Read next