3.3 Configure and verify static routes for IPv4 and IPv6
CCNA 200-301 v1.1 · 3.0 IP Connectivity
A static route is a route you type yourself. It never changes on its own, uses no bandwidth, and is ideal for stub sites, default routes to an ISP and backups. For the CCNA you configure default, network, host and floating static routes for IPv4 and IPv6 and verify them in the routing table.
What you must know
- Write a static route with a next hop, an exit interface, or both, for IPv4 and IPv6.
- Configure a default route toward an ISP.
- Configure a host route (/32 or /128).
- Build a floating static route as a backup and prove when it takes over.
- Explain why an IPv6 route to a link-local next hop needs the exit interface.
Default route
A default route matches every destination and is used when nothing more specific does. At a branch it is often the only route you need: everything not local goes to the ISP or to headquarters.
ip route 0.0.0.0 0.0.0.0 203.0.113.1
!
ipv6 unicast-routing
ipv6 route ::/0 2001:db8:a::1Network route
A network route reaches one remote subnet. You can name the next hop, the exit interface, or both:
ip route 10.2.0.0 255.255.0.0 10.0.12.2 ! next hop
ip route 10.2.0.0 255.255.0.0 Serial0/0/0 ! exit interface (point-to-point only)
ip route 10.2.0.0 255.255.0.0 GigabitEthernet0/1 10.0.12.2 ! fully specified
!
ipv6 route 2001:db8:2::/64 2001:db8:12::2
ipv6 route 2001:db8:2::/64 GigabitEthernet0/1 FE80::2 ! link-local next hop needs the interfaceA next-hop route needs a recursive lookup to find the interface. An exit-interface route on Ethernet is risky: the router ARPs for every destination and relies on proxy ARP, so on Ethernet use a next hop or the fully specified form. A static route is only installed while its exit interface is up and its next hop is reachable.
Host route
A host route covers a single address: a /32 in IPv4 or a /128 in IPv6. Use it to send traffic for one server, a loopback or a management station along a different path from the rest of its subnet. Longest prefix match makes it win over any network route.
ip route 10.1.0.50 255.255.255.255 10.0.13.3
ipv6 route 2001:db8:1::50/128 2001:db8:13::3Floating static route
A floating static route is a backup with an administrative distance higher than the route it protects. It stays out of the table while the primary route exists and appears the moment the primary disappears.
ip route 0.0.0.0 0.0.0.0 203.0.113.1 ! primary, AD 1
ip route 0.0.0.0 0.0.0.0 198.51.100.1 5 ! backup, AD 5
!
! backing up an OSPF route (AD 110):
ip route 10.2.0.0 255.255.0.0 10.0.13.3 130Commands
show ip route static | Only the static routes, with their AD and next hop. |
show ip route 0.0.0.0 | The default route in use and its source. |
show running-config | include ip route | Every static route configured, including floating ones that are not in the table. |
show ipv6 route static | The IPv6 static routes. |
ping / traceroute | Prove the path: traceroute shows which next hop is used before and after a failure. |
Exam traps
ipv6 unicast-routingmust be on, or the router does not route IPv6 at all.- A floating route does not appear in
show ip routeuntil the primary is gone. Look in the running config. - IPv6 static routes to a link-local next hop must name the exit interface.
- A next-hop static route is removed when the next hop becomes unreachable; an exit-interface route stays while the interface is up, even if the far end is dead.
- Return traffic needs a route too: a static route on R1 alone does not let R2 answer.
Check yourself
- Write a static route on R1 to 10.2.0.0/16 through 10.0.12.2, as a backup to OSPF.
ip route 10.2.0.0 255.255.0.0 10.0.12.2 130, or any AD above 110.- Why is the floating default route missing from
show ip route? - Its AD (5) is higher than the primary's (1). It is installed only when the primary route is removed.
- Write an IPv6 default route via the link-local address FE80::1 on Gi0/0.
ipv6 route ::/0 GigabitEthernet0/0 FE80::1.- What does a host route look like in IPv4 and in IPv6?
- A /32 (mask 255.255.255.255) and a /128.
Labs
Try it live: Static and floating static routes