Networking Fundamentals · lesson 8 of 17 · 12 min
How routers work A router is a Layer 3 device that forwards packets between different networks based on IP addresses. Where a switch connects devices on the same network, a router connects different networks together. Routing tables A router maintains a routing table — a list of network destinations and the next hop (or outgoing interface) to reach them. When a packet arrives, the router looks up the destination IP in the routing table and forwards it accordingly. The routing table uses longest prefix match — the most specific route wins. A /28 route beats a /24 route for the same destination. Static vs. dynamic routing Static routes: manually configured by an administrator. Simple, predictable, no overhead. Used for small networks or specific paths. Dynamic routing: routers exchange routing information automatically using protocols like OSPF, BGP, or EIGRP. Adapts to network changes. Used in large networks and the internet. BGP (Border Gateway Protocol) is the routing protocol of the internet — it connects autonomous systems (ISPs, large organizations). BGP hijacking is a real attack where an AS announces routes it does not own, redirecting internet traffic.
Routing concepts
Previous lesson: How switches work
Back to Networking Fundamentals
Next lesson: Default gateway and routing tables