In an IEEE 802.1Q trunking environment, the native VLAN designates which virtual local area network handles untagged traffic passing across an inter-switch link. By default, Cisco Catalyst switches assign VLAN 1 as the native VLAN across all switchports and trunk links. While functional out of the box, leaving this default intact presents substantial security liabilities and operational hazards.
Hardening layer 2 infrastructure requires network administrators to reassign the native VLAN to an isolated, unused VLAN ID across all trunk connections. This guide covers the security rationale for changing VLAN 1, the core IEEE 802.1Q architectural rules, the exact Cisco IOS/IOS-XE configuration commands, verification templates, native VLAN tagging mechanisms, and methods for resolving common trunk mismatches.
Table of Contents
Security Considerations: Why Change Default Native VLAN 1?
Q: What inherent security vulnerabilities exist when leaving the native VLAN set to default VLAN 1?
A: Cisco switches utilize VLAN 1 as the default administrative, management, and transit subnet for factory-default configurations. Uncompressed control plane protocols—including Cisco Discovery Protocol (CDP), VLAN Trunking Protocol (VTP), Port Aggregation Protocol (PAgP), and Dynamic Trunking Protocol (DTP)—transmit across VLAN 1 by default. If untagged user data shares this same broadcast domain, malicious actors connected to unhardened access ports can more easily target internal network management interfaces, intercept control traffic, or orchestrate denial-of-service attacks against switch supervisor engines.
Q: How does default native VLAN configuration facilitate VLAN hopping via double-tagging?
A: An 802.1Q double-tagging attack exploits the default behavior where native VLAN traffic traverses a trunk port untagged. An attacker sends a frame containing two separate 802.1Q headers: an outer tag matching the trunk’s native VLAN (typically VLAN 1) and an inner tag matching the targeted victim VLAN. When the ingress switch receives this frame on an access port that shares the native VLAN ID, it forwards the frame across the trunk after stripping the outer tag. Because the outer tag was stripped, the frame arrives at the downstream switch bearing only the inner tag. The destination switch reads this remaining tag and forwards the frame directly into the victim’s VLAN. This unidirectional breach bypasses Layer 3 inspection firewalls and access control lists (ACLs).
Q: What is the recognized best practice for native VLAN assignment?
A: Network security frameworks (such as the DISA Network Infrastructure STIG and Cisco Hardening Guides) mandate assigning the native VLAN to a dedicated, unrouted “dummy” VLAN ID (such as VLAN 999 or VLAN 1002) that carries zero user or management traffic. No physical access ports should ever be mapped to this VLAN, and the subnet should not be configured with a Switch Virtual Interface (SVI) on any Layer 3 device.
Cisco Catalyst VLAN Trunking Specifications and Reference Rules
According to the Cisco Catalyst and IOS-XE VLAN Trunking architectural specifications, 802.1Q encapsulation adheres to strict operational parameters:
- Frame Encapsulation: An IEEE 802.1Q frame inserts a 4-byte tag into the standard Ethernet header containing a Tag Protocol Identifier (TPID 0x8100) and Tag Control Information (TCI, comprising Priority, DEI, and the 12-bit VLAN Identifier).
- Native VLAN Forwarding: When a frame belonging to the configured native VLAN is forwarded across an 802.1Q trunk, the switch transmits it without the 4-byte 802.1Q tag header unless explicit native VLAN tagging is enabled globally.
- Ingress Untagged Frame Processing: Any untagged or priority-tagged (VLAN 0) frame arriving at an 802.1Q trunk interface is immediately assigned to the interface’s configured native VLAN.
- Symmetry Constraint: Both endpoints of an active 802.1Q trunk link must share an identical native VLAN ID. Asymmetrical assignments trigger protocol guards within Spanning Tree Protocol (STP) and CDP.
- Valid Range: The native VLAN must be a valid, operational VLAN configured within the normal (1–1005) or extended (1006–4094) range on platforms operating in VTP transparent mode or VTP version 3.
+--------------------------------------------------------------------------------+
| Command / Parameter | Default Value | Supported Context |
+----------------------------------+---------------+-----------------------------+
| switchport trunk native vlan <id>| VLAN 1 | Interface / Port-Channel |
| vlan dot1q tag native | Disabled | Global Configuration |
| switchport trunk native vlan tag | Disabled | Interface (Select IOS-XE) |
+----------------------------------+---------------+-----------------------------+
With these architectural rules defined, administrators can proceed to execute the native VLAN modification across active links.
Step-by-Step Guide: Configuring the Native VLAN on a Trunk Port
Follow these sequential steps to modify the native VLAN on a physical interface or an EtherChannel port-channel interface using the Cisco IOS/IOS-XE command-line interface (CLI).
Step 1: Create the Dedicated Native VLAN
Before assigning a new native VLAN to a trunk link, create the target VLAN within the local switch database.
Switch-A# configure terminal
Switch-A(config)# vlan 999
Switch-A(config-vlan)# name NATIVE_DUMMY_VLAN
Switch-A(config-vlan)# state active
Switch-A(config-vlan)# no shutdown
Switch-A(config-vlan)# exit
Step 2: Access the Target Trunk Interface
Navigate to the interface or port-channel linking the two switches.
Switch-A(config)# interface GigabitEthernet0/1
(Note: If configuring an EtherChannel link, apply this command directly to the logical port-channel interface, e.g., interface Port-channel 1, to ensure uniform propagation across all member links.)
Step 3: Validate Trunk Mode and Encapsulation
Confirm that the interface is statically defined as an 802.1Q trunk.
Switch-A(config-if)# switchport trunk encapsulation dot1q
Switch-A(config-if)# switchport mode trunk
(Note: The switchport trunk encapsulation dot1q command is automatically applied or omitted on newer Cisco Catalyst switches that exclusively support 802.1Q.)
Step 4: Apply the Native VLAN Modification
Set the designated native VLAN ID on the interface.
Switch-A(config-if)# switchport trunk native vlan 999
Switch-A(config-if)# exit
Step 5: Mirror Configuration on the Remote Switch
Because the native VLAN must match at both endpoints, access the interconnected switch immediately to apply identical settings.
Switch-B# configure terminal
Switch-B(config)# vlan 999
Switch-B(config-vlan)# name NATIVE_DUMMY_VLAN
Switch-B(config-vlan)# exit
Switch-B(config)# interface GigabitEthernet0/1
Switch-B(config-if)# switchport mode trunk
Switch-B(config-if)# switchport trunk native vlan 999
Switch-B(config-if)# end
Step 6: Save the Running Configuration
Commit the configuration changes to non-volatile RAM (NVRAM) on both devices.
Switch-A# copy running-config startup-config
Switch-B# copy running-config startup-config
Verifying Trunk Port Native VLAN Configuration: CLI Templates
Use the following CLI commands and output reference templates to confirm that the native VLAN is active and operational.
Verification Template 1: show interfaces trunk
This command provides a concise table displaying all operational trunks and their active native VLAN mappings.
Switch-A# show interfaces trunk
Port Mode Encapsulation Status Native vlan
Gi0/1 on 802.1q trunking 999
Port Vlans allowed on trunk
Gi0/1 1-4094
Port Vlans allowed and active in management domain
Gi0/1 10,20,30,999
Port Vlans in spanning tree forwarding state and not pruned
Gi0/1 10,20,30,999
Verification Template 2: show interfaces <interface_id> switchport
This command inspects administrative and operational parameters for a specific interface.
Switch-A# show interfaces GigabitEthernet0/1 switchport
Name: Gi0/1
Switchport: Enabled
Administrative Mode: trunk
Operational Mode: trunk
Administrative Trunking Encapsulation: dot1q
Operational Trunking Encapsulation: dot1q
Negotiation of Trunking: Off
Access Mode VLAN: 1 (default)
Trunking Native Mode VLAN: 999 (NATIVE_DUMMY_VLAN)
Administrative Native VLAN tagging: disabled
Voice VLAN: none
Administrative private-vlan host-association: none
Trunking VLANs Enabled: ALL
Pruning VLANs Enabled: 2-1001
Capture Mode Disabled
Capture VLANs Allowed: ALL
Once the trunk interface reports the expected native VLAN ID under both operational and administrative headers, the baseline configuration is complete.
Enforcing 802.1Q Tagging on Native VLAN Traffic
Modifying the native VLAN away from VLAN 1 mitigates basic reconnaissance, but untagged transit frames remain an inherent risk across trunks. To close this attack surface entirely, configure Cisco switches to explicitly tag native VLAN traffic with an 802.1Q header.
Step 1: Verify System Support
Native VLAN tagging is supported across Cisco IOS, IOS-XE, and NX-OS architectures. Check global switch readiness by entering global configuration mode.
Step 2: Enable Global Native 802.1Q Tagging
Execute the global command to force all 802.1Q trunk ports on the switch to apply an 802.1Q header to native VLAN frames:
Switch-A(config)# vlan dot1q tag native
Step 3: Configure Per-Interface Tagging (Platform-Dependent)
On modern Cisco Catalyst 9000-series switches running IOS-XE, you can override or specify native VLAN tagging on individual interfaces rather than globally:
Switch-A(config)# interface GigabitEthernet0/1
Switch-A(config-if)# switchport trunk native vlan tag
Step 4: Verify Native VLAN Tagging Status
Verify that native VLAN tagging is operationally active.
Switch-A# show vlan dot1q tag native
vlan dot1q tag native is enabled
Switch-A# show interfaces GigabitEthernet0/1 switchport | include tagging
Administrative Native VLAN tagging: enabled
Operational Native VLAN tagging: enabled
Operational Caution: When vlan dot1q tag native is activated on one side of a trunk, the connecting switch must also support and enforce native tagging. If one switch sends tagged native frames while the peer expects untagged frames, connectivity disruptions will occur for that specific VLAN.
Diagnosing and Resolving CDP-4-NATIVE_VLAN_MISMATCH Errors
When native VLAN values differ between two connected trunk ports, Cisco switches detect the discrepancy using CDP and Spanning Tree Protocol, generating recurring console warnings.
%CDP-4-NATIVE_VLAN_MISMATCH: Native VLAN mismatch discovered on GigabitEthernet0/1 (999), with Switch-B GigabitEthernet0/1 (1).
%SPANTREE-2-RECV_PVID_ERR: Received BPDU with inconsistent peer vlan id 1 on GigabitEthernet0/1 VLAN999.
%SPANTREE-2-BLOCK_PVID_LOCAL: Blocking GigabitEthernet0/1 on VLAN0999. Inconsistent local vlan.
Follow this sequence to diagnose and resolve these errors:
Step 1: Analyze the Error Message
Parse the syslog output to isolate the affected components:
* Local Interface: GigabitEthernet0/1
* Local Native VLAN: 999
* Remote Device Name: Switch-B
* Remote Interface: GigabitEthernet0/1
* Remote Native VLAN: 1
Step 2: Check STP Inconsistent Port States
Spanning Tree automatically places mismatched VLANs into a Type Inconsistent / Port VLAN ID (PVID) inconsistent state to prevent Layer 2 loops. Confirm this with:
Switch-A# show spanning-tree inconsistentports
Name Interface Inconsistency
-------------------- -------------------- ------------------
VLAN0999 GigabitEthernet0/1 Port Vlan ID Inconsistency
Number of inconsistent ports is 1
While the port remains in this inconsistent state, frames for the conflicting VLANs are dropped.
Step 3: Align Native VLAN Configurations Across the Trunk
Log in to the switch reporting the incorrect native VLAN (in this case, Switch-B) and update the interface configuration:
Switch-B(config)# interface GigabitEthernet0/1
Switch-B(config-if)# switchport trunk native vlan 999
Switch-B(config-if)# end
Step 4: Confirm Resolution
Within 60 seconds (the default CDP transmission interval), the spanning tree state clears automatically, unblocking the link:
%SPANTREE-2-UNBLOCK_CONSIST_PORT: Unblocking GigabitEthernet0/1 on VLAN0999. Port consistency restored.
Re-run verification commands to ensure no inconsistent ports remain:
Switch-A# show spanning-tree inconsistentports
Name Interface Inconsistency
-------------------- -------------------- ------------------
Number of inconsistent ports is 0
Changing the native VLAN on a Cisco switch is an essential hardening step for any Layer 2 network. By moving the native VLAN away from default VLAN 1, assigning it to an unused, unrouted dummy VLAN, keeping both ends of the trunk aligned, and enforcing explicit 802.1Q tagging, you protect your switches from common Layer 2 exploits like VLAN hopping and keep your control plane traffic secure.











Comments