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:
- Console in — physical connection before any network exists
- Enter privileged mode —
enable - Enter global configuration —
configure terminal - Set hostname — identify the device in prompts and logs
- Configure management access — IP, gateway, SSH (security topic covers hardening)
- Configure interfaces — IP addresses on routers; VLANs and access ports on switches
- Verify —
showcommands before assuming anything works - Save —
copy running-config startup-configorwrite memory
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)
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.
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.
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.
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.
interface FastEthernet0/1 duplex full speed 100
A duplex mismatch (one side full, other half) causes poor performance and late collisions. Always check the far end — show interfaces FastEthernet0/1 on both devices.
VLAN creation and access ports
VLANs segment broadcast domains. Each access port belongs to exactly one VLAN.
configure terminal vlan 10 name SALES ! interface GigabitEthernet0/1 switchport mode access switchport access vlan 10 ! end
Verification:
show vlan brief show interfaces switchport show running-config interface GigabitEthernet0/1
| VLAN ID | Common use |
|---|---|
| 1 | Default (avoid for production data when policy requires) |
| 10–99 | User/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.
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):
interface GigabitEthernet0/1 switchport mode trunk switchport trunk allowed vlan 10,20
How it works:
- PC in VLAN 10 (10.10.10.50) sends packet to PC in VLAN 20 (10.10.20.50)
- Switch tags the frame with VLAN 10 on the trunk
- R1 subinterface Fa0/0.10 receives, routes to Fa0/0.20
- R1 sends frame back on trunk tagged VLAN 20
- Switch delivers to VLAN 20 access port
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.
! 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.
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
| Column | Meaning |
|---|---|
| Interface | Physical or virtual interface name |
| IP-Address | Configured IP or unassigned |
| OK? | Yes = valid protocol configuration |
| Method | manual (configured) or unset |
| Status | administratively down vs up |
| Protocol | up = 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.
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 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)
| Memory | Purpose |
|---|---|
| ROM | Bootstrap, initial power-on |
| Flash | IOS image storage |
| NVRAM | Startup-config |
| RAM | Running-config, routing tables, ARP cache |
Troubleshooting configuration — bottom-up
Panagiss maps troubleshooting to layers — apply this after every config change:
- Layer 1 —
show ip interface brief,show interfaces - Layer 2 —
show arp,show mac address-table,show vlan brief - Layer 3 —
show ip route,ping,traceroute - Layer 4 —
telnet/ TCP connection test to specific port
| Symptom | Check |
|---|---|
Interface administratively down | no shutdown |
Interface up/down | Cable, duplex, VLAN, or far-end issue |
| Cannot ping gateway from switch | Missing ip default-gateway or wrong VLAN |
| Inter-VLAN routing fails | Trunk allowed VLANs, subinterface encapsulation, no shutdown on parent interface |
| Config lost after reload | Forgot 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.
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
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 shutdownon 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