Hands-On Lab: Changing the Native VLAN and Shutting Down Unused Ports

This hands-on lab covers changing a trunk's native VLAN away from the default VLAN 1 for security purposes, and shutting down unused switch ports as a baseline hardening practice, verifying both changes with appropriate show commands.

Native VLAN ChangeUnused Port SecurityTrunk Hardening

~2 دقیقه مطالعه · آخرین به‌روزرسانی ۳۱ شهریور ۱۴۰۵

Lab Objective

Change the native VLAN on a trunk link from the default VLAN 1 to a dedicated unused VLAN, and administratively shut down all switch ports that currently have no device connected.

Lab Purpose

Leaving the native VLAN at its default value of 1 is a well-known security weakness, since VLAN 1 is a predictable target for certain Layer 2 attacks. Similarly, unused switch ports left enabled and in the default VLAN represent an open door for anyone who can physically access a wiring closet — both are baseline hardening steps expected on any production switch.

Lab Topology

Switch1 ---- Gi1/0/24 (trunk to Switch2)

Switch1 also has unused ports Gi1/0/20
through Gi1/0/23 with no device connected

Dedicated native VLAN to be used: VLAN 999
(created but assigned no access ports,
 existing purely to serve as the native VLAN)

Task 1: Create the Dedicated Native VLAN

Create VLAN 999 named NativeUnused.

Task 2: Change the Trunk's Native VLAN

On Gi1/0/24, change the native VLAN from the default to VLAN 999.

Task 3: Verify the Native VLAN Change

Confirm the trunk now shows VLAN 999 as native rather than VLAN 1.

Task 4: Shut Down Unused Ports

Administratively shut down Gi1/0/20 through Gi1/0/23.

Task 5: Verify the Unused Ports Are Disabled

Confirm each port shows an administratively down status.

Solution and Verification

Switch1(config)# vlan 999
Switch1(config-vlan)# name NativeUnused
Switch1(config-vlan)# exit

Switch1(config)# interface gigabitethernet1/0/24
Switch1(config-if)# switchport trunk native vlan 999

Switch1# show interfaces trunk

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

Switch1(config)# interface range gigabitethernet1/0/20-23
Switch1(config-if-range)# shutdown

Switch1# show interfaces status

Port       Name    Status                Vlan
Gi1/0/20           disabled              1
Gi1/0/21           disabled              1
Gi1/0/22           disabled              1
Gi1/0/23           disabled              1

Key Takeaway

Both ends of a trunk must agree on the native VLAN — changing it on only one side creates a native VLAN mismatch, a condition IOS explicitly warns about via CDP-based detection. Combined with disabling unused ports, these two steps close two of the most commonly exploited Layer 2 weaknesses in an unhardened switch configuration.

نوشته و پژوهش‌شده توسط دکتر شاهین صیامی

مقالات مرتبط

Hands-On Lab: Final Comprehensive CCNP Troubleshooting Challenge (BGP, DMVPN, and QoS Integration)

This hands-on lab presents a complex multi-layer failure across an integrated BGP-over-DMVPN topology combined with QoS marking, requiring systematic diagnosis of a route reflector misconfiguration, an NHRP registration failure, and an incorrectly applied QoS policy simultaneously affecting the same network.

ادامه

Hands-On Lab: Configuring BGP over DMVPN

This hands-on lab runs iBGP as the routing protocol across the same DMVPN hub-and-spoke topology used in the two previous labs, configuring the hub as a route reflector so spokes learn each other's routes without a full iBGP mesh, combining two previously separate concepts into one integrated design.

ادامه

Hands-On Lab: Configuring OSPF over DMVPN

This hands-on lab runs OSPF as the dynamic routing protocol across the same DMVPN hub-and-spoke topology, configuring the tunnel interface as an OSPF point-to-multipoint network type to correctly handle the hub-and-spoke adjacency pattern without requiring the broadcast network type's DR/BDR election.

ادامه

Hands-On Lab: Configuring EIGRP over DMVPN

This hands-on lab runs EIGRP as the dynamic routing protocol across the DMVPN hub-and-spoke topology built in earlier labs, verifying neighbor relationships form correctly across the multipoint tunnel and routes propagate without requiring per-spoke static configuration on the hub.

ادامه

Hands-On Lab: Configuring HSRP MD5 Authentication

This hands-on lab configures MD5 authentication on an HSRP group, verifying two routers with matching authentication strings form a normal active/standby relationship while a router with a mismatched string is excluded from the group entirely.

ادامه

Hands-On Lab: Configuring Cisco Umbrella-Style DNS Security via DNS Forwarding Redirection

This hands-on lab configures a router to redirect all client DNS queries toward a security-focused DNS resolver using DNS forwarding interception, approximating cloud-delivered DNS security enforcement without requiring per-client configuration changes.

ادامه