CCNA 200-301

CCNP Enterprise

CCNP Security

CCIE Enterprise Lab

CCIE Security Lab

CCNP Service Provider

CCNP Data Center

CCNP Collaboration

CCIE DC Lab

VLAN (Virtual Local Area Network) segmentation is foundational to enterprise network design, separating broadcast domains, enforcing security boundaries, and directing traffic flow across Layer 2 environments. Whether reallocating workstation ports during office reconfigurations, altering native tags on inter-switch uplinks, or transitioning switch virtual interfaces (SVIs) away from the default management subnet, network administrators regularly need to modify VLAN assignments in Cisco IOS and IOS-XE switches.

Applying VLAN modifications accurately requires an understanding of interface modes, trunk negotiation, and control-plane reachability to avoid unexpected outages or remote access lockouts. The following sections detail step-by-step methods for updating access ports, trunk links, and management interfaces, followed by operational verification steps, ready-to-use CLI templates, and official Cisco Catalyst configuration guidelines.


Reassigning an Access Port to a New VLAN

An access port belongs to exactly one broadcast domain and forwards untagged Ethernet frames to connected end-user devices such as PCs, printers, or servers. When an endpoint moves to a new department or subnet, reassigning its switchport from its current access VLAN to a new one is a straightforward CLI procedure.

Step 1: Access Privileged EXEC and Global Configuration Mode

Log in to your switch via SSH or the console port and elevate your session to privileged EXEC mode:

Switch> enable
Switch# configure terminal
Switch(config)#

Step 2: Ensure the Target VLAN Exists

Before assigning an interface to a VLAN, verify that the VLAN exists in the switch’s local database. While Cisco IOS will dynamically create an unconfigured VLAN when applied to an access port, explicitly creating and naming it maintains configuration hygiene:

Switch(config)# vlan 20
Switch(config-vlan)# name Marketing
Switch(config-vlan)# exit

Step 3: Enter the Target Interface

Navigate to the interface configuration context for the physical port you intend to reassign:

Switch(config)# interface GigabitEthernet1/0/5

Step 4: Reassign the Access VLAN

Explicitly enforce access mode and assign the new VLAN ID. The switchport access vlan command replaces any previously configured access VLAN on that interface immediately:

Switch(config-if)# switchport mode access
Switch(config-if)# switchport access vlan 20
Switch(config-if)# exit

Step 5: Save Configuration Changes

Persist your changes from running memory to NVRAM to ensure the configuration survives a switch reboot:

Switch(config)# end
Switch# copy running-config startup-config

Once the command executes, the port drops any dynamic ARP or MAC entries associated with the old VLAN, flushes its CAM table entry for that port, and begins tagging ingress packets into the new broadcast domain.


Changing VLANs on Multiple Ports Using Interface Range

Reconfiguring ports one by one across high-density access switches is time-consuming and error-prone. Cisco IOS provides the interface range macro command, allowing you to bulk-assign contiguous or non-contiguous blocks of interfaces to a target VLAN in a single operation.

Step 1: Enter Global Configuration Mode

Enter global configuration mode:

Switch# configure terminal
Switch(config)#

Step 2: Define the Interface Range

The interface range command accepts contiguous port spans separated by a hyphen, non-contiguous ports or modules separated by commas, or combinations of both.

  • Contiguous ports on a single module:
    text
    Switch(config)# interface range GigabitEthernet1/0/1 - 12

    (Note: Cisco IOS syntax requires a space before and after the hyphen).

  • Non-contiguous ports or mixed modules:
    text
    Switch(config)# interface range GigabitEthernet1/0/1 - 4, GigabitEthernet1/0/9 - 12, GigabitEthernet2/0/1

Upon entering the command, the prompt changes to Switch(config-if-range)#, indicating that any subsequent configuration will apply uniformly across all specified interfaces.

Step 3: Apply the Access VLAN Bulk Change

Set the administrative mode to access and apply the desired VLAN:

Switch(config-if-range)# switchport mode access
Switch(config-if-range)# switchport access vlan 30
Switch(config-if-range)# exit

