CertGrid CertGrid
Hands-on Lab·Linux Foundation Certified System Administrator

Routes, and where a packet goes

Reading a routing table is the skill that separates guessing from diagnosing. This guide shows the table on a real host, then builds a second one inside a network namespace so routes can be added and removed freely, and demonstrates the longest-prefix rule that decides which line wins.

Networking Guide 23 of 38 Intermediate

iproute2, identical on both families. The mutating half runs inside a network namespace so the host's own routing is never at risk.

Every command that changes an address or a route runs inside a network namespace. The host's own interface is read but never modified - the final command of the transcript shows it unchanged.
Server NameIP AddressOSRolesCPURAMHDD
LFCS-A01192.168.0.70Ubuntu 26.04 LTSPrimary host - most guides run only here2 Core4 GB50 GB

This guide includes

Use this because reading a routing table separates diagnosis from guessing. This matters because you can ask the kernel which line it would pick, rather than working it out and hoping.

Before you start

  1. The table this host actually uses

  2. A second table, to experiment in

  3. The rule that picks a line

  4. The same question on the real host

Official sources