Static routing is the manual way to tell a router exactly where to send traffic for a specific destination network.
Let’s see it in action. Imagine two routers, R1 and R2, connected by a direct link. R1 has a local network of 192.168.1.0/24 and R2 has 192.168.2.0/24. We want R1 to know how to reach 192.168.2.0/24 through R2.
On R1, the command would look like this:
configure terminal
ip route 192.168.2.0 255.255.255.0 10.0.0.2
end
write memory
Here’s the breakdown:
ip route: This is the command to configure a static route.192.168.2.0: This is the destination network address.255.255.255.0: This is the subnet mask for the destination network.10.0.0.2: This is the IP address of the next-hop router. In this case, it’s R2’s interface IP address on the link connecting R1 and R2. If R1 and R2 were connected via interface names instead of IP addresses, you might useip route 192.168.2.0 255.255.255.0 GigabitEthernet0/1.
Now, R1 knows that to send packets to 192.168.2.0/24, it should forward them to 10.0.0.2. For this to work, R2 needs a corresponding route back to R1’s network:
configure terminal
ip route 192.168.1.0 255.255.255.0 10.0.0.1
end
write memory
This tells R2 to send traffic destined for 192.168.1.0/24 to 10.0.0.1, which is R1’s interface IP address on the direct link.
The core problem static routing solves is providing reachability information without the overhead and complexity of dynamic routing protocols like OSPF or BGP. When you have a small, predictable network, or you need absolute control over how traffic flows, static routes are your go-to. You can also use them to override dynamic routing decisions or to direct traffic to a specific gateway for a stub network (a network with only one way in or out).
Internally, each static route is stored in the router’s routing table. When a packet arrives, the router performs a longest prefix match against its routing table to find the best route. If it finds a static route that matches the destination IP address, it uses that route to forward the packet to the specified next-hop IP address or out the specified interface. The router doesn’t "ask" anyone else where to go; it just consults its own pre-programmed list.
The administrative distance (AD) of static routes is 1. This is the lowest AD possible, meaning static routes are always preferred over routes learned via dynamic routing protocols if the same destination network is reachable via both methods. This preference is a key lever you control: if you want to force traffic down a specific path, a static route will always win.
You can also configure a default static route, often called a "gateway of last resort." This is a route for 0.0.0.0 0.0.0.0. If a router cannot find a more specific match in its routing table for a destination IP address, it will use the default route. This is extremely common for edge routers that only need to know how to reach the internet.
configure terminal
ip route 0.0.0.0 0.0.0.0 192.168.100.1
end
write memory
This means "if you don’t know where else to send it, send it to 192.168.100.1." This simplifies configuration significantly for networks that only need to connect to a single upstream provider.
The most surprising thing about static routes is how they interact with summarized routes. If you have a static route for 10.0.0.0/8 and a more specific static route for 10.1.0.0/16, the router will always prefer the 10.1.0.0/16 route because it’s a longer match. This longest prefix match rule is fundamental. However, if you have a static route for 10.0.0.0/8 and a dynamically learned route for 10.1.0.0/16, the static route for 10.0.0.0/8 will still be preferred because its administrative distance (1) is lower than any dynamic routing protocol’s AD. This means static routes can effectively "shadow" or override dynamically learned routes for entire network ranges, even if the dynamic routes are more specific, simply due to their inherent preference.
The next thing you’ll likely want to tackle is managing static routes at scale, which often leads to looking at route redistribution.