Static route

On this page 7

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.

ElementMeaningExample
Destination prefixNetwork the route covers10.20.0.0/16
Next hopNeighbor router that receives the packet192.0.2.1
Exit interfaceLocal interface used to send the packetGigabitEthernet0/1
Administrative distanceTrust compared with other sources1 by default on many routers
Metric or tagOptional preference or policy markerTag 100 for redistribution filters
Elements of a static route

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.

VariantDefinitionTypical use
Default static routeMatches all destinations, 0.0.0.0/0Branch or home router toward the provider
Network routeSpecific prefix to a next hopReach a partner network or lab
Host routeSingle address, /32 or /128Steer one server through a firewall
Floating static routeHigher administrative distance than the primaryBackup path that activates on failure
Null routePoints to a discard interfaceDrop unwanted traffic, prevent loops for summaries
Static route variants

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.

AspectStatic routeOSPFBGP
Configuration effortPer route, per routerPer interface and areaPer neighbor and policy
Reaction to failureOnly if next hop or tracking failsSeconds or fasterSeconds to minutes
Protocol overheadNoneHello packets and LSAsTCP sessions and updates
ScalabilityFew routes and sitesLarge enterprise networksInternet-scale
Control over pathComplete and explicitMetric basedPolicy based
Static routing compared with dynamic protocols

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.

SituationRecommended choiceReason
Stub site with one uplinkDefault static routeOnly one possible exit
Two uplinks, primary and backupFloating static route with trackingSimple failover without a protocol
Dozens of sites with meshed linksDynamic routing protocolManual routes would not scale
Connection to a provider without BGPStatic routes on both sidesProvider announces the prefix
Summary route advertised upstreamNull route for the summaryPrevents routing loops for unused space
Choosing static routing

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.