Skip to content

Step-by-Step Switch Configuration Walkthrough

A linear runbook for taking a switch from unknown/dirty state to a clean, working configuration — factory reset through save. Each step links to the page with full background; this page is just the sequence. For command syntax outside this flow, see the Cisco IOS CLI Reference.

Example scenario used throughout: switch SW01, VLAN 10 (Office) on most access ports, VLAN 20 (Guest) on a few, and a trunk uplink to a core switch on Gi0/48.

1. Connect & Factory Reset

Connect via console and start from a known-clean state — skip this step if the switch is already blank or you specifically want to keep the existing config:

enable
erase startup-config
delete vlan.dat
reload

Confirm both prompts (deleting vlan.dat and the reload) when asked. The switch reboots with no saved configuration. See Configuration Management & Recovery for why delete vlan.dat matters — erase startup-config alone leaves old VLANs behind.

2. Set the Hostname

First thing after reload, so every subsequent prompt in your terminal confirms which switch you're on:

enable
conf t
hostname SW01

3. Create VLANs

Define every VLAN you'll need before assigning any ports to them — see VLANs & Inter-VLAN Routing:

vlan 10
 name Office
vlan 20
 name Guest
vlan 999
 name UNUSED

999 is a dedicated blackhole VLAN for unused ports — see Security Hardening.

4. Configure Trunk Ports

Set up the uplink to the core switch/rest of the network, carrying every VLAN that needs to extend beyond this switch:

interface Gi0/48
 switchport mode trunk
 switchport trunk native vlan 999
 switchport trunk allowed vlan 10,20,999
 no shutdown

See VLANs & Inter-VLAN Routing for native VLAN mismatch risks and multi-switch trunk topology.

5. Configure Access Ports

Assign each access port to the VLAN its connected device belongs to:

interface range Gi0/1 - 40
 switchport mode access
 switchport access vlan 10
 no shutdown

interface range Gi0/41 - 47
 switchport mode access
 switchport access vlan 20
 no shutdown

Any port not actively in use should stay shut and parked in the blackhole VLAN instead of being opened here — see Disable Unused Ports:

interface range Gi0/1 - 47
 shutdown
 switchport access vlan 999

Then explicitly no shutdown only the ports you're actually connecting today.

6. Save the Configuration

Nothing above survives a reload until it's written to NVRAM:

copy running-config startup-config

Verify before walking away:

show vlan brief              ! Confirm VLANs exist and ports are assigned correctly
show interfaces status       ! Confirm the ports you enabled are up and in the right VLAN
show run                     ! Spot-check the full running config

Full Sequence (Copy-Paste Reference)

enable
erase startup-config
delete vlan.dat
reload

enable
conf t
hostname SW01

vlan 10
 name Office
vlan 20
 name Guest
vlan 999
 name UNUSED

interface range Gi0/1 - 47
 shutdown
 switchport access vlan 999

interface Gi0/48
 switchport mode trunk
 switchport trunk native vlan 999
 switchport trunk allowed vlan 10,20,999
 no shutdown

interface range Gi0/1 - 40
 switchport mode access
 switchport access vlan 10
 no shutdown

interface range Gi0/41 - 47
 switchport mode access
 switchport access vlan 20
 no shutdown

copy running-config startup-config

Once this baseline is in place, layer on the Security Hardening checklist before putting the switch into production.