ip route
Manually injects a static entry into the router's IPv4 routing table (RIB). This tells the router exactly where to send packets destined for a specific remote network, bypassing the need for dynamic routing protocols like OSPF or EIGRP.
Quick Reference
Router(config)#(Static)no ip route [dest] [mask] [next-hop]Syntax & Parameters
| Parameter | Description |
|---|---|
| [network] | The destination network ID (e.g., 192.168.5.0). You cannot point a route to a host IP unless you are creating a /32 host route. |
| [mask] | The explicit dotted-decimal subnet mask of the destination network (e.g., 255.255.255.0). |
| [next-hop / exit] | How to get there. Can be the Next-Hop IP Address of the neighboring router, or the local Exit Interface (e.g., g0/1) to push the packet out of. |
| [AD] (Optional) | Overrides the default Administrative Distance of 1. Used to create backup "floating" static routes. |
CLI Deployment Scenarios
Scenario 1: The Gateway of Last Resort (Default Route)
If a router doesn't know where to send a packet, it drops it. The quad-zero route catches all unknown traffic and blasts it toward your ISP.
Scenario 2: The Floating Static Route
You are running OSPF (Administrative Distance 110) over a fast fiber link. You want to configure a slow cellular backup link that only kicks in if OSPF fails.
CCNA Exam Gotchas
Recursive Routing Failures
If you configure a static route using a Next-Hop IP Address (e.g., 10.1.1.2), the router must do a second lookup to figure out which physical interface is connected to the 10.1.1.0 network. If the interface pointing to 10.1.1.2 goes down, the static route is immediately removed from the routing table because the next-hop is unreachable.
Exit Interface vs. Next-Hop
The CCNA will ask which method is better.
• Point-to-Point Links (Serial): Use the Exit Interface (e.g., ip route 10.0.0.0 255.0.0.0 s0/0/0). It is faster because it skips the recursive lookup.
• Broadcast Links (Ethernet): Use the Next-Hop IP. If you use an Exit Interface on Ethernet, the router will send an ARP request for every single destination IP, completely overwhelming the link and destroying the router's memory.