Default, network, host and floating static routes in IPv4 and IPv6
Task
Join two sites with two links, a primary and a backup, and route them with all four kinds of static route from lesson 14: a default route, a network route, a host route and a floating static route, in IPv4 and in IPv6. Along the way you meet the lesson's faults on purpose: the %Inconsistent address and mask error, a missing return route that lets the router ping but not the PC, and a backup that must stay out of the table until the primary fails. At the end you can fail the primary link, watch the floating routes take over, and show that traffic still flows.
Topology
Devices
| Device | Model | Role |
|---|---|---|
| R1 | ISR4331 | branch router |
| R2 | ISR4331 | upstream router |
| PC1 | PC-PT | branch PC |
| PC2 | PC-PT | server-side PC |
Links
| From | To |
|---|---|
| PC1 Fa0 | R1 G0/0/0 |
| R1 G0/0/1 | R2 G0/0/1 |
| R1 G0/0/2 | R2 G0/0/2 |
| PC2 Fa0 | R2 G0/0/0 |
Addressing
| Device | Interface | Address | Default gateway |
|---|---|---|---|
| R1 | G0/0/0 | 10.1.1.1/24 and 2001:db8:1:1::1/64 | none |
| R1 | G0/0/1 (primary) | 10.0.12.1/30 and 2001:db8:0:12::1/64 | none |
| R1 | G0/0/2 (backup) | 10.0.21.1/30 and fe80::1 (link-local) | none |
| R2 | G0/0/0 | 10.2.2.1/24 and 2001:db8:2:2::1/64 | none |
| R2 | G0/0/1 (primary) | 10.0.12.2/30 and 2001:db8:0:12::2/64 | none |
| R2 | G0/0/2 (backup) | 10.0.21.2/30 and fe80::2 (link-local) | none |
| R2 | Loopback0 | 203.0.113.1/24 and 2001:db8:f::1/64 | none |
| PC1 | NIC | 10.1.1.10/24 | 10.1.1.1 |
| PC1 | NIC (IPv6) | 2001:db8:1:1::10/64 | 2001:db8:1:1::1 |
| PC2 | NIC | 10.2.2.10/24 | 10.2.2.1 |
| PC2 | NIC (IPv6) | 2001:db8:2:2::10/64 | 2001:db8:2:2::1 |
Steps
- Drag each device from the Topology onto the workspace and set its display name (click the device, Config tab, Display Name) to the name in the Devices table. Cable the ports the Links table lists: Packet Tracer's automatic connection type picks the right cable, or use a copper cross-over between two routers or between a router and a PC or server. If a router asks whether to enter the initial configuration dialog, answer
no. - Address R1.
ipv6 unicast-routingcomes first, or R1 will not forward IPv6 at all. The backup link carries only link-local IPv6 addresses, which is the case where a route must name the exit interface:
Router> enable
Router# configure terminal
Router(config)# hostname R1
R1(config)# ipv6 unicast-routing
R1(config)# interface g0/0/0
R1(config-if)# ip address 10.1.1.1 255.255.255.0
R1(config-if)# ipv6 address 2001:db8:1:1::1/64
R1(config-if)# no shutdown
R1(config-if)# interface g0/0/1
R1(config-if)# ip address 10.0.12.1 255.255.255.252
R1(config-if)# ipv6 address 2001:db8:0:12::1/64
R1(config-if)# no shutdown
R1(config-if)# interface g0/0/2
R1(config-if)# ip address 10.0.21.1 255.255.255.252
R1(config-if)# ipv6 address fe80::1 link-local
R1(config-if)# no shutdown
R1(config-if)# end
- Address R2 the same way, with its loopback:
Router> enable
Router# configure terminal
Router(config)# hostname R2
R2(config)# ipv6 unicast-routing
R2(config)# interface g0/0/0
R2(config-if)# ip address 10.2.2.1 255.255.255.0
R2(config-if)# ipv6 address 2001:db8:2:2::1/64
R2(config-if)# no shutdown
R2(config-if)# interface g0/0/1
R2(config-if)# ip address 10.0.12.2 255.255.255.252
R2(config-if)# ipv6 address 2001:db8:0:12::2/64
R2(config-if)# no shutdown
R2(config-if)# interface g0/0/2
R2(config-if)# ip address 10.0.21.2 255.255.255.252
R2(config-if)# ipv6 address fe80::2 link-local
R2(config-if)# no shutdown
R2(config-if)# interface loopback0
R2(config-if)# ip address 203.0.113.1 255.255.255.0
R2(config-if)# ipv6 address 2001:db8:f::1/64
R2(config-if)# end
- On PC1 and PC2, open Desktop > IP Configuration and enter the IPv4 address, mask and default gateway from the Addressing table. Under IPv6 Configuration choose Static and enter the IPv6 address, prefix length 64 and the IPv6 gateway.
- Add R1's network route and default route. Type the first line exactly as shown: the mask does not fit the network, and IOS refuses it.
R1# configure terminal
R1(config)# ip route 10.2.2.0 255.255.0.0 10.0.12.2
%Inconsistent address and mask
R1(config)# ip route 10.2.2.0 255.255.255.0 10.0.12.2
R1(config)# ip route 0.0.0.0 0.0.0.0 10.0.12.2
R1(config)# end
R1# show ip route
With mask 255.255.0.0 the network would be 10.2.0.0, so 10.2.2.0 has host bits set. The table now shows Gateway of last resort is 10.0.12.2 to network 0.0.0.0, the S* default and S 10.2.2.0/24 [1/0] via 10.0.12.2. 6. Break and fix: the return route. Test from both R1 and PC1:
R1# ping 10.2.2.10
C:\> ping 10.2.2.10
R1's ping succeeds, because it leaves from 10.0.12.1, a subnet R2 knows as connected. PC1's ping times out: the request reaches PC2, but R2 has no route back to 10.1.1.0/24. Fix it on R2, then test again from PC1, including the internet stand-in:
R2# configure terminal
R2(config)# ip route 10.1.1.0 255.255.255.0 10.0.12.1
R2(config)# end
C:\> ping 10.2.2.10
C:\> ping 203.0.113.1
- Add a host route that sends traffic for PC2 alone over the backup link. Trace before and after:
C:\> tracert 10.2.2.10
R1# configure terminal
R1(config)# ip route 10.2.2.10 255.255.255.255 10.0.21.2
R1(config)# end
C:\> tracert 10.2.2.10
Before, the second hop is 10.0.12.2. After, R1 sends PC2's traffic to 10.0.21.2, which show ip route 10.2.2.10 on R1 confirms (the trace's second hop can still read 10.0.12.2, because R2 replies over the primary link): the /32 is the longest possible match, so it beats the /24 for that one address. Every other address in 10.2.2.0/24 still uses the /24 and the primary link. 8. Add the IPv6 default route on R1 and the IPv6 return route on R2, then test:
R1# configure terminal
R1(config)# ipv6 route ::/0 2001:db8:0:12::2
R1(config)# end
R2# configure terminal
R2(config)# ipv6 route 2001:db8:1:1::/64 2001:db8:0:12::1
R2(config)# end
C:\> ping 2001:db8:2:2::10
C:\> ping 2001:db8:f::1
The default is ::/0. ::/128 would be the unspecified address, one address that matches almost nothing. 9. Add the floating static routes over the backup link, distance 5, in both directions and both protocols. The IPv6 next hops are link-local, so the exit interface comes first:
R1# configure terminal
R1(config)# ip route 0.0.0.0 0.0.0.0 10.0.21.2 5
R1(config)# ipv6 route ::/0 GigabitEthernet0/0/2 FE80::2 5
R1(config)# end
R2# configure terminal
R2(config)# ip route 10.1.1.0 255.255.255.0 10.0.21.1 5
R2(config)# ipv6 route 2001:db8:1:1::/64 GigabitEthernet0/0/2 FE80::1 5
R2(config)# end
R1# show ip route
R1# show running-config | include route
show ip route does not list the backups. That is correct: the table holds only the best route to each prefix, and the primary's distance of 1 beats 5. The running configuration shows they are there, waiting. 10. Fail the primary link and watch the backups float in:
R1# configure terminal
R1(config)# interface g0/0/1
R1(config-if)# shutdown
R1(config-if)# do show ip route
R1(config-if)# do show ipv6 route
C:\> ping 10.2.2.10
C:\> ping 203.0.113.1
C:\> ping 2001:db8:2:2::10
R1 now shows Gateway of last resort is 10.0.21.2 to network 0.0.0.0 and S* 0.0.0.0/0 [5/0] via 10.0.21.2; the IPv6 table shows ::/0 [5/0] via FE80::2 on GigabitEthernet0/0/2. The 10.2.2.0/24 route has gone with its next hop, so 10.2.2.x traffic now follows the backup default. All three pings succeed. 11. Restore the primary link:
R1(config-if)# no shutdown
R1(config-if)# end
Verify
R1# show ip route
R1# show ipv6 route
C:\> ping 2001:db8:2:2::10
Expected output: in show ip route, Gateway of last resort is 10.0.12.2 to network 0.0.0.0, S* 0.0.0.0/0 [1/0] via 10.0.12.2, S 10.2.2.0/24 [1/0] via 10.0.12.2 and S 10.2.2.10/32 [1/0] via 10.0.21.2, with no default via 10.0.21.2. In show ipv6 route, S ::/0 [1/0] with via 2001:DB8:0:12::2. From PC1, Reply from 2001:DB8:2:2::10 lines (the address may print in either case).
Save your work
Save the topology as ccna-lab14-static-routes.pkt (File > Save As).
Notes
A floating route needs a distance above the route it backs up: above 1 to back up a static route, as here, and above 110 to back up an OSPF route. With equal distances the router load-shares instead of waiting. The backup link uses only link-local IPv6 addresses to show why the exit interface must come before an FE80 next hop.
This is an independent study companion for the Cisco CCNA 200-301 v2.0 exam and is not produced by or endorsed by Cisco. Cisco, CCNA and IOS are trademarks of Cisco Systems, Inc.
This is an independent study companion for Cisco CCNA 200-301 and is not produced by or endorsed by CompTIA.