Routing is the core engine of internetworking, dictating how packets traverse local segments, wide area connections, and the global internet. Within Cisco IOS and IOS-XE platforms, static routes provide network engineers with absolute, deterministic control over packet forwarding paths. Unlike dynamic routing protocols that calculate paths using complex algorithms and periodic advertisements, a static route is manually defined by an administrator and remains unchanged until modified.
Configuring static routing on Cisco equipment requires a clear understanding of routing logic, next-hop resolution, administrative distance, and egress media types. Whether you are provisioning a stub network connection, directing edge traffic through a gateway of last resort, or engineering backup paths for failover, mastering static route configuration is an essential networking competency.
Table of Contents
Static Routing vs. Dynamic Routing: Key Trade-offs
Before provisioning manual routes across an infrastructure, network architects must evaluate whether static routing or a dynamic routing protocol—such as Open Shortest Path First (OSPF) or Border Gateway Protocol (BGP)—is appropriate for the topology. Static routes provide maximum predictability with zero protocol overhead, but they do not dynamically adapt to link failures without auxiliary tracking configurations.
| Evaluation Metric | Static Routing | OSPF (Interior Gateway) | BGP (Exterior/Core) |
|---|---|---|---|
| Resource Overhead (CPU/RAM) | Negligible; no algorithm or update packet processing | Moderate; maintains link-state database (LSDB) and runs Dijkstra SPF | High; stores extensive path attributes and global routing tables |
| Configuration Complexity | Simple for small, predictable networks; prone to human error at scale | Moderate; requires area planning, router IDs, and metric tuning | High; requires autonomous system numbers (ASNs), peering policies, and attribute manipulation |
| Convergence Speed | None natively; relies on physical link state or IP SLA tracking | Fast; sub-second to low-second re-convergence upon topology change | Tunable; designed for policy control and internet-scale stability over rapid convergence |
| Scalability & Topology Size | Extremely low; impractical for networks with more than a few routers | High; scales well within enterprises using hierarchical multi-area designs | Very high; scales to hundreds of thousands of autonomous routes |
| Path Selection Basis | Manually dictated by administrator configuration | Shortest path based on link bandwidth cost | Best path calculated via complex path vector attributes (AS_PATH, Local Pref, MED) |
| Automatic Failover | No native route recalculation; requires floating routes or IP SLA | Fully automated dynamic path recalculation | Fully automated route withdrawal and alternative AS path selection |
| Primary Use Cases | Stub networks, default gateways, out-of-band management, floating backups | Enterprise campus networks, internal data center fabrics | Service provider backbones, multi-homed internet edges, data center interconnects |
Section Takeaway: Static routing excels in simple, deterministic topologies such as stub connections and out-of-band management networks, whereas dynamic protocols are necessary when topology changes demand automated failover and scalable path discovery.
Cisco IP Route Command Syntax and Step-by-Step Configuration
To configure a static route in Cisco IOS or IOS-XE, administrators use the ip route command in global configuration mode for IPv4, or ipv6 route for IPv6. Understanding how the router resolves the destination parameter dictates whether you should specify a next-hop IP, an exit interface, or both.
Route Forwarding Types
- Next-Hop Static Route: Specifies only the next-hop IP address. The router performs a recursive lookup in the routing table to verify which local interface can reach that next-hop IP. This is the standard best practice on multi-access broadcast networks such as Ethernet.
- Directly Attached Static Route: Specifies only the local exit interface. The router assumes that the destination network is directly attached to this interface and initiates Address Resolution Protocol (ARP) requests for every unique destination IP traversing the link. On broadcast Ethernet interfaces, this can flood the network and exhaust router memory through ARP table bloat; it should only be used on point-to-point links (e.g., serial or GRE tunnels).
- Fully Specified Static Route: Specifies both the local exit interface and the next-hop IP. This eliminates recursive routing lookups while preventing excessive ARP generation on broadcast networks.
Step-by-Step Configuration Procedure
Follow these sequential steps to configure a static route on a Cisco router or Layer 3 switch:
Enter Privileged EXEC and Global Configuration Mode:
Access the privileged command hierarchy and open the running configuration for editing.
text
Router> enable
Router# configure terminalVerify IP Routing State (Layer 3 Switches):
If configuring a multi-layer switch (such as a Cisco Catalyst 3850, 9200, or 9300), ensure that routing is globally activated. On dedicated routers, this is enabled by default.
text
Router(config)# ip routing
Router(config)# ipv6 unicast-routingConfigure the Static Route:
Apply theip routecommand by specifying the target destination network, subnet mask, and next-hop parameter.- IPv4 Next-Hop Configuration:
text
Router(config)# ip route 192.168.20.0 255.255.255.0 10.1.1.2 - IPv4 Fully Specified Configuration (Recommended for Ethernet):
text
Router(config)# ip route 192.168.20.0 255.255.255.0 GigabitEthernet0/0/1 10.1.1.2 name TO-BRANCH-OFFICE IPv6 Static Route Configuration:
text
Router(config)# ipv6 route 2001:db8:acad:2::/64 2001:db8:acad:1::2Commit the Configuration:
Exit global configuration mode and write the running configuration changes to the non-volatile random-access memory (NVRAM).
text
Router(config)# end
Router# copy running-config startup-config
Section Takeaway: Always supply a next-hop IP address rather than an egress interface alone on Ethernet segments to avoid recursive lookup overhead and ARP table exhaustion.
Configuring a Default Static Route (Gateway of Last Resort)
A default static route acts as a catch-all mechanism. When a router looks up a destination address that does not match any specific entry in its Routing Information Base (RIB), it forwards the packet to the gateway specified by the default route. In Cisco networking, this entry establishes the “Gateway of Last Resort.”
A default route uses an all-zeros address and mask (0.0.0.0 0.0.0.0 for IPv4, and ::/0 for IPv6), representing the shortest possible prefix length (prefix /0), making it the route of last choice under longest-prefix-match rules.
Step-by-Step Implementation
Identify the Egress Parameters:
Determine the IP address assigned to the upstream provider router or the local WAN edge interface connecting to the Internet Service Provider (ISP).Apply the IPv4 Default Route:
Enter global configuration mode and define the default quad-zero route targeting the upstream gateway:
text
Router# configure terminal
Router(config)# ip route 0.0.0.0 0.0.0.0 203.0.113.1Apply the IPv6 Default Route:
Define the IPv6 counterpart using the unspecified prefix notation:
text
Router(config)# ipv6 route ::/0 2001:db8:feed:1::1Confirm Gateway Establishment:
Validate that the route has taken effect and that the system has recognized the gateway:
text
Router(config)# end
Router# show ip route | include Gateway
Gateway of last resort is 203.0.113.1 to network 0.0.0.0
Section Takeaway: A default route provides an edge router with an egress path for all unmapped outbound internet traffic by leveraging a /0 wildcard prefix match.
Implementing Floating Static Routes for Redundancy
A floating static route serves as a backup path that installs into the routing table only when the primary path fails. This mechanism relies on Administrative Distance (AD), which Cisco IOS uses to rate the trustworthiness of routing information from 0 (most trusted) to 255 (untrusted/inactive).
By default, a standard static route has an Administrative Distance of 1, making it more preferred than dynamic routing protocols such as OSPF (AD 110) or internal BGP (AD 200). To create a floating static route, you assign the static route an AD higher than that of the primary route covering the same destination prefix.
Step-by-Step Floating Route Deployment
- Identify the Primary Route AD:
Determine the administrative distance of your primary forwarding mechanism: - Primary Static Route: AD =
1 - Primary OSPF Route: AD =
110 Primary EIGRP Route: AD =
90Configure the Primary and Secondary Routes:
Configure the primary path normally, and assign an explicit administrative distance value to the backup static route.- Example 1: Backing up a primary static route (AD 1):
text
Router(config)# ip route 172.16.0.0 255.255.0.0 10.1.1.1 name PRIMARY-FIBER
Router(config)# ip route 172.16.0.0 255.255.0.0 10.2.2.1 10 name BACKUP-LTE Example 2: Backing up an OSPF routing protocol (AD 110):
text
Router(config)# ip route 10.50.0.0 255.255.0.0 198.51.100.2 115 name BACKUP-TO-OSPFVerify Route Inactivity in the Routing Table:
Runshow ip routewhile the primary link is healthy. The backup route will not appear in the active routing table because the lower-AD primary route takes precedence.Test Failover Behavior:
Simulate an outage by administratively shutting down the primary interface:
text
Router(config)# interface GigabitEthernet0/0/1
Router(config-if)# shutdown
Router(config-if)# end
Router# show ip route 172.16.0.0
The router immediately installs the secondary route with metric/AD10into the active routing table. When the primary interface is brought back up (no shutdown), the router reinstalls the primary route and floats the backup out of the active forwarding table.
Section Takeaway: Floating static routes provide deterministic link redundancy by assigning a higher administrative distance than the primary route, automatically installing only when the preferred path becomes unreachable.
Verifying and Troubleshooting Missing Static Routes
A common administrative issue occurs when a static route is successfully entered into configuration mode but does not appear in show ip route. Cisco IOS validates specific operational conditions before it admits a static route into the active Routing Information Base (RIB) and Forwarding Information Base (FIB).
Diagnostic Progression Flow
Follow these troubleshooting checks sequentially when an expected static route is missing:
Verify Interface Line Protocol Status:
If a static route specifies an exit interface or depends on an interface to reach the next-hop address, that interface must be in theup/upoperational state.
text
Router# show ip interface brief
Action: If the interface isadministratively down, executeno shutdownwithin the interface configuration. If it isdown/down, verify physical cabling, transceivers, and carrier handoffs.Validate Next-Hop Reachability:
If using a next-hop IP address, the router must have an existing route to that IP. If recursive resolution fails, the static route is withheld from the table.
text
Router# show ip route <next-hop-ip>
Action: Ensure the next hop resides within a directly connected subnet or can be resolved through another valid routing entry.Inspect the Active Routing Table for Specific Routes:
Confirm whether the static route is installed, and inspect its associated administrative distance and metric:
text
Router# show ip route static
To drill down into a specific subnet:
text
Router# show ip route 192.168.20.0
Output Analysis: Look for the[1/0]prefix tag. The first number indicates the Administrative Distance (1), and the second indicates the route metric (0).Verify Layer 3 Routing Activation:
On multi-layer Catalyst switches, commands may save without errors even when IP routing is disabled globally.
text
Router# show running-config | include ip routing
Action: If empty, enter configuration mode and enable routing usingip routing.Identify Prefix and Subnet Mask Typos:
Compare the running configuration against your network diagram to ensure the network address matches the mask (e.g., using192.168.1.1 255.255.255.0instead of192.168.1.0 255.255.255.0will produce an error or misdirect traffic).
text
Router# show run | section ip route
Section Takeaway: A static route only enters the active routing table if its exit interface is in an up/up state and its next-hop IP can be recursively resolved.
Cisco Static Route Configuration Templates and CLI Cheat Sheet
Use the following syntax templates and production-ready snippets for direct deployment across Cisco IOS and IOS-XE command-line environments.
! ===================================================================
! CISCO IOS / IOS-XE STATIC ROUTING CLI CHEAT SHEET & CONFIG TEMPLATES
! ===================================================================
! --- Basic IPv4 Static Route (Next-Hop) ---
configure terminal
ip route <destination_network> <subnet_mask> <next_hop_ip>
exit
! --- Basic IPv6 Static Route (Next-Hop) ---
configure terminal
ipv6 unicast-routing
ipv6 route <destination_prefix>/<prefix_length> <next_hop_ipv6>
exit
! --- Default Route (Gateway of Last Resort) ---
configure terminal
ip route 0.0.0.0 0.0.0.0 <next_hop_ip_or_exit_interface>
ipv6 route ::/0 <next_hop_ipv6_or_exit_interface>
exit
! --- Point-to-Point Direct Interface Route ---
! (Use ONLY on Serial, GRE, or P2P interfaces; NOT on Ethernet)
configure terminal
ip route <destination_network> <subnet_mask> <interface_type><interface_number>
exit
! --- Fully Specified Static Route (Best Practice for Ethernet) ---
configure terminal
ip route 192.168.50.0 255.255.255.0 GigabitEthernet0/0/0 10.10.10.2 name CORPORATE-LAN
exit
! --- Floating Static Route (Backup with Custom Administrative Distance) ---
configure terminal
ip route <destination_network> <subnet_mask> <backup_next_hop_ip> <administrative_distance>
! Example (AD = 200, floating behind OSPF):
ip route 10.0.0.0 255.0.0.0 192.168.100.1 200 name BACKUP-PATH
exit
! --- Permanent Static Route (Retains entry in RIB even if link goes down) ---
configure terminal
ip route <destination_network> <subnet_mask> <next_hop_ip> permanent
exit
! --- IP SLA Tracked Static Route Template (Automated Next-Hop Health Checking) ---
configure terminal
ip sla 1
icmp-echo <target_ip_to_ping> source-interface <local_exit_interface>
frequency 5
ip sla schedule 1 life forever start-time now
!
track 10 ip sla 1 reachability
!
! Primary route tied to IP SLA track object:
ip route 0.0.0.0 0.0.0.0 <primary_isp_gateway> track 10
! Floating backup route installed automatically if track 10 fails:
ip route 0.0.0.0 0.0.0.0 <secondary_isp_gateway> 250
exit
! --- Route Deletion / Removal Syntax ---
configure terminal
no ip route <destination_network> <subnet_mask> <next_hop_ip>
no ipv6 route <destination_prefix>/<prefix_length> <next_hop_ipv6>
exit
! --- Essential Verification Commands ---
show ip route
show ip route static
show ip route <destination_network>
show ipv6 route static
show ip interface brief
Section Takeaway: Standardized templates reduce deployment errors; always pair complex backup static routes with IP SLA tracking when physical link state alone cannot detect upstream forwarding failures.
Official Cisco IOS Static Routing Reference and Technical Standards
Cisco’s authoritative architecture standards for protocol-independent routing govern how the Cisco IOS and IOS-XE kernels evaluate, install, and enforce static routing logic.
Command Reference: ip route
ip route prefix mask {ip-address | interface-type interface-number [ip-address]} [distance] [name name] [permanent] [tag tag] [track number]
Parameter Breakdown
prefix: The destination IP network or host address (in standard IPv4 dotted-decimal format).mask: The network subnet mask specifying the bit length of the network segment.ip-address: The IP address of the next-hop router that receives and forwards packets toward the destination network.interface-type interface-number: The local outbound network interface (e.g.,GigabitEthernet0/0/1). When used without anip-addresson multi-access links, the route becomes an interface-direct route relying on proxy ARP.distance(Optional): An integer from1to255defining the Administrative Distance. Overrides the default static route value of1.name name(Optional): An alphanumeric identifier string (up to 32 characters) used to document route intent in configuration displays.permanent(Optional): An installation override parameter ensuring that the static route remains in the routing table even if the outbound interface transitions to a down state.tag tag(Optional): A 32-bit numeric value applied to the route entry, commonly used by route-maps to filter or match static routes during redistribution into dynamic protocols like OSPF or BGP.track number(Optional): Associates the route with an active Cisco Object Tracker state. The route is withdrawn from the RIB if the tracking object reports an invalid or unreachable condition.
Official Operational Standards
- Longest Prefix Match (LPM) Rule: Static routes are evaluated based on bit specificity. A
/28route will always take forwarding precedence over a/24route for packets addressed to overlapping hosts, regardless of the configured administrative distance. - Recursive Next-Hop Lookup Limit: Cisco IOS enforces a recursive limit (typically up to 3 lookups) to prevent infinite routing loops when traversing nested static next-hop definitions.
- Documentation Reference: For official protocol-independent routing guides and platform-specific limits, consult the Cisco IOS IP Routing: Protocol-Independent Configuration Guide and the Cisco IOS Master Command List available via Cisco Technical Documentation.
Section Takeaway: Cisco IOS static route behavior is defined by strict architectural standards: administrative distance controls table installation, but longest prefix match always governs packet forwarding.
Conclusion
Adding a static route to a Cisco router or switch is a straightforward yet critical configuration task. Whether provisioning standard next-hop routes, establishing a gateway of last resort, or engineering floating static routes for automated failover, operational success depends on specifying the correct parameters. By choosing next-hop IP addresses over exit interfaces on multi-access segments, understanding administrative distance, and verifying interface line states, you ensure reliable, deterministic forwarding throughout your network architecture.











Comments