This lab will cover the topic 3.8.c Host Route from the Cisco Certified Network Associate (CCNA) blueprint. It will test your understanding and knowledge of configure static host routes on Cisco IOS devices. Please use the initial configurations as a template for your lab utilizing whatever console means you have (GNS, Physical Gear, VIRL, etc).
This lab is a continuation of our Static Network Route lab. We will use the ending topology and results to continue our practice with Static Host Routes. Two additional PC’s have been added. Once to the 10.1.1.0/24 subnet, and the other to the 172.16.2.0/24 subnet. These PC’s are Labled as PC4 (10.1.1.3) and PC5 (172.16.2.3). Our job in this lab is to force traffic from PC4 to PC5 to travel over the R1 -> R4 -> R3 path while traffic to the other PC’s in those subnets continue to travel over the previous path of R1 -> R2 -> R3.
Starting out we will ping our new destination at 172.16.2.3. We notice that the path taken
is as expected and goes from R1 -> R2 -> R3
1 2 3 4 5 6 |
PC4> trace 172.16.2.3 trace to 172.16.2.3, 8 hops max, press Ctrl+C to stop 1 10.1.1.1 0.000 ms 15.600 ms 15.600 ms 2 12.1.2.2 46.801 ms 31.200 ms 46.800 ms 3 23.2.3.3 62.401 ms 46.800 ms 62.400 ms 4 *172.16.2.3 78.001 ms |
If we look at the routing table and CEF table we can confirm that this is indeed taking the right path as far as the routers are concerned.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
R1#show ip route Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static route Gateway of last resort is not set 34.0.0.0/24 is subnetted, 1 subnets S 34.3.4.0 [1/0] via 14.1.4.4 23.0.0.0/24 is subnetted, 1 subnets S 23.2.3.0 [1/0] via 12.1.2.2 172.16.0.0/24 is subnetted, 1 subnets S 172.16.2.0 [1/0] via 12.1.2.2 10.0.0.0/24 is subnetted, 1 subnets C 10.1.1.0 is directly connected, Ethernet1/0 12.0.0.0/24 is subnetted, 1 subnets C 12.1.2.0 is directly connected, Ethernet0/1 14.0.0.0/24 is subnetted, 1 subnets C 14.1.4.0 is directly connected, Ethernet0/0 S 192.168.3.0/24 [1/0] via 12.1.2.2 R1#show ip cef 172.16.2.3 172.16.2.0/24, version 17, epoch 0, cached adjacency 12.1.2.2 0 packets, 0 bytes via 12.1.2.2, 0 dependencies, recursive next hop 12.1.2.2, Ethernet0/1 via 12.1.2.2/32 valid cached adjacency |
Our goal in this lab is to send traffic to our specifc host, in this case 172.16.2.3 in a different direction than our normal traffic in that same subnet. To do this we will enter a static host route into R1’s routing table.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 |
R1(config)#ip route 172.16.2.3 255.255.255.255 14.1.4.4 [crayon-5ae1972310845763440920-57b1ddc1176e6268105473] Now that this route is in place we can verify from R1's point of view that is now has a longer match in the routing table. Using the CEF table we can verify that the destination for 172.16.2.3 is sent out Ethernet 0/0 towards R4. [crayon-5ae197231084a370819836-57b1ddc1176ec562758356] R1#show ip route Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2 i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2 ia - IS-IS inter area, * - candidate default, U - per-user static route o - ODR, P - periodic downloaded static route Gateway of last resort is not set 34.0.0.0/24 is subnetted, 1 subnets S 34.3.4.0 [1/0] via 14.1.4.4 23.0.0.0/24 is subnetted, 1 subnets S 23.2.3.0 [1/0] via 12.1.2.2 172.16.0.0/16 is variably subnetted, 2 subnets, 2 masks S 172.16.2.3/32 [1/0] via 14.1.4.4 S 172.16.2.0/24 [1/0] via 12.1.2.2 10.0.0.0/24 is subnetted, 1 subnets C 10.1.1.0 is directly connected, Ethernet1/0 12.0.0.0/24 is subnetted, 1 subnets C 12.1.2.0 is directly connected, Ethernet0/1 14.0.0.0/24 is subnetted, 1 subnets C 14.1.4.0 is directly connected, Ethernet0/0 S 192.168.3.0/24 [1/0] via 12.1.2.2 R1#show ip cef 172.16.2.3 172.16.2.3/32, version 22, epoch 0 0 packets, 0 bytes via 14.1.4.4, 0 dependencies, recursive next hop 14.1.4.4, Ethernet0/0 via 14.1.4.0/24 valid glean adjacency |
This happens due to the host route being a /32 route vs the normal route for 172.16.2.0/24 being only a 24 bit mask. This only solves our issue on R1 though. We need to continue up the desired path and verify R4’s configuration. Using show ip route with a specific address of 172.16.2.3 we see that the route is not in the table. The CEF output confirms this as well indicating no via 0.0.0.0 and no valid route adjacency.
1 2 3 4 5 6 7 8 9 |
R4#show ip route 172.16.2.3 % Network not in table R4#show ip cef 172.16.2.3 0.0.0.0/0, version 0, epoch 0, attached, default route handler 0 packets, 0 bytes via 0.0.0.0, 0 dependencies valid no route adjacency |
To correct this we will add a static host route on R4 pointing towards the next hop up towards our destination. In this case that is R3.
1 |
R4(config)#ip route 172.16.2.3 255.255.255.255 34.3.4.3 |
We can now verify our previous output by re-issuing the show ip route and show ip cef commands with the speciic 172.16.2.3 address. Note that the route now exists and the CEF table has an appropriate destination.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
R4#show ip route 172.16.2.3 Routing entry for 172.16.2.3/32 Known via "static", distance 1, metric 0 Routing Descriptor Blocks: * 34.3.4.3 Route metric is 0, traffic share count is 1 R4#show ip cef 172.16.2.3 172.16.2.3/32, version 19, epoch 0 0 packets, 0 bytes via 34.3.4.3, 0 dependencies, recursive next hop 34.3.4.3, Ethernet0/1 via 34.3.4.0/24 valid glean adjacency |
If we pause here and think about the return traffic we would want to check to make sure R4 also has a route back to our new source PC. Lets add that route and then verify the routing table.
1 2 3 4 5 6 7 8 |
R4(config)#ip route 10.1.1.3 255.255.255.255 14.1.4.1 R4#show ip route 10.1.1.3 Routing entry for 10.1.1.3/32 Known via "static", distance 1, metric 0 Routing Descriptor Blocks: * 14.1.4.1 Route metric is 0, traffic share count is 1 |
Now it’s time to look at R3. If we look at this case the router does have routes for the destination. However, we are matching the /24 subnet and not the specifc host. This is sending traffic our the wrong direction towards R2. We can fix this by adding a host route back towards R3 fo
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
R3#show ip route 10.1.1.3 Routing entry for 10.1.1.0/24 Known via "static", distance 1, metric 0 Routing Descriptor Blocks: * 23.2.3.2 Route metric is 0, traffic share count is 1 R3#show ip cef 10.1.1.3 10.1.1.0/24, version 15, epoch 0, cached adjacency 23.2.3.2 0 packets, 0 bytes via 23.2.3.2, 0 dependencies, recursive next hop 23.2.3.2, Ethernet0/0 via 23.2.3.2/32 valid cached adjacency R3(config)#ip route 10.1.1.3 255.255.255.255 34.3.4.4 R3#show ip route 10.1.1.3 Routing entry for 10.1.1.3/32 Known via "static", distance 1, metric 0 Routing Descriptor Blocks: * 34.3.4.4 Route metric is 0, traffic share count is 1 R3#show ip cef 10.1.1.3 10.1.1.3/32, version 22, epoch 0 0 packets, 0 bytes via 34.3.4.4, 0 dependencies, recursive next hop 34.3.4.4, Ethernet0/1 via 34.3.4.0/24 valid glean adjacency |
Now we will confirm out traffic between our two new hosts is taking the appropriate path towards each other over the R1 -> R4 – > R3 path. We will traceroute towards the 172.16.2.2 and 172.16.2.3 hosts and compare the routes taken.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
PC4> trace 172.16.2.3 trace to 172.16.2.3, 8 hops max, press Ctrl+C to stop 1 10.1.1.1 15.600 ms 15.600 ms 15.600 ms 2 14.1.4.4 46.801 ms 46.800 ms 31.200 ms 3 34.3.4.3 62.401 ms 46.800 ms 46.800 ms 4 *172.16.2.3 78.000 ms PC4> trace 172.16.2.2 trace to 172.16.2.2, 8 hops max, press Ctrl+C to stop 1 10.1.1.1 15.600 ms 15.600 ms 15.600 ms 2 12.1.2.2 46.800 ms 46.801 ms 46.800 ms 3 23.2.3.3 78.000 ms 62.401 ms 62.400 ms 4 *172.16.2.2 93.601 ms |
Looking at this output we can confirm the two new hosts are taking the desired path while all other traffic to the 172.16.2.0/24 subnet takes the old path. There is a caveat to our solution that you should keep in mind. Traffic source from PC1 to our new destination of PC5 will take one path. While traffic sources from PC5 back to PC1 will take another. This is due to the static routing we have configured causing traffic to go different directions for different destinations on the same subnet.
1 2 3 4 5 6 7 8 9 10 11 12 13 |
PC1> trace 172.16.2.3 trace to 172.16.2.3, 8 hops max, press Ctrl+C to stop 1 10.1.1.1 15.600 ms 15.600 ms 15.600 ms 2 14.1.4.4 62.401 ms 62.400 ms 46.800 ms 3 34.3.4.3 62.401 ms 46.800 ms 31.200 ms 4 *172.16.2.3 62.400 ms PC5> trace 10.1.1.2 trace to 10.1.1.2, 8 hops max, press Ctrl+C to stop 1 172.16.2.1 15.600 ms 15.600 ms 15.600 ms 2 23.2.3.2 31.200 ms 46.800 ms 31.200 ms 3 12.1.2.1 78.001 ms 62.400 ms 62.400 ms 4 *10.1.1.2 62.400 ms |
R1
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
hostname R1 ! ip dhcp excluded-address 10.1.1.1 ! ip dhcp pool CLIENTS network 10.1.1.0 255.255.255.0 default-router 10.1.1.1 ! interface Ethernet0/0 ip address 14.1.4.1 255.255.255.0 ! interface Ethernet0/1 ip address 12.1.2.1 255.255.255.0 ! interface Ethernet1/0 ip address 10.1.1.1 255.255.255.0 ! ip route 23.2.3.0 255.255.255.0 12.1.2.2 ip route 34.3.4.0 255.255.255.0 14.1.4.4 ip route 172.16.2.0 255.255.255.0 12.1.2.2 ip route 192.168.3.0 255.255.255.0 12.1.2.2 |
R2
1 2 3 4 5 6 7 8 9 10 11 12 13 |
hostname R2 ! interface Ethernet0/0 ip address 23.2.3.2 255.255.255.0 ! interface Ethernet0/1 ip address 12.1.2.2 255.255.255.0 ! ip route 10.1.1.0 255.255.255.0 12.1.2.1 ip route 14.1.4.0 255.255.255.0 12.1.2.1 ip route 34.3.4.0 255.255.255.0 23.2.3.3 ip route 172.16.2.0 255.255.255.0 23.2.3.3 ip route 192.168.3.0 255.255.255.0 23.2.3.3 |
R3
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
hostname R3 ! ip dhcp excluded-address 172.16.2.1 ip dhcp pool CLIENTS network 172.16.2.0 255.255.255.0 default-router 172.16.2.1 ! interface Ethernet0/0 ip address 23.2.3.3 255.255.255.0 ! interface Ethernet0/1 ip address 34.3.4.3 255.255.255.0 ! interface Ethernet1/0 ip address 172.16.2.1 255.255.255.0 ! ip route 10.1.1.0 255.255.255.0 23.2.3.2 ip route 12.1.2.0 255.255.255.0 23.2.3.2 ip route 14.1.4.0 255.255.255.0 34.3.4.4 ip route 192.168.3.0 255.255.255.0 34.3.4.4 |
R4
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 |
hostname R4 ! ip dhcp excluded-address 192.168.3.1 ! ip dhcp pool CLIENTS network 192.168.3.0 255.255.255.0 default-router 192.168.3.1 ! interface Ethernet0/0 ip address 14.1.4.4 255.255.255.0 ! interface Ethernet0/1 ip address 34.3.4.4 255.255.255.0 ! interface Ethernet1/0 ip address 192.168.3.1 255.255.255.0 ! ip route 10.1.1.0 255.255.255.0 34.3.4.3 ip route 12.1.2.0 255.255.255.0 14.1.4.1 ip route 23.2.3.0 255.255.255.0 34.3.4.3 |