ch07/l01

Address and route before packets

Check local interface and routing state before blaming services.

ip route 20 min read, 25 min lab operator

`ip addr` shows interface addresses. `ip route` shows where packets should go. Reachability starts with local state and route selection.

In the field

A host cannot reach an internal API. You need to know whether it has an address and a default route.

Worked command

$ ip addr show$ ip route$ ip route get 10.0.0.20$ ping -c 3 10.0.0.20
Anti-pattern

Do not interpret ping failure as proof that the application is down.

Safer pattern

Check address, route, then controlled reachability.

Knowledge check

A ping to the internal API times out. Beforehand, `ip route get 10.0.0.20` returned a route via the default gateway. What has this proven?

  • A The application on the API host is down
  • B The kernel picked a route for that destination; it does not prove the host is reachable
  • C DNS for the API is misconfigured
  • D The local interface has no IP address
Show the answer

Correct: B. The kernel picked a route for that destination; it does not prove the host is reachable

Why

`ip route get` only shows which route the kernel would use to send the packet, not whether anything answers. Calling the application down conflates a routing fact with an end-to-end reachability claim ping never made.

Practice checklist

  1. Run read-only interface and route commands.
  2. Identify the default route.
  3. Explain what ping can and cannot prove.

Deliverable evidence

  • Interface address, default route, and reachability note.
Teaching diagramch07 · mental model
walk the symptom down the ladderaddress + routeip addr / ip routename (DNS)dig +shortsocketss -tulpnHTTP responsecurl -I / -veach step proves ONE layergreen here does not prove green therefirewallfirewall-cmd --list-allaudit before editruntime vs permanentping reaching a host does not prove the application answers

shows: The diagnostic ladder for a reachability symptom: address and route, then DNS name resolution, then listening socket, then HTTP response, with firewall audited separately, and each command proving only its own layer.

does not prove: It does not prove the failure is single-layer: more than one layer can be broken at once, and a green check at one step is evidence for that step only, not proof the whole path works.

Memorize this

Commit these to memory, then drill them until recall is automatic.

ip addrip routeip route getping -c
Recall practice · Meaning -> command

cue You need to see which route and source address the kernel will use to reach 10.0.0.20

show recall target

ip route get 10.0.0.20