Computer Networks / Practical class / Practical class 12
Practical class · Computer Networks

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.

:ik-kitob: Practical class 12 ⏱ 2 academic hours (80 minutes) 🚇 Packet simulators ⚡ Let’s heal the broken network
12

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)

  1. 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.

One router in Tashkent went down — why was the whole Andijan branch cut off from the data centre?

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”.

Table 12.1. Main administrative distances (Cisco)
SourceADNote
Directly connected (C)0Most trusted
Static route (S)1By default; can be changed at the end of the command
EIGRP (internal)90Dynamic protocols — practical classes 13–14
OSPF110
RIP120
Floating static (typical choice)5, 10, 200, 254…Must be greater than the AD of the main route
Unreliable255Never enters the table
Order

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

Session 2

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.

R1R2R3R4 AndijanTashkent (main)Namangan (backup)Data centre 10.0.12.0/30 (.1 — .2)10.0.24.0/30 (.1 — .2) 10.0.13.0/30 (.1 — .2)10.0.34.0/30 (.1 — .2) 192.168.10.0/24PC1 .10 192.168.20.0/24PC2 .10 192.168.30.0/24PC3 .10 172.16.0.0/22SRV 172.16.1.10
Fig. 12.1. Red — the main path (R1–R2–R4), blue dashed — the backup path (R1–R3–R4). On R1 g0/1 → R2, g0/2 → R3; on R4 g0/2 → R2, g0/1 → R3.

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.

  1. Main route (AD = 1)
    R1(config)# ip route 172.16.0.0 255.255.252.0 10.0.12.2
  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 route only the first is visible: S 172.16.0.0/22 [1/0] via 10.0.12.2. The second is “under water”.

  3. Back up the return path too!

    The same pair on R4: ip route 192.168.10.0 255.255.255.0 10.0.24.1 and … 10.0.34.1 200. R3, on the backup path, must also know both directions.

  4. 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.2 appears. no shutdown — everything returns to the original state.

  5. 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.

  1. Write the third octet in binary

    0 = 00000000, 1 = 00000001, 2 = 00000010, 3 = 00000011.

  2. 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.

  3. Result

    172.16.0.0/22, mask 255.255.252.0: ip route 172.16.0.0 255.255.252.0 10.0.12.2 — one route instead of 4.

  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 Null0 on R4.

Worked task 3. A troubleshooting method

  1. State the problem precisely

    Not “it doesn’t work”, but “ping from PC2 to PC1 gives .....”.

  2. 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.

  3. 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?

  4. 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.

  5. 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

R1>
Press the “Check the task” button.
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

ErrorSignFix
The AD of the floating route is less than or equal to the main oneThe backup path is always used, or the load is shared equallyMake the AD greater than the main source’s (≥ 2 for static)
The backup is configured on one side onlyOn an outage the request goes through the backup, but the reply returns to a dead pathBack up the return path too (R4 and R3)
Wrong mask in summarizationSome hosts work, others do not (like 172.16.1.10)Recount the common bits in binary
Two routers point at each otherAddresses 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 pathThe route is not visible in the tableCheck the recursion or write the address of the direct neighbour
Many changes at onceYou do not know which fix worked, and a new mistake may be addedChange 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.

  1. Draw the topology of your variant and prepare an addressing plan.
  2. Write the main and floating routes for both directions; summarize wherever possible.
  3. Model your variant’s “fault” in Packet Tracer (or on paper): write the symptoms (ping/traceroute results) and the fix commands.
  4. Explain the limitation of the static solution (which outage it does not notice) with a concrete example.
Assessment criteria (individual assignment)
CriterionPoints
Main and backup routes are correct for both directions, the AD is logical2
Summarization is correct (mask, analysis of redundant blocks)1
The fault symptoms and the fix commands are written clearly1
The limitation of the static solution is justified with an example1

Summary

ADFor the same prefix — the smallest AD enters the table; different prefixes — LPM decides.
Floating routeBackup = a large AD; it is configured on both sides.
LimitationA static route does not notice a remote outage — the need for dynamic protocols.
SummarizationCommon bits → a short prefix; beware of redundant blocks (Null0).
RecursionThe next hop needs a path too — in the end it must reach a connected interface.
LoopRepeating hops and TTL expiry; the cause is routes pointing at each other.
Methodtraceroute → show ip route → return path → fix one thing at a time.
Next stepPractical classes 13–14: the routers “talk” to each other — RIP, OSPF, BGP.

Your lesson results

Your results are saved in this browser. Read all the sections and complete the exercises and assignments.

My personal notes