A router connects network-layer domains and forwards IP packets between them. A Linux host can act as a router when forwarding is enabled and its interfaces, routes, neighbor discovery, and filtering policy are configured appropriately.
Routing · Lesson 1
What is a router?
Learn how routers select next hops and forward IP packets between networks.
Routing and Forwarding
Routing builds or selects information about reachable prefixes. Forwarding applies that information to each packet: examine the destination, choose an eligible route and next hop, decrement the hop limit, and transmit through an outgoing interface.
These are separate control-plane and data-plane concerns. A route can exist while firewall policy blocks forwarding, or a forwarding interface can be up while no valid route exists.
What does packet forwarding do?
Routing Tables and Defaults
A route associates a destination prefix with an outgoing interface, next hop, metric, source preference, or other attributes. Longest-prefix matching favors a more-specific eligible route. A default route, IPv4 /0 or IPv6 ::/0, is the least-specific match and is used only when no more-specific route wins.
If no eligible route exists, the router drops the packet and may generate an ICMP unreachable message. A default route is optional and need not point directly to the public Internet.
When is a default route selected?
Local and Routed Traffic
Two hosts on the same on-link subnet normally exchange frames without sending the IP packet through a router. A router becomes involved when route selection chooses it as a next hop or when topology and policy deliberately force routed traversal.
A home “router” commonly combines an IP router, Ethernet switch, Wi-Fi access point, DHCP service, NAT, and firewall. Each function should be diagnosed separately.
Must traffic between two on-link hosts pass through their default router?
Hops and Loop Prevention
A routed hop is a network-layer forwarding step. IPv4 TTL and IPv6 Hop Limit are decremented at each router, bounding loops. Hop count is not a complete distance or quality metric: links differ in bandwidth, latency, loss, policy, and congestion.
What does a smaller hop count fail to guarantee?
Lesson complete
You finished What is a router?
You can now separate a router's route selection from its forwarding action.
Define routers by forwarding between IP networks.
Distinguish control-plane routing from data-plane forwarding.
Treat the default route as the least-specific fallback.
Recognize that hop count alone does not measure path quality.
Keep your learning progress
Create a free account to save this lesson and continue learning on any device.
Create a free account