Linux Labs

Networking / Stage 2 of 14

How Linux picks a route

Not running Starting usually ~20 s
Leave the lesson

Step 7 of 7 · summary · 2 min

Summary

  • A route is a line of the table: the destination network, the gateway after via and the interface after dev.
  • The kernel adds the route to its own subnet by itself; other networks need lines of their own or default.
  • Of the matching lines, the longest prefix wins; the metric only decides between equal prefixes.
  • ip route get shows the kernel's decision, and ping shows that the exchange worked.
  • At the start of the lesson 198.51.100.20 did not answer: the client knew only its own subnet 192.0.2.0/24 and had no route to that address.
Ubuntu 24.04
Loading…