All topic guides
FundamentalsAmalgamated guide

Router & Switch Configuration

Initial setup, VLANs on switches, router-on-a-stick, static routes, and verification.

How the sources were combined

Panagiss is diagram-heavy for router-on-a-stick and basic VLAN config. jdepew88 Routing Protocols introduces dynamic routing context after static configuration — merged into one progression from L2 VLANs to L3 routing basics.

Overview

Initial router and switch setup follows a predictable progression: console access, hostname, management IP, VLANs, and static routes before dynamic routing. This guide walks that path with verification commands at each step.

Initial device setup — the standard progression

Whether you are configuring a router or switch, the first session follows the same pattern Jeremy's IT Lab and Panagiss both teach:

  1. Console in — physical connection before any network exists
  2. Enter privileged modeenable
  3. Enter global configurationconfigure terminal
  4. Set hostname — identify the device in prompts and logs
  5. Configure management access — IP, gateway, SSH (security topic covers hardening)
  6. Configure interfaces — IP addresses on routers; VLANs and access ports on switches
  7. Verifyshow commands before assuming anything works
  8. Savecopy running-config startup-config or write memory
Unsaved changes vanish on reload

Everything you configure lives in running-config (RAM) until you copy to startup-config (NVRAM). Lab exams and real outages both punish forgotten saves.

Hostname and basic identity

A descriptive hostname makes logs, CDP neighbors, and SSH sessions readable.

Naming convention example: NY-F1-SW1 (site-floor-role-number)

Hostname and interface description

configure terminal hostname SW1 ! interface FastEthernet0/1 description Link to R1

After setting the hostname, the prompt changes from Switch(config)# to SW1(config)#.

Router interface configuration

Routers need an IP address on every interface facing an IP subnet. Interfaces are administratively down by default on many platforms — you must enable them.

Router — two-subnet setup

configure terminal hostname R1 ! interface FastEthernet0/0 ip address 192.168.0.1 255.255.255.0 no shutdown ! interface FastEthernet0/1 ip address 192.168.1.1 255.255.255.0 no shutdown ! end

Each configured interface generates a connected route in the routing table automatically.

Exam trap

Connected routes appear when the interface is up/up with a valid IP — no static route needed for directly attached subnets. Forgetting no shutdown is the most common lab mistake.

Switch management configuration

A Layer 2 switch forwards based on MAC addresses, but you configure a management IP on an SVI (Switched Virtual Interface) — typically VLAN 1 by default — so you can SSH to the switch from other subnets.

Switch — management IP and default gateway

configure terminal hostname SW1 ! interface vlan 1 ip address 192.168.0.10 255.255.255.0 no shutdown ! ip default-gateway 192.168.0.1 ! end

The ip default-gateway command is required on L2 switches so management traffic to remote subnets reaches the router. Without it, you can only SSH to the switch from the same subnet.

Speed and duplex

Interfaces default to auto negotiation. Best practice on links between infrastructure devices: manually set matching speed and duplex on both sides.

Manual speed and duplex

interface FastEthernet0/1 duplex full speed 100

Verify both ends

A duplex mismatch (one side full, other half) causes poor performance and late collisions. Always check the far endshow interfaces FastEthernet0/1 on both devices.

VLAN creation and access ports

VLANs segment broadcast domains. Each access port belongs to exactly one VLAN.

Create VLAN and assign access port

configure terminal vlan 10 name SALES ! interface GigabitEthernet0/1 switchport mode access switchport access vlan 10 ! end

Verification:

Verify VLANs and port assignment

show vlan brief show interfaces switchport show running-config interface GigabitEthernet0/1

VLAN IDCommon use
1Default (avoid for production data when policy requires)
10–99User/data VLANs
100+Voice, guest, management

Router-on-a-stick — inter-VLAN routing

When a single router connects to a switch via one physical link and routes between multiple VLANs, you use subinterfaces with 802.1Q tags. This is the classic CCNA inter-VLAN routing pattern.

Topology: SW1 trunk port → R1 Fa0/0. VLAN 10 (Sales) and VLAN 20 (Engineering) each get a subinterface.

Router-on-a-stick

configure terminal hostname R1 ! interface FastEthernet0/0 no shutdown ! interface FastEthernet0/0.10 encapsulation dot1Q 10 ip address 10.10.10.1 255.255.255.0 ! interface FastEthernet0/0.20 encapsulation dot1Q 20 ip address 10.10.20.1 255.255.255.0 ! end

Switch side (trunk to router):

Switch trunk to router

interface GigabitEthernet0/1 switchport mode trunk switchport trunk allowed vlan 10,20

