Static routing and configuration
This is session 2 on static routing (complex cases). In practical class 11 you configured a chain of three routers; today you work on a four-router network with a backup link: administrative distance and floating routes, summarization, recursive lookup — and, most importantly, you “heal” a broken network that someone else configured, using ping and traceroute.
Lesson goals and plan
By the end of the lesson you will…
- use administrative distance (AD) to determine which of several routes to the same network enters the table
- configure a backup link with a floating static route and explain its limitation
- combine several networks into one summary route and assess its risk
- carry out a recursive lookup (a next hop via another next hop) step by step
- find and fix “no route”, “no return route”, “wrong mask” and “loop” faults with ping, traceroute and show ip route
- simulate a routing loop and two-way delivery in Python
Plan (according to the syllabus)
- Static routing and configuration
Recall practical class 11: the way there and the way back. Today’s rule is added: “Where did the packet stop?” — traceroute tells you. Log in to that router and run show ip route — the answer is usually right there. This is session 2; the basics are in practical class 11.
Because only one path was written on the Andijan router. A backup link through Namangan physically exists, the cable is laid, but the router does not “know” to use it. A static route is a strict instruction: “go only this way”. Today you will learn to tell the router “if the main path is closed, go the backup way” — and also see where this method is weak.
Key terms
Theory reminder
In practical class 11 we saw that the router chooses the longest prefix from the table. But what if routes to the same prefix come from two different sources (or with two different next hops)? Then the router first looks at the administrative distance: the route from the source it trusts more enters the table; the rest wait “in reserve”.
| Source | AD | Note |
|---|---|---|
| Directly connected (C) | 0 | Most trusted |
| Static route (S) | 1 | By default; can be changed at the end of the command |
| EIGRP (internal) | 90 | Dynamic protocols — practical classes 13–14 |
| OSPF | 110 | |
| RIP | 120 | |
| Floating static (typical choice) | 5, 10, 200, 254… | Must be greater than the AD of the main route |
| Unreliable | 255 | Never enters the table |
The router makes the route decision in two stages: (1) when installing into the table — the smallest AD for the same prefix; (2) when forwarding a packet — the longest prefix among the matching entries in the table. AD does not compare prefixes of different lengths: a /24 RIP route is still “more specific” than a /16 static route.
Static routing and configuration
This is the second of the two sessions of the same name in the course syllabus. In practical class 11 (session 1) we studied ip route, the default route and LPM on a chain topology. Today — a multi-router network with a backup link: AD, floating routes, summarization, recursion and troubleshooting. If the ip route syntax is still hard, first practise in the console of practical class 11.
Scenario: the Andijan branch (R1) is connected to a server in the data centre (behind R4, 172.16.0.0/22) through Tashkent (R2) by the main optical link, and through Namangan (R3) by a backup link. The previous administrator configured the network — and left mistakes.
Worked task 1. Backup with a floating route
Condition: traffic from R1 to the data centre normally goes through R2; if the link on the R2 side fails — automatically through R3.
- Main route (AD = 1)
R1(config)# ip route 172.16.0.0 255.255.252.0 10.0.12.2
- Backup route (AD = 200)
R1(config)# ip route 172.16.0.0 255.255.252.0 10.0.13.2 200
Now in
show ip routeonly the first is visible:S 172.16.0.0/22 [1/0] via 10.0.12.2. The second is “under water”. - Back up the return path too!
The same pair on R4:
ip route 192.168.10.0 255.255.255.0 10.0.24.1and… 10.0.34.1 200. R3, on the backup path, must also know both directions. - Test
On R1 enter
interface g0/1→shutdown. As soon as the interface goes down, the main route leaves the table and[200/0] via 10.0.13.2appears.no shutdown— everything returns to the original state. - Understand the limitation
If the break is not R1’s own port but between R2 and R4, R1 does not notice it: its g0/1 interface is “up”, the next hop 10.0.12.2 replies — the packets go to R2 and vanish there. To notice a remote fault the routers must “talk” to each other — that is dynamic routing (practical class 13).
Worked task 2. Summarization
Condition: behind R4 there are 4 server networks: 172.16.0.0/24, 172.16.1.0/24, 172.16.2.0/24, 172.16.3.0/24. Express them with one route on R1.
- Write the third octet in binary
0 =
00000000, 1 =00000001, 2 =00000010, 3 =00000011. - Count the common leading bits
The first two octets (16 bits) are identical, and in the third octet the first 6 bits are identical → 16 + 6 = 22.
- Result
172.16.0.0/22, mask255.255.252.0:ip route 172.16.0.0 255.255.252.0 10.0.12.2— one route instead of 4. - Assess the risk
If there were only 172.16.1.0 and 172.16.2.0, the smallest common block would still be /22, and it would also “swallow” the non-existent 172.16.0.0 and 172.16.3.0. Packets sent to such “extra” addresses take a useless path or create a loop; the protection is
ip route 172.16.0.0 255.255.252.0 Null0on R4.
Worked task 3. A troubleshooting method
- State the problem precisely
Not “it doesn’t work”, but “ping from PC2 to PC1 gives .....”.
- traceroute — where did the packet stop?
The router after the last hop that replied is the suspect. If the same routers repeat in turn — a loop.
- show ip route on the suspect
Is there an entry that matches the address? Is the mask correct? Is the next hop the right neighbour?
- Check the return path separately
Run traceroute in the opposite direction from the router on the destination side. In many cases the reason for a “ping that doesn’t work” is the reply path.
- Fix one thing at a time and test again
Do not make several changes at once — you will not know which one helped.
Lab: healing the broken network
The network in the console has 4 mistakes and the backup path is not configured at all. Ping with the PC buttons below, see the problems, log in to the routers and find the cause with show ip route, show run, traceroute, then fix it. When “Check the task” verifies task 5 it temporarily switches R2 off. You can try this yourself too: on R1 int g0/1 → shutdown.
:ik-terminal: Faulty network: Andijan — Tashkent / Namangan — Data centre
Hint 1 (try it yourself first!)
PC1 → SRV: traceroute stops at R2. On R2, show ip route: with what mask is 172.16.0.0 written? The address of SRV is 172.16.1.10.
Hint 2
PC2 → PC1: traceroute shows R2 → R4 → R3 → R4 → … Where is R2 sending 192.168.10.0? Where is R4 sending it?
Hint 3
The reply SRV → PC3: does R4 know 192.168.30.0? Where does its default route point?
Full solution (for checking)
R2(config)# no ip route 172.16.0.0 255.255.255.0 10.0.24.2 R2(config)# ip route 172.16.0.0 255.255.252.0 10.0.24.2 R2(config)# no ip route 192.168.10.0 255.255.255.0 10.0.24.2 R2(config)# ip route 192.168.10.0 255.255.255.0 10.0.12.1 R4(config)# no ip route 192.168.10.0 255.255.255.0 10.0.34.1 R4(config)# ip route 192.168.10.0 255.255.255.0 10.0.24.1 R4(config)# ip route 192.168.10.0 255.255.255.0 10.0.34.1 200 R4(config)# ip route 192.168.30.0 255.255.255.0 10.0.34.1 R1(config)# ip route 172.16.0.0 255.255.252.0 10.0.13.2 200 R3(config)# ip route 192.168.10.0 255.255.255.0 10.0.13.1
Independent tasks
Easy → hard: 6 tasks. They model the router’s “internal” decisions — AD, summarization, recursion and the loop — in Python. input() without a prompt.
Common mistakes
| Error | Sign | Fix |
|---|---|---|
| The AD of the floating route is less than or equal to the main one | The backup path is always used, or the load is shared equally | Make the AD greater than the main source’s (≥ 2 for static) |
| The backup is configured on one side only | On an outage the request goes through the backup, but the reply returns to a dead path | Back up the return path too (R4 and R3) |
| Wrong mask in summarization | Some hosts work, others do not (like 172.16.1.10) | Recount the common bits in binary |
| Two routers point at each other | Addresses repeat in traceroute, ping ..... (TTL expires) | On each router check that the next hop really points towards the destination |
| The next hop is not directly connected and has no path | The route is not visible in the table | Check the recursion or write the address of the direct neighbour |
| Many changes at once | You do not know which fix worked, and a new mistake may be added | Change one thing at a time, testing every time |
Boss level
Boss level: “Network doctor” — two-way ping
Complete the five tasks in the console (5/5). Then write the router’s “brain” in full: the program reads the routers’ tables and simulates a ping between two hosts — the forward and return paths separately. +80 XP
Input: line 1 — n; the next n lines — «ROUTER PREFIX NEXT» (as in task 4, LOCAL — the network is attached to that router). The last line — «A IP_A B IP_B»: IP_A is the host A behind a router, IP_B is the host B behind a router.
Output: «Borish: …» (the path from A to IP_B, in the format of task 4), «Qaytish: …» (from B to IP_A) and «Ping: muvaffaqiyatli» or «Ping: muvaffaqiyatsiz». If the forward path fails, the return path is not checked: «Qaytish: tekshirilmadi».
Reinforcement
Review questions
What is administrative distance and when is it used?
The level of trust in the source of a route. When there are routes to the same prefix from several sources (or several static ones), the one with the smallest AD enters the table.
How is a floating static route configured and how does it work?
The backup route is written with a larger AD than the main one (… 200). If the main route becomes invalid (the interface goes down, the path to the next hop is lost), the backup enters the table.
How do AD and the longest prefix rule work together?
AD chooses which route enters the table among routes with the same prefix. When a packet is sent, the longest prefix among the matching entries in the table is chosen.
What are the benefit and the risk of summarization?
Benefit — fewer routes, the table and the configuration become simpler. Risk — the summary block can cover non-existent networks too, causing useless traffic or a loop. Protected with a Null0 route.
What is recursive lookup?
If the next hop is not in a directly connected network, the router looks up a path in the table for the next hop again — down to a connected interface.
How does a routing loop appear and how is it detected?
When routers point at each other as the destination (for example, two opposing default routes). It is detected by the addresses repeating in traceroute and the TTL expiring.
List the troubleshooting steps.
State the problem precisely → find the stopping point with traceroute → show ip route on that router → check the return path separately → fix one thing at a time and test again.
Why is static routing not enough for large networks?
The number of entries grows quickly, every change is entered by hand, remote outages are not noticed — dynamic protocols (RIP, OSPF, BGP) solve these.
Independent work
The independent-study topic in the course syllabus: “Fundamentals of routing and static and dynamic routing methods.” (6 hours). The part related to this class — backed-up static routing and fault analysis.
- Draw the topology of your variant and prepare an addressing plan.
- Write the main and floating routes for both directions; summarize wherever possible.
- Model your variant’s “fault” in Packet Tracer (or on paper): write the symptoms (ping/traceroute results) and the fix commands.
- Explain the limitation of the static solution (which outage it does not notice) with a concrete example.
| Criterion | Points |
|---|---|
| Main and backup routes are correct for both directions, the AD is logical | 2 |
| Summarization is correct (mask, analysis of redundant blocks) | 1 |
| The fault symptoms and the fix commands are written clearly | 1 |
| The limitation of the static solution is justified with an example | 1 |
Summary
Your lesson results
Your results are saved in this browser. Read all the sections and complete the exercises and assignments.