Step 4: Persist the Configuration

Exit configuration mode and write the modifications to NVRAM:

Switch(config)# end
Switch# write memory

Using the interface range command minimizes human error during bulk re-addressing projects and ensures identical port security and Layer 2 properties across entire switch modules.


Modifying Native and Allowed VLANs on Trunk Ports

Unlike access ports, trunk links transport traffic for multiple VLANs across switches or between a switch and a router using IEEE 802.1Q encapsulation. Changing VLAN settings on a trunk involves either updating the native VLAN (which carries untagged control and data frames) or restricting the allowed VLAN list traversing the pipe.

Step 1: Enter the Trunk Interface Configuration

Identify your trunk interface (frequently an uplink or high-speed fiber port) and enter interface mode:

Switch# configure terminal
Switch(config)# interface GigabitEthernet1/0/24

Step 2: Modify the Native VLAN

By default, Cisco switches assign VLAN 1 as the 802.1Q native VLAN. For security hardening, network standards recommend changing the native VLAN to an unused, non-default VLAN ID (such as VLAN 99 or 999):

Switch(config-if)# switchport trunk native vlan 99

Caution: The native VLAN must match on both ends of the trunk link. If there is a mismatch, Cisco Discovery Protocol (CDP) will generate %CDP-4-NATIVE_VLAN_MISMATCH syslog errors, and Spanning Tree Protocol (STP) will block the port to prevent Layer 2 forwarding loops. Immediately execute the corresponding native VLAN change on the connected neighboring switch.

Step 3: Adjust the Allowed VLAN List

By default, a trunk permits all active VLANs (1-4094). To enhance security and restrict unnecessary broadcast traffic from crossing uplinks, adjust the allowed list using granular parameters:

  • Safely add a new VLAN to an existing trunk:
    text
    Switch(config-if)# switchport trunk allowed vlan add 40

    (Warning: Do not use switchport trunk allowed vlan 40 without the add keyword, as omitting add overwrites the entire trunk list and restricts the link solely to VLAN 40, severing traffic for all other subnets).

  • Remove a specific VLAN from an active trunk:
    text
    Switch(config-if)# switchport trunk allowed vlan remove 10

  • Reset the trunk to pass all VLANs:
    text
    Switch(config-if)# switchport trunk allowed vlan all

Step 4: Commit Changes

Save the updated trunk parameters:

Switch(config-if)# end
Switch# copy running-config startup-config

Changing the Switch Management VLAN and SVI

A Switch Virtual Interface (SVI) provides Layer 3 IP connectivity to the switch for administrative management protocols such as SSH, SNMP, and Syslog. By default, out-of-the-box Cisco switches assign the management IP address to Interface VLAN 1. Best practices dictate migrating management reachability to an isolated, dedicated management VLAN (e.g., VLAN 100).

Because reconfiguring the management IP disrupts remote connectivity, perform these steps via a direct console connection or stage the commands carefully within a single configuration session.

Step 1: Create the New Management VLAN

Ensure the new management VLAN is provisioned on the switch and permitted across any incoming trunk links:

Switch# configure terminal
Switch(config)# vlan 100
Switch(config-vlan)# name Management_Network
Switch(config-vlan)# exit

Step 2: Deactivate or Reassign the Old SVI

To prevent IP address conflicts and ensure traffic routes over the new subnet, shut down or remove the IP from the existing SVI:

Switch(config)# interface vlan 1
Switch(config-if)# no ip address
Switch(config-if)# shutdown
Switch(config-if)# exit

Step 3: Configure the New SVI

Create the new SVI, assign its static IP address, and bring the interface administratively up:

Switch(config)# interface vlan 100
Switch(config-if)# description In-Band Management
Switch(config-if)# ip address 10.10.100.15 255.255.255.0
Switch(config-if)# no shutdown
Switch(config-if)# exit

Step 4: Update the Default Gateway

For pure Layer 2 switches, point the default gateway to the Layer 3 core switch or firewall router servicing the new management subnet:

