ip route [network] [mask] [next-hop]
Configures a static route in the routing table to forward traffic to a specific destination network via a next-hop IP address or exit interface.
ip route [network] [mask] [next-hop]When to Use This Command
- Connecting a branch office to a central headquarters over a WAN link with a static default route.
- Providing a backup route with a higher administrative distance for floating static routes.
- Directing traffic to a specific server or network segment that is not reachable via dynamic routing.
- Configuring a static route to a stub network that has only one path to the rest of the network.
Command Examples
Basic Static Route to a Remote Network
ip route 192.168.2.0 255.255.255.0 10.0.0.2This command adds a static route to network 192.168.2.0/24 via next-hop 10.0.0.2. No output is displayed if successful; the route is added to the routing table.
Floating Static Route with Higher Administrative Distance
ip route 0.0.0.0 0.0.0.0 10.0.0.3 200This configures a default route via 10.0.0.3 with an administrative distance of 200, making it a backup route. It will only be used if routes with lower AD (e.g., from OSPF) are unavailable.
Understanding the Output
The 'ip route' command does not produce output upon successful configuration. To verify, use 'show ip route' or 'show ip route static'. In 'show ip route', static routes appear with code 'S'. The output shows the destination network, mask, next-hop, administrative distance, and metric. For example: 'S 192.168.2.0/24 [1/0] via 10.0.0.2'. The [1/0] indicates AD=1 and metric=0. A valid route shows the next-hop reachable; if the next-hop is down, the route may not appear or be marked as 'subnetted' but inactive. Watch for routes with high AD that may be overridden by dynamic protocols.
CCNA Exam Tips
Remember that static routes have an administrative distance of 1 by default, which is lower than most dynamic protocols (e.g., OSPF AD=110).
Floating static routes use a higher AD (e.g., 200) to act as backups; they only appear in the routing table when the primary route fails.
The next-hop must be directly connected; otherwise, the route will not be installed (the router must have a route to the next-hop).
You can specify an exit interface instead of a next-hop (e.g., 'ip route 0.0.0.0 0.0.0.0 serial0/0/0') for point-to-point links.
Common Mistakes
Using an incorrect subnet mask (e.g., 255.255.255.0 instead of 255.255.0.0) leading to incomplete routing.
Specifying a next-hop that is not directly connected, causing the route to be rejected or not installed.
Forgetting to add a default route (0.0.0.0 0.0.0.0) for internet-bound traffic, resulting in dropped packets.
Related Commands
ip default-gateway [ip]
Sets the default gateway for a Cisco switch that is not configured with IP routing, allowing it to forward management traffic to remote networks.
show ip route
Displays the current IP routing table on a Cisco router, used to verify routes, check next-hop addresses, and troubleshoot connectivity issues.
Practice for the CCNA 200-301
Test your knowledge with hundreds of CCNA practice questions covering all exam domains.
Practice CCNA Questions