A static route is a manually configured entry in a router’s routing table that tells the device which next hop or exit interface to use to reach a specific destination network. In routing, it is the opposite of a dynamic route: no protocol learns, advertises or updates it, so it stays exactly as configured until an administrator changes it or its next hop becomes unusable.
Static routes are the simplest form of routing in networking and appear in almost every network, from a home router’s default route toward the provider to data center designs that pin specific prefixes to firewalls. Their strengths are predictability, zero protocol overhead and full control; their weakness is that they do not adapt to topology changes on their own.
How a static route works
A static route consists of a destination prefix, written in CIDR notation, and a forwarding target. When a packet arrives, the router looks up its destination address in the routing table and selects the entry with the longest matching prefix. If that entry is static, the packet goes to the configured next hop or interface.
A typical configuration reads ip route 10.20.0.0 255.255.0.0 192.0.2.1 on one platform or ip route add 10.20.0.0/16 via 192.0.2.1 on a Linux host. Both say the same thing: traffic for 10.20.0.0/16 goes to 192.0.2.1. The route is installed only while the next hop is resolvable through a connected network.
| Element | Meaning | Example |
|---|---|---|
| Destination prefix | Network the route covers | 10.20.0.0/16 |
| Next hop | Neighbor router that receives the packet | 192.0.2.1 |
| Exit interface | Local interface used to send the packet | GigabitEthernet0/1 |
| Administrative distance | Trust compared with other sources | 1 by default on many routers |
| Metric or tag | Optional preference or policy marker | Tag 100 for redistribution filters |
Types of static routes
Several variants serve different purposes. The default static route with prefix 0.0.0.0/0 or ::/0 matches every destination and is used when no more specific route exists, which makes it the most common static route of all.
| Variant | Definition | Typical use |
|---|---|---|
| Default static route | Matches all destinations, 0.0.0.0/0 | Branch or home router toward the provider |
| Network route | Specific prefix to a next hop | Reach a partner network or lab |
| Host route | Single address, /32 or /128 | Steer one server through a firewall |
| Floating static route | Higher administrative distance than the primary | Backup path that activates on failure |
| Null route | Points to a discard interface | Drop unwanted traffic, prevent loops for summaries |
A floating static route is configured with an administrative distance higher than the primary route, for example 200 instead of the OSPF value of 110. It stays out of the routing table while the dynamic route exists and appears automatically when the primary disappears.
Static routes compared with dynamic routing
The choice between static and dynamic routing depends on network size, rate of change and the need for automatic failover. Dynamic protocols such as OSPF and BGP exchange reachability information and recompute paths, while static routes rely on the administrator’s design.
| Aspect | Static route | OSPF | BGP |
|---|---|---|---|
| Configuration effort | Per route, per router | Per interface and area | Per neighbor and policy |
| Reaction to failure | Only if next hop or tracking fails | Seconds or faster | Seconds to minutes |
| Protocol overhead | None | Hello packets and LSAs | TCP sessions and updates |
| Scalability | Few routes and sites | Large enterprise networks | Internet-scale |
| Control over path | Complete and explicit | Metric based | Policy based |
When a static route and a dynamic route cover the same prefix, the router prefers the source with the lower administrative distance. When prefixes differ, the longest match wins first, regardless of distance.
When to use static routes
Static routes work best where the topology is small, stable and has a single obvious path. They are also useful as precise exceptions inside dynamically routed networks.
| Situation | Recommended choice | Reason |
|---|---|---|
| Stub site with one uplink | Default static route | Only one possible exit |
| Two uplinks, primary and backup | Floating static route with tracking | Simple failover without a protocol |
| Dozens of sites with meshed links | Dynamic routing protocol | Manual routes would not scale |
| Connection to a provider without BGP | Static routes on both sides | Provider announces the prefix |
| Summary route advertised upstream | Null route for the summary | Prevents routing loops for unused space |
Pitfalls and troubleshooting
The main risk is a silent black hole: the next hop fails but its interface stays up, so the static route remains installed and traffic disappears. Next-hop tracking with ICMP or BFD probes removes the route when the target stops answering.
- Missing return routes cause one-way traffic; every static route needs a matching path back.
- Recursive routing loops occur when a next hop is reachable only through the static route itself.
- Exit-interface-only routes on Ethernet make the router ARP for every destination, inflating the ARP table.
- Forgotten temporary routes linger for years and override newer designs through longest prefix match.
- Undocumented static routes surprise teams during migrations, so record each with a reason and owner.
In simple terms
Imagine giving a courier a fixed instruction: every parcel for the north district goes to the depot on Hill Street. The courier never checks traffic reports or looks for alternatives. The instruction stays the same until you change it.
A static route is that fixed instruction for a router. An administrator writes it once, and the router follows it for every matching packet. It is simple, predictable and costs nothing to run, but if the depot closes, the courier keeps driving there until someone updates the rule.
A practical example
A retail chain operates 40 small shops, each with a router, a fiber line and a 4G backup. Running a routing protocol at every shop is unnecessary, so each router has a default static route to the fiber provider and a floating default route with administrative distance 250 toward the 4G modem.
An ICMP tracking probe checks a provider address every five seconds. When construction work cuts the fiber at one shop, the probe fails after three attempts, the primary route is withdrawn, and card payments continue over 4G within about 20 seconds. When the fiber returns, the primary route reinstalls itself and traffic moves back without any manual change.