Switch(config)# ip default-gateway 10.10.100.1
Switch(config)# end

Step 5: Verify Connectivity and Save

Test reachability by pinging your management gateway, then commit the configuration:

Switch# ping 10.10.100.1
Switch# write memory

Verifying VLAN Assignments and Interface Status

After modifying VLAN configurations, verify that the ports have bound to their expected domains and that operational trunk states reflect your adjustments. Cisco IOS provides dedicated operational show commands for this purpose.

1. Global VLAN and Port Membership: show vlan brief

The show vlan brief command displays all configured VLANs along with every access port assigned to them:

Switch# show vlan brief

VLAN Name                             Status    Ports
---- -------------------------------- --------- -------------------------------
1    default                          active    Gi1/0/13, Gi1/0/14
20   Marketing                        active    Gi1/0/5, Gi1/0/6
30   Engineering                      active    Gi1/0/1, Gi1/0/2, Gi1/0/3, Gi1/0/4
100  Management_Network               active    

Note: Trunk ports do not appear in the show vlan brief output because they do not belong statically to a single access VLAN.

2. Interface Layer 2 Properties: show interfaces switchport

To review the granular administrative and operational status of an individual port, run show interfaces <interface-id> switchport:

Switch# show interfaces GigabitEthernet1/0/5 switchport
Name: Gi1/0/5
Switchport: Enabled
Administrative Mode: static access
Operational Mode: static access
Administrative Trunking Encapsulation: dot1q
Negotiation of Trunking: Off
Access Mode VLAN: 20 (Marketing)
Trunking Native Mode VLAN: 1 (default)
Administrative Native VLAN tagging: enabled
Voice VLAN: none

Verify that Operational Mode matches your intended configuration and that Access Mode VLAN reflects the updated ID.

3. Trunk Link Verification: show interfaces trunk

For uplinks, verify the operational native VLAN and the list of permitted and active forwarding VLANs:

Switch# show interfaces trunk

Port        Mode             Encapsulation  Status        Native vlan
Gi1/0/24    on               802.1q         trunking      99

Port        Vlans allowed on trunk
Gi1/0/24    20,30,40,99,100

Port        Vlans allowed and active in management domain
Gi1/0/24    20,30,40,99,100

Port        Vlans in spanning tree forwarding state and not pruned
Gi1/0/24    20,30,40,99,100

Confirm that your modified native VLAN matches the neighbor switch and that newly added VLANs appear in the Vlans in spanning tree forwarding state output.

4. Port Summary Check: show interfaces status

To quickly verify port-to-VLAN mappings across the entire chassis at a glance:

Switch# show interfaces status
Port      Name               Status       Vlan       Duplex  Speed Type
Gi1/0/1                      connected    30         a-full  a-1000 10/100/1000BaseTX
Gi1/0/5                      connected    20         a-full  a-1000 10/100/1000BaseTX
Gi1/0/24  UPLINK-CORE        connected    trunk      a-full  a-1000 10/100/1000BaseTX

Cisco VLAN CLI Configuration Cheat Sheet

Use these copy-and-paste syntax blocks to streamline day-to-day administrative tasks:

! ==========================================================
! 1. CREATE VLAN
! ==========================================================
configure terminal
vlan <VLAN_ID>
 name <VLAN_NAME>
exit

! ==========================================================
! 2. REASSIGN SINGLE ACCESS PORT
! ==========================================================
interface <INTERFACE_ID>
 switchport mode access
 switchport access vlan <VLAN_ID>
 no shutdown
exit

! ==========================================================
! 3. BULK REASSIGN MULTIPLE ACCESS PORTS
! ==========================================================
interface range <START_INTERFACE> - <END_INTERFACE>
 switchport mode access
 switchport access vlan <VLAN_ID>
exit

! ==========================================================
! 4. TRUNK CONFIGURATION (NATIVE & ALLOWED LIST)
! ==========================================================
interface <TRUNK_INTERFACE_ID>
 switchport mode trunk
 switchport trunk native vlan <NATIVE_VLAN_ID>
 switchport trunk allowed vlan add <VLAN_TO_ADD>
 switchport trunk allowed vlan remove <VLAN_TO_REMOVE>
