task 3.1 · chapter 3 of 3: other networks · 30 min
Across two routers
objective
Follow a packet from the laptop to web with traceroute, read r1’s and r2’s routing tables, then find and fix a router that’s missing a route, using only what the network tells you.
Your answersin the lab app: Your answers, under the guide. Check task saves them
| Lessons used | 2.1 routers, 2.3 data centers and tracert, 3.3 VLSM |
|---|---|
| Log in | click laptop on the Topology tab (and r1, r2 for the routers) |
| Your answers | under the guide, in the lab app |
| The problem | Break it, next to Check task under the guide, breaks something on purpose |
new to this? step by stepbeginner
- Click laptop on the Topology tab. In the laptop tab:
traceroute -n 192.168.2.10. - Click r1. In the r1 tab:
show ip route. Do the same in an r2 tab. Fill in Your answers, under the guide. - Challenge: click Break it, next to Check task, then find out which router lost a route, and put it back.
- Check task 3.1, under the guide.
more in meet the lab
How a packet finds its way
Asking for directions, one stop at a time
Imagine posting a letter to a town you’ve never been to. Your local post office doesn’t know every street in the country. It only knows letters for that region go to the big sorting office. The sorting office knows which local office to send it to, and that office knows the street. Nobody knows the whole way; each one knows the next stop.
Routers work like that. Each one has a routing table: a list of networks it knows how to reach, and for each one, where to send packets next. That where next is called the next hop.
in one sentence A router doesn’t know the whole path; its routing table says which next hop to send each network to.
How a router fills its routing table
| How | What it means | In this lab |
|---|---|---|
| connected | a network on one of its own ports: it’s right there | r1 knows 192.168.1.0/24 because it has an address on it |
| static | a route someone typed in by hand | r1 was told 192.168.2.0/24: send it to r2 |
| dynamic | routers telling each other what they know, with a routing protocol | not in this lab: it’s a later course |
The networks between r1 and r2
The link between the two routers is 10.0.0.0/30: four addresses, two usable, one for each router. That’s the
/30 from lesson 3.3, the right size for a cable between two routers.
Behind r2, the servers’ block 192.168.2.0/24 is split with VLSM into two /28s, one per server network:
192.168.2.0/28 for web and 192.168.2.48/28 for dns. r1 doesn’t need to know that. One route,
192.168.2.0/24 via r2, covers both, because both fit inside it.
Routes have to work both ways
A ping is two trips: there, and back. web’s answer goes to 192.168.1.50, the laptop, and every router on
the way back needs a route for that network. If one doesn’t have it, the ping goes out fine and the answer
is thrown away. From the laptop it looks just the same as if the packet never arrived.
in one sentence Every router on the way there needs a route to the destination, and every router on the way back needs a route to the source.
traceroute: who’s on the way?
In lesson 2.3 you tried tracert (on Windows) or traceroute (Mac and
Linux) on your own computer. Here’s how it works.
Every packet carries a number called its TTL, time to live. Each router that passes the packet on takes 1 off it, and if it reaches 0, the router throws the packet away and sends a small message back to the sender: time exceeded, from the router’s own address. (That’s what stops a packet going round in circles for ever if the routes are wrong.)
traceroute uses this on purpose. It sends a packet with TTL 1: the first router drops it, and its message
says who it is. Then TTL 2: the second router answers. And so on, until the destination itself answers. One
line per stop.
in one sentence traceroute sends packets that run out of time one router further each time, so each router on the way says who it is.
A path and a routing table
From the laptop:
laptop:~# traceroute -n 192.168.2.10
traceroute to 192.168.2.10 (192.168.2.10), 30 hops max, 60 byte packets
1 192.168.1.1 0.130 ms 0.021 ms 0.026 ms
2 10.0.0.2 0.099 ms 0.040 ms 0.043 ms
3 192.168.2.10 0.075 ms 0.051 ms 0.050 ms
| Line | Who | Why that address |
|---|---|---|
1 192.168.1.1 | r1 | its address on the side the packet came in: the home network |
2 10.0.0.2 | r2 | its address on the link from r1 |
3 192.168.2.10 | web | the destination: done |
Each line has three times because traceroute tries each stop three times. -n means show numbers: don’t
look up names for the addresses.
On r1, show ip route:
r1#show ip route
Codes: C - connected, L - local, S - static, O - OSPF, B - BGP, D - EIGRP
...
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, GigabitEthernet2
L 10.0.0.1/32 is directly connected, GigabitEthernet2
192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C 192.168.1.0/24 is directly connected, GigabitEthernet1
L 192.168.1.1/32 is directly connected, GigabitEthernet1
S 192.168.2.0/24 [1/0] via 10.0.0.2, 00:01:32, GigabitEthernet2
| Letter | Meaning | Example |
|---|---|---|
C | connected: a network on one of r1’s ports | 192.168.1.0/24 on GigabitEthernet1, the home network |
L | local: r1’s own address on that port, as a /32 (one address) | 192.168.1.1/32 |
S | static: typed in | 192.168.2.0/24 via 10.0.0.2: send it to r2 |
Gateway of last resort is not set means r1 has no default route: a packet for a network that isn’t in this
table is thrown away. (Variably subnetted means the table has networks of more than one size in that
block; you can skip those lines.)
Follow the path
Trace the path from the laptop to web, then to dns. Click laptop on the Topology tab. In the laptop tab:
run in the laptop tabtraceroute -n 192.168.2.10 traceroute -n 192.168.2.53Both go through the same two routers. Only the last line differs.
Read r1’s routing table. Click r1 on the Topology tab. In the r1 tab:
run in the r1 tabshow ip routeFind the
Sline. Where does r1 send packets for192.168.2.0/24?Read r2’s. Click r2 on the Topology tab. In the r2 tab:
run in the r2 tabshow ip router2 has the two
/28server networks asClines, the link to r1, and anSline for the way back to the home network,192.168.1.0/24 via 10.0.0.1.Fill in the follow-along answers in Your answers, under the guide:
editYour answersunder the guideWhere r1 sends packets for 192.168.2.0/24: 10.0.0.2 How many hops traceroute counts to web: 3
in one sentence traceroute shows the path from outside; show ip route on each router shows why it goes that way.
Something’s broken
Break the network: click Break it, next to Check task 3.1 under the guide.
It changes one router’s configuration. Don’t go looking for what it changed: find the problem the way you would on a real network, from the laptop first. In the laptop tab:
laptop:~# traceroute -n -m 5 192.168.2.10
(-m 5 means give up after 5 stops, so you don’t wait for 30.) Then:
- work out which router lost a route, and answer Which router was missing a route with
r1orr2in Your answers; - put the route back, on that router;
- click Check task 3.1.
hint
traceroute gets an answer from r1 and then only *: nobody answers. Can the laptop ping r1’s far side,
10.0.0.1? And r2’s near side, 10.0.0.2?
hint
Remember, routes have to work both ways. r2’s answers have to come back to 192.168.1.50. Look at
show ip route on r2: does it know where 192.168.1.0/24 is?
hint
A static route in configuration mode is ip route <network> <mask> <next hop>. The next hop is the router
on the other end of the link.
show the solution
r2 lost its route back to the home network: its show ip route has no S line any more. Packets from the
laptop still reach r2, and even web, but every answer (the ping replies, and r2’s own time exceeded
messages) is for 192.168.1.50, and r2 has no idea where that is. So it throws them away, and the laptop
sees nothing after r1.
Put it back on r2, in the r2 tab:
r2#configure terminal
r2(config)#ip route 192.168.1.0 255.255.255.0 10.0.0.1
r2(config)#end
r2#show ip route
...
S 192.168.1.0/24 [1/0] via 10.0.0.1, 00:00:03, GigabitEthernet1
and in Your answers:
Which router was missing a route: r2
traceroute -n 192.168.2.10 shows all three stops again. This is one of the most common faults there is: a
route on the way there and none on the way back. When the first stop answers and everything after it is
silent, look at the return path.
5 check: run it, then prove it
Check task 3.1 under the guide, in the lab app
when it's right, you'll see
╭─ task 3.1 · across two routers
│ ✓ where r1 sends packets for 192.168.2.0/24 (follow along): 10.0.0.2
│ ✓ how many hops traceroute counts to web (follow along): 3
│ ✓ which router was missing a route (challenge): ...
│ ✓ r2 has a route back to the home network, 192.168.1.0/24 via r1 (challenge)
│ ✓ traceroute from the laptop goes r1, r2, web (challenge): 192.168.1.1 → 10.0.0.2 → 192.168.2.10
╰─ 5/5 checks passed verified