Compared
Static vs dynamic routing
A static route is typed in by hand and stays until someone changes it. With dynamic routing, routers run a protocol such as RIP, OSPF or BGP: they tell each other which networks they reach and work out new paths when a link fails.
Side by side
| Static routes | Dynamic routing | |
|---|---|---|
| Routes come from | A person, one line per network on every router | Neighbouring routers, through a routing protocol |
| When a link fails | The route stays while its card is up, whether or not anyone answers at the next hop | Routers notice and work out another path |
| As the network grows | Every new network is typed on every router, each way | New networks are announced by the routers themselves |
| Cost | None: no messages between routers | Hello and update messages, and memory for the table or map |
| Trusted first (administrative distance) | Static 1: wins over a learned route to the same network | OSPF 110: lower wins |
| Fits | A small network, a default route, or a backup that waits with a higher distance | Many routers, or more than one path between them |
Each one explained
- Static route
- A route typed in by hand: a prefix and the next hop to send it to.
- Routing table
- The list a device uses to decide where each packet goes next.
- Administrative distance
- How much a router trusts a source of routes, when several offer the same network.
- Floating static route
- A backup static route with a higher administrative distance, used only when the main route is gone.
- RIP
- A distance-vector routing protocol: each router tells its neighbours how many hops away every network is.
- OSPF
- A routing protocol inside one organisation: routers share a map and compute shortest paths.
See the difference on real machines
Each lab is a small network of real Linux machines in your browser.
- Static routes: a backup link that waits, and the failure it can't see
- Routing tables: how a router picks one line out of many
- RIP routing: routers that learn by rumor
- OSPF routing: every router holds the same map
Open Static routes: a backup link that waits, and the failure it can't see