exit

! ==========================================================
! 5. MIGRATE SVI MANAGEMENT INTERFACE
! ==========================================================
interface vlan <OLD_MANAGEMENT_VLAN>
 no ip address
 shutdown
exit
interface vlan <NEW_MANAGEMENT_VLAN>
 description Management
 ip address <MANAGEMENT_IP> <SUBNET_MASK>
 no shutdown
exit
ip default-gateway <GATEWAY_IP>

! ==========================================================
! 6. SAVE & VERIFY COMMANDS
! ==========================================================
end
write memory
show vlan brief
show interfaces trunk
show interfaces <INTERFACE_ID> switchport

Cisco Catalyst VLAN Architecture and Official Documentation Standards

Cisco Catalyst switches running Cisco IOS or Cisco IOS-XE adhere to IEEE 802.1Q encapsulation standards. The following parameters and operational limits govern VLAN implementation across Catalyst platforms:

1. VLAN ID Ranges and Storage Behavior

Cisco Catalyst platforms divide the IEEE 802.1Q 12-bit VLAN space (4,096 possible IDs) into distinct functional tiers:

  • Reserved System VLANs: VLAN 0 and VLAN 4095 are reserved for system usage and 802.1p frame prioritization. They cannot be created, modified, or deleted.
  • Default VLAN (VLAN 1): Present on all Cisco switches. It is non-deletable and non-prunable. By default, all ports belong to VLAN 1 until reassigned. Control protocols (e.g., CDP, VTP, PAgP, DTP) originate over VLAN 1 regardless of the native VLAN setting unless explicitly encapsulated via global control plane configurations.
  • Normal Range VLANs (VLANs 1–1005): Traditional VLANs used across enterprise networks. VLANs 1002–1005 are reserved for legacy architectures (FDDI, Token Ring) and cannot be deleted. In switches operating in VLAN Trunking Protocol (VTP) versions 1 or 2 (Client/Server mode), normal-range VLAN definitions are stored in flash memory in the vlan.dat file rather than startup-config.
  • Extended Range VLANs (VLANs 1006–4094): Designed for service providers and high-density environments. To use extended range VLANs in VTP v1 or v2, the switch must operate in VTP Transparent mode. Under VTP v3, extended range VLANs can be created in both Server and Transparent modes and are saved directly into the running configuration file.

2. Native VLAN Encapsulation and Tagging

By IEEE 802.1Q specifications, frames belonging to the configured native VLAN cross the trunk without an 802.1Q header (untagged). Cisco IOS provides the global command:

Switch(config)# vlan dot1q tag native

When enabled globally, the switch forces 802.1Q tags on native VLAN frames as well, preventing VLAN-hopping security vulnerabilities and double-tagging attacks.

3. Official Documentation References

For platform-specific caveats, hardware ASIC allocation matrices, and configuration command references, consult the following official Cisco publications:

  • Cisco Catalyst 9000 Series Switches: Layer 2 Configuration Guide — Configuring VLANs (Cisco IOS-XE Documentation Library).
  • Cisco Catalyst 1000/2960-X/3850 Series Switches: Software Configuration Guide, VLAN Configuration Chapter (Cisco IOS Technical Support Reference).
  • Cisco Command Reference: Cisco IOS Interface and Hardware Component Command Reference (Covers full administrative keyword definitions for switchport, vlan, and interface range structures).

Conclusion

Changing VLAN assignments across a Cisco switch environment requires using the appropriate CLI commands for your port type: applying switchport access vlan for single or bulk endpoint moves, maintaining matching native and allowed lists on 802.1Q trunk links, and carefully sequencing IP changes on SVIs to prevent remote management lockouts. Following these procedures and verifying your modifications with show vlan brief and show interfaces trunk ensures consistent broadcast domain segmentation and stable Layer 2 network performance.

Please follow and like us:
Last modified: November 16, 2026

Author

Comments

Write a Reply or Comment

Your email address will not be published.