Linuxlab

Chapter 3

The Linux network stack

Updated July 3, 2026

An address on an interface is only half the job. The other half is the routing table: the set of rules by which the kernel decides which interface to send a packet to for a given destination. Without a route the packet goes nowhere, even with the address set correctly.

The ip route command shows the current table:

$ ip route
default via 192.168.1.1 dev eth0 proto dhcp metric 100
192.168.1.0/24 dev eth0 proto kernel scope link src 192.168.1.50 metric 100
10.8.0.0/24 dev tun0 proto static

The first line is the default route: anything with no more specific rule leaves through 192.168.1.1. The second is the local network, which the kernel added on its own when you assigned the address. The kernel always picks the longest matching

Locked

The rest of this chapter is part of a paid course

You are reading the open part. Buy the course to read the whole chapter.

See the course