Router Configuration
Objective
Configure a Cisco router with interfaces, static routes, and router-on-a-stick for inter-VLAN routing.
Tools & Technologies
Cisco IOSstatic routesinter-VLAN routingrouter-on-a-stick
Key Commands
ip address 192.168.1.1 255.255.255.0ip route 10.0.0.0 255.0.0.0 192.168.1.2interface Gi0/0.10encapsulation dot1Q 10Architecture Overview
graph LR
subgraph Router
G0[Gi0/0\n192.168.1.1/24]
G1[Gi0/1\n10.0.0.1/24]
G0V10[Gi0/0.10\n10.10.0.1/24]
G0V20[Gi0/0.20\n10.20.0.1/24]
end
G0 <--> SW1[Switch/LAN]
G1 <--> SW2[WAN/ISP]
G0V10 -.->|VLAN10| SW1
G0V20 -.->|VLAN20| SW1
style Router fill:#1a1a2e,stroke:#00d4ff
Step-by-Step Process
01
Configure Physical Interfaces
Assign IP addresses to interfaces and bring them up.
Router(config)# interface GigabitEthernet0/0
Router(config-if)# ip address 192.168.1.1 255.255.255.0
Router(config-if)# no shutdown
Router(config-if)# description LAN_INTERFACE
Router# show interfaces GigabitEthernet0/0
Router# show ip interface brief
02
Static Routes
Configure static routes to reach networks beyond directly connected interfaces.
! Route to 10.0.0.0/8 via 192.168.1.2
ip route 10.0.0.0 255.0.0.0 192.168.1.2
! Default route
ip route 0.0.0.0 0.0.0.0 192.168.1.254
show ip route
show ip route static
03
Router-on-a-Stick (Inter-VLAN)
Use subinterfaces on a single trunk link to route between VLANs.
interface Gi0/0.10
encapsulation dot1Q 10
ip address 10.10.0.1 255.255.255.0
description VLAN10_HR
interface Gi0/0.20
encapsulation dot1Q 20
ip address 10.20.0.1 255.255.255.0
description VLAN20_ENG
! Hosts set default gateway to subinterface IP
Challenges & Solutions
- Interface stays down without no shutdown
- Default route (0.0.0.0/0) via unreachable gateway causes black hole
Key Takeaways
- Router-on-a-stick creates a single point of failure — L3 switch is better for production
- show ip route shows routing table with codes: C=connected, S=static, R=RIP