LAB: Static Routing
A router only knows the networks that are directly connected to its own interfaces. To reach anything else, it needs a route — and one of the simplest ways to give it that route is to type it in by hand. In this lab you configure two routers with static and default routes so that hosts on two isolated LANs can ping each other across the middle link.
Objective and goal
Two small offices each have one LAN. Office A uses 192.168.1.0/24, office B uses 192.168.2.0/24. The two offices are joined by a small point-to-point link on 10.0.0.0/30. A /30 provides exactly two usable addresses — one for each router, and no wasted host space. The goal: PC-A and PC-B must be able to ping one another.
Configure
Interface IP addresses, bring interfaces up with no shutdown, and add static and default routes.
Verify
Use show ip route to read the table and ping to prove end-to-end connectivity.
Troubleshoot
Work symptom → cause → fix, hop by hop from the source.
This lab uses Cisco IOS commands that work in Packet Tracer, GNS3, EVE-NG, and on real Cisco hardware. Router prompts are shown as R1# and R1(config-if)# — the same prompts you will see on a real console.
Topology and addressing plan
Build this in Packet Tracer (or your simulator) before you type a single route.
PC-A --- S1 --- R1 (g0/0: 192.168.1.1 / LAN A 192.168.1.0/24)
|
(g0/1: 10.0.0.1) -- /30 link -- (g0/1: 10.0.0.2)
|
R2 (g0/0: 192.168.2.1 / LAN B 192.168.2.0/24)
|
S2 --- PC-B
| Device | Interface | IP address | Mask | Default gateway |
|---|---|---|---|---|
| PC-A | NIC | 192.168.1.10 | 255.255.255.0 | 192.168.1.1 |
| R1 | GigabitEthernet 0/0 | 192.168.1.1 | 255.255.255.0 | — |
| R1 | GigabitEthernet 0/1 | 10.0.0.1 | 255.255.255.252 | — |
| R2 | GigabitEthernet 0/1 | 10.0.0.2 | 255.255.255.252 | — |
| R2 | GigabitEthernet 0/0 | 192.168.2.1 | 255.255.255.0 | — |
| PC-B | NIC | 192.168.2.10 | 255.255.255.0 | 192.168.2.1 |
Step 1 — Build the topology
- Add 2 PCs, 2 switches (2960 or similar), and 2 routers (4321 or 2911).
- PC-A → S1 and PC-B → S2: copper straight-through cable.
- S1 → R1 g0/0 and S2 → R2 g0/0: copper straight-through.
- R1 g0/1 → R2 g0/1: this is a router-to-router link. Use a copper cross-over cable, a fibre link, or (if your routers have them) a serial DCE/DTE cable.
clock rate.Tasks: step by step
Work through the twelve steps in order. The stepper below gives you the purpose of each one; the full command listings follow it.
Step 2 — Check the defaults
Out of the box, all IOS interfaces are administratively down (they contain the command shutdown by default), every router has only its defaults, and the PCs have no IP configuration — unless a simulator preloaded one. Confirm that nothing works yet:
! from PC-A, before any configuration
C:\> ping 192.168.2.10
Request timed out.
Request timed out.
Request timed out.
Request timed out.
Ping statistics for 192.168.2.10:
Packets: Sent = 4, Received = 0, Lost = 4 (100% loss),
Expected. The two LANs are physically separate, the routers are unconfigured, and there is no path between them yet. This is the “before” picture you will compare against at the end.
Step 3 — Configure the host PCs
Give each PC a static address, mask, and default gateway. Use the PC’s Desktop → IP Configuration panel in Packet Tracer, or the command line:
! PC-A C:\> ipconfig /ip 192.168.1.10 255.255.255.0 192.168.1.1 ! PC-B C:\> ipconfig /ip 192.168.2.10 255.255.255.0 192.168.2.1
Check PC-A’s settings and test that its default gateway is reachable on the same subnet (the switches forward it on MAC, no routing needed):
C:\> ipconfig
FastEthernet0 Connection:(default port)
Connection-specific DNS Suffix..:
IP Address......................: 192.168.1.10
Subnet Mask.....................: 255.255.255.0
Default Gateway.................: 192.168.1.1
C:\> ping 192.168.1.1
Pinging 192.168.1.1 with 32 bytes of data:
Reply from 192.168.1.1: bytes=32 time=1ms TTL=255
Reply from 192.168.1.1: bytes=32 time=1ms TTL=255
Reply from 192.168.1.1: bytes=32 time=1ms TTL=255
Reply from 192.168.1.1: bytes=32 time=1ms TTL=255
Ping statistics for 192.168.1.1:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
That reply comes from R1 g0/0 — but R1 has no IP address yet, so this ping will not succeed until Step 4. If you test now, it fails: the gateway does not exist yet. Do the equivalent check on PC-B (against 192.168.2.1) after R2 is configured.
Step 4 — Configure R1
Enter privileged exec mode, then global configuration. Set the hostname, then configure both interfaces. Remember: an interface with an IP address is still down until you type no shutdown.
Router> enable Router# configure terminal Router(config)# hostname R1 R1(config)# interface gigabitEthernet 0/0 ! R1 g0/0 faces LAN A (switch S1) R1(config-if)# ip address 192.168.1.1 255.255.255.0 R1(config-if)# no shutdown R1(config-if)# interface gigabitEthernet 0/1 ! R1 g0/1 faces R2 on the /30 link R1(config-if)# ip address 10.0.0.1 255.255.255.252 R1(config-if)# no shutdown R1(config-if)# end R1#
Notice the exact syntax of the interface address: ip address <ip> <mask>. The mask comes after the address, and it is the dotted-decimal subnet mask, not a prefix length. Omit the mask (or typo it to 255.255.255.0 on the /30) and your router will compute the wrong network.
Step 5 — Configure R2
Router> enable Router# configure terminal Router(config)# hostname R2 R2(config)# interface gigabitEthernet 0/0 ! R2 g0/0 faces LAN B (switch S2) R2(config-if)# ip address 192.168.2.1 255.255.255.0 R2(config-if)# no shutdown R2(config-if)# interface gigabitEthernet 0/1 ! R2 g0/1 faces R1 on the /30 link R2(config-if)# ip address 10.0.0.2 255.255.255.252 R2(config-if)# no shutdown R2(config-if)# end R2#
Verify that both interfaces are up/up:
R2# show ip interface brief Interface IP-Address OK? Method Status Protocol GigabitEthernet0/0 192.168.2.1 YES manual up up GigabitEthernet0/1 10.0.0.2 YES manual up up
shutdown; up / down (protocol down) usually means a layer-2 problem such as the wrong cable, no DCE clock, or the far end being down.Step 6 — Test the inter-router link
Each router now knows its directly connected networks: R1 knows 192.168.1.0/24 and 10.0.0.0/30; R2 knows 10.0.0.0/30 and 192.168.2.0/24. Since both directly connect to the 10.0.0.0/30 link, they can ping each other right now — no static routes needed for this hop:
R1# ping 10.0.0.2 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 10.0.0.2, timeout is 2 seconds: !!!!! Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/5 ms
The five exclamation marks mean five successful replies. (A . is a timeout, a U is an ICMP port/host unreachable message.) But now try to reach the far LAN:
R1# ping 192.168.2.10 Type escape sequence to abort. Sending 5, 100-byte ICMP Echos to 192.168.2.10, timeout is 2 seconds: ..... Success rate is 0 percent (0/5)
Step 7 — Add a static route on R1
Teach R1 how to reach LAN B. In global configuration mode, the full command is:
R1(config)# ip route 192.168.2.0 255.255.255.0 10.0.0.2
Break the syntax down:
ip route— the static-routing command.192.168.2.0— the destination network you want to reach (the network ID itself, never a host address).255.255.255.0— the destination mask.10.0.0.2— the next hop: the IP address of the router that is directly connected to that network. R1 sends packets for 192.168.2.0/24 to R2’s g0/1.
ip route 192.168.2.0 255.255.255.0 10.0.0.2. The first two arguments are the far network + far mask, and the next hop is the directly connected neighbour on the path to it. You never write the far host’s address as the network argument — that gives you a route to a single host, not to its subnet.Step 8 — Add a static route on R2
Routing is bidirectional and hop-by-hop. Even with R1’s route installed, replies from PC-B back to PC-A would be dropped at R2, because R2 has no route back to 192.168.1.0/24. Mirror the configuration on R2:
R2(config)# ip route 192.168.1.0 255.255.255.0 10.0.0.1 R2(config)# end
Two rules to remember:
- Each router needs a route to every network beyond its own. R1 needs a route for LAN B; R2 needs a route for LAN A. One direction alone is not enough.
- A route’s next hop must be reachable — an address on a directly connected network. If you point the static route at an unreachable address, the route never becomes usable.
Step 9 — Verify the routing tables
On each router, examine the table. R1:
R1# show ip route
Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route, H - NHRP
Gateway of last resort is not set
10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 10.0.0.0/30 is directly connected, GigabitEthernet0/1
L 10.0.0.1/32 is directly connected, GigabitEthernet0/1
192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.1.0/24 is directly connected, GigabitEthernet0/0
L 192.168.1.1/32 is directly connected, GigabitEthernet0/0
S 192.168.2.0/24 [1/0] via 10.0.0.2
And R2:
R2# show ip route
Gateway of last resort is not set
10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 10.0.0.0/30 is directly connected, GigabitEthernet0/1
L 10.0.0.2/32 is directly connected, GigabitEthernet0/1
192.168.2.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.2.0/24 is directly connected, GigabitEthernet0/0
L 192.168.2.1/32 is directly connected, GigabitEthernet0/0
S 192.168.1.0/24 [1/0] via 10.0.0.1
S 192.168.2.0/24 [1/0] via 10.0.0.2: S = static. [1/0] = administrative distance 1, metric 0 (static routes win over every dynamic protocol, whose default AD is higher). via 10.0.0.2 = the next hop. Conversely a directly connected route is C with AD 0, and L marks the router’s own interface address (a local host route).Step 10 — Ping across the network
Re-test from R1 first, then from the PC that really matters — PC-A:
R1# ping 192.168.2.10
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.2.10, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/5 ms
! now from the PC (the real end-to-end test)
C:\> ping 192.168.2.10
Pinging 192.168.2.10 with 32 bytes of data:
Reply from 192.168.2.10: bytes=32 time=1ms TTL=126
Reply from 192.168.2.10: bytes=32 time=1ms TTL=126
Reply from 192.168.2.10: bytes=32 time=1ms TTL=126
Reply from 192.168.2.10: bytes=32 time=2ms TTL=126
Ping statistics for 192.168.2.10:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Step 11 — Add a default route on R1
Sometimes you do not know (or do not want to list) every destination beyond your neighbour. A default route — written as network 0.0.0.0 mask 0.0.0.0 — is the catch-all: any packet whose destination matches no other route is sent to the next hop you specify. In this topology the echo of “everything else” is R2, so on R1:
R1(config)# ip route 0.0.0.0 0.0.0.0 10.0.0.2 R1(config)# end
Now the top of R1’s routing table changes. The asterisk in S* marks the candidate default route:
R1# show ip route
... (codes table omitted) ...
Gateway of last resort is 10.0.0.2 to network 0.0.0.0
S* 0.0.0.0/0 [1/0] via 10.0.0.2
10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C 10.0.0.0/30 is directly connected, GigabitEthernet0/1
L 10.0.0.1/32 is directly connected, GigabitEthernet0/1
192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.1.0/24 is directly connected, GigabitEthernet0/0
L 192.168.1.1/32 is directly connected, GigabitEthernet0/0
S 192.168.2.0/24 [1/0] via 10.0.0.2
no ip route 0.0.0.0 0.0.0.0 10.0.0.2).Verify: what good looks like
When the lab is complete you should see all of the following. Use the checkboxes as your own pass sheet.
| Check | Command | What you should see |
|---|---|---|
| Interfaces are up | show ip interface brief | up in both the Status and Protocol columns for every configured interface. |
| Connected routes exist | show ip route | A C line for 10.0.0.0/30 and for each LAN, plus an L line for each interface address. |
| Static routes exist | show ip route | S 192.168.2.0/24 [1/0] via 10.0.0.2 on R1, and the mirror image on R2. |
| Inter-router hop works | ping 10.0.0.2 | Five exclamation marks and a 100% success rate. |
| End-to-end works | ping 192.168.2.10 from PC-A | Replies from 192.168.2.10 with TTL 126 (128 minus two router hops). |
| Default route installed | show ip route | “Gateway of last resort is 10.0.0.2” and an S* line for 0.0.0.0/0. |
Troubleshooting guide
When end-to-end connectivity fails, isolate the failure — work hop by hop from the source, always asking “where is the last place that worked?” Start with the PC’s ping to its own default gateway, then to the far router’s interface, then to the far PC.
| Symptom | Probable cause | Fix |
|---|---|---|
| PC-A cannot ping its default gateway 192.168.1.1 | Wrong IP/mask/gateway on the PC, bad cable, or R1 g0/0 is down (not configured / still shutdown). | Run ipconfig and check the settings; ping 192.168.1.10 from R1; on R1 run show ip interface brief and add no shutdown. |
| R1 cannot ping R2 (10.0.0.2) | Interface down, wrong mask on the /30, wrong cable type, or missing DCE clock on a serial link. | show ip interface brief — want up/up; verify both masks are 255.255.255.252; use cross-over/fibre/serial and set clock rate on the DCE. |
| R1 can ping R2, but not PC-B (192.168.2.10) | No route to 192.168.2.0/24 in R1’s table. | show ip route; add ip route 192.168.2.0 255.255.255.0 10.0.0.2 on R1. |
| PC-A can ping R1 but not PC-B | Missing static route on R1, missing return route on R2, or a host firewall blocking ICMP on PC-B. | Verify both routes with show ip route on R1 and R2; check the reply path; temporarily disable the firewall and re-test. |
| “Destination host unreachable” from R1 | R1 has no route at all for the destination network — the packet is dropped locally. | show ip route; add the specific static route or a default route pointing to 10.0.0.2. |
| Interface stuck administratively down | The interface still contains the default shutdown. | Enter the interface and type no shutdown. |
| Link up / down (protocol down) | Layer-2 problem: wrong cable between routers, far end shut, or no clock rate on serial DCE. | Fix the cable (cross-over / fibre / serial), check the far end, add clock rate 128000 on the DCE side. |
| PC-Firewall silence: pings from the router work, pings from the PC time out | PC-B’s firewall drops ICMP echo requests from other subnets. | Verify the PC’s default gateway is correct; allow ICMP or disable the firewall for the test; re-enable it afterwards. |
Key terms
| Term | Meaning |
|---|---|
| Static route | A route entered by hand with ip route <network> <mask> <next-hop>; administrative distance 1. |
| Default route | The catch-all route 0.0.0.0 0.0.0.0 <next-hop> used when no more specific route matches; the gateway of last resort. |
| Next hop | The directly connected neighbour to which a router forwards packets for a given destination. |
| Administrative distance (AD) | The trust value of a route source; lower wins. Connected = 0, static = 1. |
| Longest prefix match | The lookup rule: the most specific matching route (longest mask) is used. |
| no shutdown | The IOS command that brings an interface administratively up and clears “administratively down”. |
| Clock rate | The clocking command placed on the DCE end of a serial link to drive the line. |
Review
Check what you have learned with these review questions.
Sources & references
- Cisco. CCNA (200-301) Exam Topics, Domain 3.0 IP Connectivity (static and default routes). cisco.com.
- Cisco. IP Routing Configuration Guide / IP Routing Command Reference, including the
ip routecommand. cisco.com guides. - Socolofsky, T. & Kale, C. RFC 1180: A TCP/IP Tutorial (1991), routing sections. rfc-editor.org/rfc/rfc1180.
- Rekhter, Y. et al. RFC 1918: Address Allocation for Private Internets (1996). rfc-editor.org/rfc/rfc1918.
Target exams: CCNA 200-301 v1.1 · CyberOps Associate 200-201. Last content verification: 2026-10-11.