Learning Question
How does a subnet become a route a host can use?
An IP subnet is a block of addresses defined by a network prefix and prefix length. When an operating system assigns an address and prefix to an interface, it usually creates a connected route for that prefix. That route tells the host that the prefix is reachable directly through that interface.
Prefixes Define Address Blocks
In this address:
192.168.1.10/24the /24 prefix length says that the first 24 bits are the network prefix. The host can derive this subnet:
192.168.1.0/24Two addresses that look similar may or may not belong to the same subnet. The prefix length decides the boundary.
192.168.1.10/24 and 192.168.1.20/24
-> same 192.168.1.0/24 prefix
10.1.1.10/24 and 10.1.2.20/24
-> different /24 prefixes
10.1.1.10/16 and 10.1.2.20/16
-> same 10.1.0.0/16 prefixConnected Routes
A connected route is a routing-table entry for a prefix that the host treats as directly reachable through one of its own interfaces.
For example:
interface: 192.168.1.10/24
connected route: 192.168.1.0/24 -> use this interface directlyIf the destination IP matches the connected route, the host treats the destination as on-link. It does not send the packet to a gateway first. It tries to find the destination’s link-layer address directly.
On-Link Does Not Mean “Physically Nearby”
On-link means the host treats an address as reachable on the same local link. It is a routing and link-layer claim, not just a physical-distance claim.
The on-link target can be:
- the final destination host, if that destination is local
- a gateway IP, if the final destination is remote but the gateway itself is local
This distinction matters because the host always needs a local link-layer target for the next step. That local target may not be the final destination.
Core Mental Model
The subnet gives the address range. The connected route makes the host treat that range as directly reachable through an interface.
When diagnosing local reachability, ask:
What prefix is configured on the interface?
What connected route exists?
Does the destination match that route?
If yes, can the host resolve a link-layer address for the on-link target?