๐ŸŽฏ Lab Objectives

  • Understand how a router makes forwarding decisions
  • Configure static routes using next-hop IP and exit interface
  • Configure a default route (0.0.0.0/0) for internet traffic
  • Use floating static routes as a backup path
  • Verify and troubleshoot routing with show commands and ping
๐Ÿ‘ถ
Static routes are manually configured routes. You tell the router exactly where to send packets. Unlike dynamic routing (OSPF, EIGRP), static routes don't update automatically when the network changes โ€” but they're simple, fast, and use no extra bandwidth.

Step 1 โ€” How Routing Works

# A router looks at the destination IP and finds the BEST match in its routing table
# "Best match" = most specific (longest prefix)

# Routing table example:
C  192.168.1.0/24 is directly connected, Gi0/0
S  10.0.0.0/8    [1/0] via 192.168.2.1
S* 0.0.0.0/0     [1/0] via 203.0.113.1    โ† default route (matches everything)

# Packet to 10.5.6.7:
# Match 10.0.0.0/8 โ†’ send to 192.168.2.1

# Packet to 8.8.8.8 (Google DNS):
# No specific match โ†’ use default route โ†’ send to 203.0.113.1

# Administrative Distance (AD) โ€” lower = more trusted:
# Connected  = 0   (most trusted)
# Static     = 1
# EIGRP      = 90
# OSPF       = 110
# RIP        = 120

Step 2 โ€” Lab Topology

PC1 (192.168.1.10)
  |
[Gi0/0] R1 [Gi0/1] ---10.0.12.0/30--- [Gi0/0] R2 [Gi0/1]
192.168.1.1                                         192.168.2.1
                                                        |
                                                    PC2 (192.168.2.10)

# Goal: PC1 should reach PC2 and vice versa
# R1 needs a route to 192.168.2.0/24
# R2 needs a route to 192.168.1.0/24

Step 3 โ€” Next-Hop Static Route

# Configure interfaces first
! R1
interface GigabitEthernet0/0
 ip address 192.168.1.1 255.255.255.0
 no shutdown
interface GigabitEthernet0/1
 ip address 10.0.12.1 255.255.255.252
 no shutdown

! R2
interface GigabitEthernet0/0
 ip address 10.0.12.2 255.255.255.252
 no shutdown
interface GigabitEthernet0/1
 ip address 192.168.2.1 255.255.255.0
 no shutdown

# Add static routes (next-hop method)
! R1: to reach 192.168.2.0/24, send to R2's IP
ip route 192.168.2.0 255.255.255.0 10.0.12.2

! R2: to reach 192.168.1.0/24, send to R1's IP
ip route 192.168.1.0 255.255.255.0 10.0.12.1

# Syntax: ip route NETWORK MASK NEXT-HOP

Step 4 โ€” Exit-Interface Static Route

# Alternative: specify outgoing interface instead of next-hop IP
ip route 192.168.2.0 255.255.255.0 GigabitEthernet0/1

# Or combine both (recommended on point-to-point links):
ip route 192.168.2.0 255.255.255.0 GigabitEthernet0/1 10.0.12.2

# Next-hop only = best practice on Ethernet (router must ARP)
# Exit-interface only = best practice on point-to-point (Serial links)

Step 5 โ€” Default Route

# Default route = "send all unknown traffic here"
# Used to reach the internet or upstream router
ip route 0.0.0.0 0.0.0.0 203.0.113.1   # ISP gateway

# Show in routing table as S*:
S*  0.0.0.0/0 [1/0] via 203.0.113.1

# Propagate default route to OSPF/EIGRP neighbours
router ospf 1
 default-information originate   # sends default route to OSPF peers

Step 6 โ€” Floating Static Route

# A backup static route that only activates when the primary goes down
# Give it a HIGHER AD than the primary

# Primary route via OSPF (AD 110) โ€” auto-installed
# Backup static route โ€” AD 200 (higher than OSPF, so not used unless OSPF fails)
ip route 192.168.2.0 255.255.255.0 10.0.99.1 200

# The "200" at the end is the Administrative Distance
# When OSPF route disappears, this static route (AD 200) takes over

# Common AD values for floating statics:
# Backup to OSPF (110)  โ†’ use 200
# Backup to EIGRP (90)  โ†’ use 100
# Backup to RIP (120)   โ†’ use 130

Step 7 โ€” Verify & Troubleshoot

# Show routing table
show ip route
show ip route static    # only static routes

# S = static, S* = default route
S    192.168.2.0/24 [1/0] via 10.0.12.2

# Test connectivity
ping 192.168.2.10
ping 192.168.2.10 source 192.168.1.1   # ping FROM a specific interface

# Trace the path
traceroute 192.168.2.10

# Common issues:
# No route โ†’ missing ip route command
# One-way ping โ†’ return route missing on other router
# Correct route present but ping fails โ†’ check interface is "up/up"
show ip interface brief   # verify all interfaces are up

๐Ÿ“‹ Static Routing Cheat Sheet

CommandPurpose
ip route NET MASK NEXT-HOPNext-hop static route
ip route NET MASK EXIT-INTExit-interface static route
ip route 0.0.0.0 0.0.0.0 GATEWAYDefault route
ip route NET MASK NEXT-HOP ADFloating static (backup)
show ip routeFull routing table
show ip route staticOnly static routes
no ip route NET MASK NEXT-HOPRemove a route
โœ…
Lab Complete! Static routing is the starting point for all network learning. Every CCNA exam scenario starts with understanding what's in the routing table and why.
Next: OSPF (Dynamic Routing) โ†’ โ† All Labs
// guided terminal

Try It Live

Type the commands from the steps above. The terminal simulates the expected output for this lab.

KaliRange ~ Terminal type help for commands