You open a terminal.
You type a command.
You hit Enter.
Sometimes it works instantly.
Sometimes it hangs.
Sometimes it fails with no clear reason.
That moment — when Linux is “thinking” — is networking in action.
Let’s break down what actually happens when your Linux system talks to the internet, without buzzwords or textbook noise.
When you type:
google.com
Linux doesn’t understand that name.
It immediately asks:
“What is the IP address for this?”
This is DNS.
Linux checks the DNS servers listed in:
/etc/resolv.conf
If DNS fails:
ping 8.8.8.8 might still workThis is why DNS issues feel confusing — the network is up, but name resolution is broken.
Once Linux has the IP address, it needs to decide how to reach it.
That decision is made using the routing table:
ip route
A typical entry looks like:
default via 192.168.1.1 dev eth0
This means:
“If the destination isn’t local, send it to the router.”
If this route is missing or wrong, your system knows where it wants to go — but has no path to get there.
Linux sends data through interfaces, not through “the internet”.
Common ones:
eth0 – Ethernetwlan0 – Wi-Filo – Loopback (self communication)You can check them with:
ip addr
If an interface is down, nothing leaves your system — even if everything else is configured perfectly.
This is why many network fixes start with:
ip link Your system doesn’t talk to the internet — applications do.
Ports are how Linux knows which app should receive data.
Examples:
You can see active ports using:
ss -tulnp
A common mistake:
127.0.0.1That means it works only locally, not from the outside world.
Even if:
Linux still asks:
“Is this traffic allowed?”
This is handled by the firewall:
iptablesnftablesufwFirewalls don’t always say “blocked”.
They often just drop packets quietly.
That’s why networking bugs sometimes feel like ghosts.
Your Linux machine usually has a private IP like:
192.168.1.10
The internet never sees this.
Your router uses NAT (Network Address Translation) to:
This is why:
NAT is invisible — until it breaks.
Linux networking is not one thing.
It’s a pipeline:
If any one step fails, everything fails.
But once you understand this chain, debugging becomes logical — not magical.
Linux networking isn’t about memorizing commands.
It’s about understanding how Linux thinks:
When you understand those questions, you stop guessing — and start fixing problems with confidence.
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.
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.
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).
wl = wireless, rest is hardware naming)“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.”
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.
192.168.1.1 → 192.168.1.254/24 = subnet mask 255.255.255.0“Any device inside
192.168.1.0/24can be reached directly through Wi-Fi without using a router.”
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
Example: packet going to 192.168.1.50
192.168.1.0/24Example: packet going to 8.8.8.8
192.168.1.1Think of it like this: