Understanding ip route Output — Line by Line, Word by Word
When debugging network issues on Linux, one of the most important commands is:
ip route
This command shows the routing table — the rules your system uses to decide where every network packet should go.
Let’s break down the following output in detail:
default via 192.168.1.1 dev wlp0s20f3 proto dhcp src 192.168.1.9 metric 600
192.168.1.0/24 dev wlp0s20f3 proto kernel scope link src 192.168.1.9 metric 600
No assumptions. No skipped words.
What a Routing Table Actually Is
A routing table is a list of instructions that answers one question:
“If a packet needs to go to this destination, which interface, gateway, and source IP should be used?”
Linux checks routes top-down, choosing the most specific match.
Line 1: The Default Route
default via 192.168.1.1 dev wlp0s20f3 proto dhcp src 192.168.1.9 metric 600
This line controls all traffic going outside your local network (internet traffic).
Word-by-word breakdown
- default
- Matches any destination not covered by a more specific route
- Used for internet traffic
- via
- Indicates a gateway is required
- 192.168.1.1
- The gateway IP
- Usually your Wi-Fi router
- dev
- Specifies the network interface
- wlp0s20f3
- Wireless network interface name
- (
wl= wireless, rest is hardware naming)
- proto
- Route origin
- dhcp
- Route was added automatically by DHCP
- Not manually configured
- src
- Source IP address for outgoing packets
- 192.168.1.9
- Your system’s IP address on this network
- metric
- Route priority
- Lower number = higher priority
- 600
- Priority value used when multiple routes exist
Meaning in plain English
“For any destination not in the local network, send traffic through router
192.168.1.1using Wi-Fi interfacewlp0s20f3, with source IP192.168.1.9.”
Line 2: The Local Network Route
192.168.1.0/24 dev wlp0s20f3 proto kernel scope link src 192.168.1.9 metric 600
This route handles local LAN traffic only.
Word-by-word breakdown
- 192.168.1.0/24
- Destination subnet
- Covers
192.168.1.1→192.168.1.254 /24= subnet mask255.255.255.0
- dev
- Network interface used
- wlp0s20f3
- Same Wi-Fi interface
- proto
- Route origin
- kernel
- Automatically added when interface came up
- Not from DHCP or user config
- scope
- Defines how far the route applies
- link
- Destination is directly reachable
- No gateway required
- src
- Source IP for packets in this subnet
- 192.168.1.9
- Your machine’s IP
- metric
- Route priority
- 600
- Same priority as default route
Meaning in plain English
“Any device inside
192.168.1.0/24can be reached directly through Wi-Fi without using a router.”
Why Two Routes Are Needed
Linux needs both:
| Route Type | Purpose |
|---|---|
| Local route | Talk to devices on the same LAN |
| Default route | Reach everything else (internet) |
Without the local route → LAN breaks
Without the default route → Internet breaks
How Linux Chooses Between These Routes
Example: packet going to 192.168.1.50
- Matches
192.168.1.0/24 - Uses local route
- No gateway
Example: packet going to 8.8.8.8
- No specific subnet match
- Falls back to default route
- Uses router
192.168.1.1
Final Mental Model
Think of it like this:
- Local address? → send directly
- Anything else? → send to router
- Interface decides how
- Metric decides priority
- Source IP decides identity