How it works:

  1. PC in VLAN 10 (10.10.10.50) sends packet to PC in VLAN 20 (10.10.20.50)
  2. Switch tags the frame with VLAN 10 on the trunk
  3. R1 subinterface Fa0/0.10 receives, routes to Fa0/0.20
  4. R1 sends frame back on trunk tagged VLAN 20
  5. Switch delivers to VLAN 20 access port
Modern alternative

Enterprise networks often use L3 switches with SVIs instead of router-on-a-stick. CCNA still tests subinterfaces because the concept teaches 802.1Q tagging and inter-VLAN routing clearly.

Static routing basics

After interfaces are up, routers in a multi-router topology need routes to remote subnets.

Static route and default route

! Specific network via next-hop ip route 10.0.1.0 255.255.255.0 10.0.0.1

! Default route (gateway of last resort) ip route 0.0.0.0 0.0.0.0 203.0.113.2

Essential verification commands

Build the habit of verifying after every configuration block.

Core show commands

show running-config show startup-config show ip interface brief show interfaces status show ip route show vlan brief show interfaces trunk show mac address-table show cdp neighbors detail show version

Reading show ip interface brief

ColumnMeaning
InterfacePhysical or virtual interface name
IP-AddressConfigured IP or unassigned
OK?Yes = valid protocol configuration
Methodmanual (configured) or unset
Statusadministratively down vs up
Protocolup = line protocol active

An interface showing up/down usually means Layer 1 is fine but Layer 2 failed (cable, mismatch, no neighbor).

CDP and LLDP — mapping connections

CDP (Cisco Discovery Protocol) shares device info at Layer 2 — enabled by default on Cisco gear.

CDP verification

show cdp neighbors show cdp neighbors detail

LLDP (Link Layer Discovery Protocol) is the open-standard equivalent. May need lldp run in global config on some platforms.

Configuration management

Save, erase, and backup

! Save running config to NVRAM copy running-config startup-config write memory

! Factory reset (erases startup-config) write erase reload

! View interface-specific config show running-config interface vlan 1

Cisco device memory (exam awareness)

MemoryPurpose
ROMBootstrap, initial power-on
FlashIOS image storage
NVRAMStartup-config
RAMRunning-config, routing tables, ARP cache

Troubleshooting configuration — bottom-up

Panagiss maps troubleshooting to layers — apply this after every config change:

  1. Layer 1show ip interface brief, show interfaces
  2. Layer 2show arp, show mac address-table, show vlan brief
  3. Layer 3show ip route, ping, traceroute
  4. Layer 4telnet / TCP connection test to specific port
SymptomCheck
Interface administratively downno shutdown
Interface up/downCable, duplex, VLAN, or far-end issue
Cannot ping gateway from switchMissing ip default-gateway or wrong VLAN
Inter-VLAN routing failsTrunk allowed VLANs, subinterface encapsulation, no shutdown on parent interface
Config lost after reloadForgot copy run start

Complete lab walkthrough

Goal: SW1 with VLAN 10 (Sales) and VLAN 20 (Engineering). R1 routes between them via router-on-a-stick.

SW1 — full config

enable configure terminal hostname SW1 ! vlan 10 name SALES vlan 20 name ENGINEERING ! interface GigabitEthernet0/1 switchport mode access switchport access vlan 10 ! interface GigabitEthernet0/2 switchport mode access switchport access vlan 20 ! interface GigabitEthernet0/24 switchport mode trunk switchport trunk allowed vlan 10,20 ! interface vlan 1 ip address 192.168.0.10 255.255.255.0 no shutdown ! ip default-gateway 192.168.0.1 ! end write memory

R1 — router-on-a-stick

enable configure terminal hostname R1 ! interface FastEthernet0/0 no shutdown ! interface FastEthernet0/0.10 encapsulation dot1Q 10 ip address 10.10.10.1 255.255.255.0 ! interface FastEthernet0/0.20 encapsulation dot1Q 20 ip address 10.10.20.1 255.255.255.0 ! end write memory

Verify from a PC in VLAN 10: ping 10.10.20.1 (gateway on other VLAN) should succeed if routing is correct.

Exam checklist

  • Configure hostname, interface IP, and no shutdown on a router
  • Set management IP and default gateway on a switch
  • Create a VLAN and assign an access port
  • Configure router-on-a-stick with dot1Q subinterfaces
  • Configure a switch trunk to a router
  • Run verification commands and interpret show ip interface brief
  • Save configuration with copy running-config startup-config

Related lessons on this site

Continue in this domain

Fundamentals · guide 4 of 4

Sources & further reading

jdepew88 CCNA Notes (markdown)

psaumur CCNA Course Notes

Additional references

This page is an amalgamated study guide synthesized from the markdown sources above, cross-checked against Cisco's official CCNA exam topics. Verify scope before your exam date.