Linux Labs

Networking / Stage 2 of 14

How Linux picks a route

Not running Starting usually ~20 s
Leave the lesson

Step 1 of 7 · on a machine · 5 min

The neighbour answers, the service does not

What you will learn

  • Read the routing table — destination network, gateway and interface.
  • Predict which route the kernel will pick for an address.
  • Add a route to a host or a network and check the path.

The client is now in one subnet with the neighbour 192.0.2.1. A practice service runs on the same neighbour at 198.51.100.20, and it does not answer from the client. Compare the two requests.

Start on the card builds the network, and commands containing lab-client run on the client.

Exercise · look

Two addresses of one neighbour

Send two echo requests each to the neighbour 192.0.2.1 and to the service 198.51.100.20, and compare what ping prints.

First, predict

The neighbour 192.0.2.1 answers. What will ping to 198.51.100.20, the same neighbour's second address, print?

Now start the exercise, run the command and compare your prediction with the output.

Sign in and start The machine is available after signing in
Check yourself 1 question

Why did the client not send a single request to 198.51.100.20?

  • ping runs under sudo, and with the same rights 192.0.2.1 answered.

  • The requests never reached the neighbour: ping printed an error on the client at once, without sending anything.

198.51.100.20 is outside the client's subnet 192.0.2.0/24, and the client's routing table has no line for it.

Ubuntu 24.04
Loading…