<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>iTechBlog &#187; Recursive Route lookup</title>
	<atom:link href="http://www.dide3d.com/tag/recursive-route-lookup/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dide3d.com</link>
	<description>Get Tech&#039;d...!                                              </description>
	<lastBuildDate>Mon, 06 Sep 2010 05:48:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Perils of ip route x.x.x.x 255.255.0.0 NextHopIP &#8211; Work Around</title>
		<link>http://www.dide3d.com/2009/04/perils-of-ip-route-xxxx-25525500-nexthopip-work-around/</link>
		<comments>http://www.dide3d.com/2009/04/perils-of-ip-route-xxxx-25525500-nexthopip-work-around/#comments</comments>
		<pubDate>Wed, 01 Apr 2009 18:23:26 +0000</pubDate>
		<dc:creator>Divin John</dc:creator>
				<category><![CDATA[Cisco *STUFF*]]></category>
		<category><![CDATA[Routing]]></category>
		<category><![CDATA[Static Routes]]></category>
		<category><![CDATA[Floating static route]]></category>
		<category><![CDATA[ip route]]></category>
		<category><![CDATA[Recursive Route lookup]]></category>

		<guid isPermaLink="false">http://www.dide3d.com/?p=759</guid>
		<description><![CDATA[In this network diagram, there are two static routes to the same destination (172.31.10.0/24). One route is a floating static, it is the &#8220;backup&#8221; or redundant path to the destination network on the LAN. The problem in the scenario is that the floating static route never gets installed in the routing table when the primary [...]]]></description>
			<content:encoded><![CDATA[<p><span class="content">In this network diagram, there are two static routes to the same 	 destination (172.31.10.0/24). One route is a floating static, it is the 	 &#8220;backup&#8221; or redundant path to the destination network on the LAN. The problem 	 in the scenario is that the floating static route never gets installed in the 	 routing table when the primary link is shut down.</span></p>
<p>R1 has a default route that points to the Internet Service Provider 	 (ISP) router for Internet access. R1 has two links to R2. The T1 is the primary 	 link and 56 K is the backup link. R1 has a static route for 172.31.10.0/24 	 which points to the R2 Serial 0 IP address (10.10.10.2) as the next-hop. R1 	 also has a floating static route for 172.131.10.0/24 which points to the R2 	 Serial 1 IP address (192.168.20.2), the administrative distance for the 	 floating static route is 250. The idea is for packets to flow over the 56 K 	 line in both directions only if the primary link fails.</p>
<p><img src="http://www.cisco.com/image/gif/paws/27082/ip_static_routes_01.gif" border="0" alt="ip_static_routes_01.gif" /></p>
<p>This example shows the R1 configuration:</p>
<table border="1" cellspacing="1" cellpadding="3" width="60%" bgcolor="#ffffff">
<tbody>
<tr>
<th>R1</th>
</tr>
<tr>
<td bgcolor="#ffffff">
<pre>hostname R1

!
ip subnet-zero
no ip domain-lookup
!
controller E1 2/0
!
controller E1 2/1
!
interface Serial3/0
 description ISP Link
 ip address 192.168.10.1 255.255.255.252
 clockrate 64000
!
interface Serial3/1
 no ip address
 shutdown
!
interface Serial3/2
 description Primary Link to R2
 ip address 10.10.10.1 255.255.255.252
!
interface Serial3/3
 description Backup Link to R2
 ip address  192.168.20.1 255.255.255.252
 clockrate 64000
!
ip classless
ip route 0.0.0.0 0.0.0.0 Serial3/0
<em>
<span style="color: #0000ff;">!---This is the default route to ISP router.</span>
</em>
ip route 172.31.10.0 255.255.255.0 10.10.10.2
<em>
<span style="color: #0000ff;">!---This is the preferred route to the LAN.</span>
</em>
ip route 172.31.10.0 255.255.255.0 192.168.20.2 250
<em>
<span style="color: #0000ff;">!---This is the floating route to the LAN.</span>
</em></pre>
</td>
</tr>
</tbody>
</table>
<p>This example shows the R1 routing table:</p>
<table border="1" cellspacing="1" cellpadding="3" width="60%" bgcolor="#ffffff">
<tbody>
<tr>
<th>R1 Routing Table</th>
</tr>
<tr>
<td bgcolor="#ffffff">
<pre>R1#<strong>show ip route</strong>
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
       U - per-user static route, o - ODR

Gateway of last resort is 0.0.0.0 to network 0.0.0.0

     10.0.0.0/30 is subnetted, 1 subnets
C       10.10.10.0 is directly connected, Serial3/2
     192.168.10.0/30 is subnetted, 1 subnets
C       192.168.10.0 is directly connected, Serial3/0
     192.168.20.0/30 is subnetted, 1 subnets
C       192.168.20.0 is directly connected, Serial3/3
     172.31.0.0/24 is subnetted, 1 subnets
S       172.31.10.0 [1/0] via 10.10.10.2
<em>
<span style="color: #0000ff;">!--- The preferred static route to the LAN through the T1.</span>
</em>
S*   0.0.0.0/0 is directly connected, Serial3/0
<em>
<span style="color: #0000ff;">!--- The static default route to the Internet.</span>
</em></pre>
</td>
</tr>
</tbody>
</table>
<p>This example shows the R2 configuration:</p>
<table border="1" cellspacing="1" cellpadding="3" width="60%" bgcolor="#ffffff">
<tbody>
<tr>
<th>R2</th>
</tr>
<tr>
<td bgcolor="#ffffff">
<pre>hostname R2
!
enable password ww
!
!
!
!
!
ip subnet-zero
no ip finger
no ip domain-lookup
!
!
!
interface Ethernet0
 description Local LAN
 ip address 172.31.10.2 255.255.255.0
!
interface Serial0
 description Primary Link to R1
 ip address 10.10.10.2 255.255.255.252
 clockrate 56000
!
interface Serial1
 description Backup Link to R1
 ip address 192.168.20.2 255.255.255.252
!
interface TokenRing0
 no ip address
 shutdown
!
ip classless
ip route 0.0.0.0 0.0.0.0 10.10.10.1
<em>
<span style="color: #0000ff;">!--- This is the primary default route.</span>
</em>
ip route 0.0.0.0 0.0.0.0 192.168.20.1 250
<em>
<span style="color: #0000ff;">!--- The floating default route to be used if the T1 fails.</span>
</em>
no ip http server
!
!
line con 0
 exec-timeout 0 0
 transport input none
line aux 0
line vty 0 4
 password ww
 login
!
end</pre>
</td>
</tr>
</tbody>
</table>
<p>R2 has the default route installed through 10.10.10.1 and when you use 	 the <strong>traceroute</strong> command from R2 to the ISP router, 	 the packets use the T1 link. R2 can send pings to the Internet host 	 192.168.30.1 sourced from 172.31.10.2. The route to 192.168.30.1 is through the 	 default route 0.0.0.0 0.0.0.0.</p>
<table border="1" cellspacing="1" cellpadding="3" width="60%" bgcolor="#ffffff">
<tbody>
<tr>
<th>R2 Routing Table</th>
</tr>
<tr>
<td bgcolor="#ffffff">
<pre>R2#<strong>show ip route</strong>
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
       i - IS-IS, 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 10.10.10.1 to network 0.0.0.0

     172.31.0.0/24 is subnetted, 1 subnets
C       172.31.10.0 is directly connected, Ethernet0
     192.168.20.0/30 is subnetted, 1 subnets
C       192.168.20.0 is directly connected, Serial1
     10.0.0.0/8 is variably subnetted, 2 subnets, 2 masks
C       10.10.10.0/30 is directly connected, Serial0
S*   0.0.0.0/0 [1/0] via 10.10.10.1
<em>
<span style="color: #0000ff;">!--- This is the primary default route.</span>
</em>
R2#<strong>traceroute 192.168.10.2</strong>

Type escape sequence to abort.
Tracing the route to 192.168.10.2

  1 10.10.10.1 16 msec 20 msec 16 msec
  2 192.168.10.2 32 msec *  32 msec

R2#<strong>ping</strong>
Protocol [ip]:
Target IP address: 192.168.30.1
Repeat count [5]:
Datagram size [100]:
Timeout in seconds [2]:
Extended commands [n]: y
Source address or interface: 172.31.10.2
Type of service [0]:
Set DF bit in IP header? [no]:
Validate reply data? [no]:
Data pattern [0xABCD]:
Loose, Strict, Record, Timestamp, Verbose[none]:
Sweep range of sizes [n]:
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.20.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 32/32/32 ms</pre>
</td>
</tr>
</tbody>
</table>
<p>If you shut down Serial 3/2 on R1 to test the failover, you should 	 expect R1 to install the floating static route to the local LAN 172.31.10.0 and 	 for R2 to install the floating static route to 0.0.0.0 through 192.168.20.1. 	 You would expect traffic to flow over the 56K link.</p>
<table border="1" cellspacing="1" cellpadding="3" width="60%" bgcolor="#ffffff">
<tbody>
<tr>
<th>R1</th>
</tr>
<tr>
<td bgcolor="#ffffff">
<pre>R1#<strong>show ip interface brief</strong>
Interface              IP-Address      OK? Method Status                Protocol
Serial3/0              192.168.10.1    YES manual up                    up
Serial3/1              unassigned      YES unset  administratively down down
Serial3/2              10.10.10.1      YES manual up                    up
Serial3/3              192.168.20.1    YES manual up                    up

R1#<strong>configure terminal</strong>
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#int s3/2
R1(config-if)#shut
R1(config-if)#end
2d21h: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial3/2, changed state to down
2d21h: %LINK-5-CHANGED: Interface Serial3/2, changed state to administratively down

R1#<strong>show ip interface brief</strong>
Interface              IP-Address      OK? Method Status                Protocol
Serial3/0              192.168.10.1    YES manual up&amp;                   up
Serial3/1              unassigned      YES unset  administratively down down
Serial3/2              10.10.10.1      YES manual administratively down down
Serial3/3              192.168.20.1    YES manual up                    up

R1#<strong>show ip route</strong>
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
       U - per-user static route, o - ODR

Gateway of last resort is 0.0.0.0 to network 0.0.0.0

     192.168.10.0/30 is subnetted, 1 subnets
C       192.168.10.0 is directly connected, Serial3/0
     192.168.20.0/30 is subnetted, 1 subnets
C       192.168.20.0 is directly connected, Serial3/3
     172.31.0.0/24 is subnetted, 1 subnets
S       172.31.10.0 [1/0] via 10.10.10.2
<em>
<span style="color: #0000ff;">!--- The static route through the T1 remains in the routing table.
!--- This is not what was expected to happen when Serial 3/2 was shut.</span>
</em>
S*   0.0.0.0/0 is directly connected, Serial3/0
<em>
<span style="color: #0000ff;">!--- The static default route to the Internet.</span>
</em>
R2#<strong>show ip route</strong>
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
       i - IS-IS, 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 192.168.20.1 to network 0.0.0.0

     172.31.0.0/24 is subnetted, 1 subnets
C       172.31.10.0 is directly connected, Ethernet0
     192.168.20.0/30 is subnetted, 1 subnets
C       192.168.20.0 is directly connected, Serial1
S*   0.0.0.0/0 [250/0] via 192.168.20.1
<em>
<span style="color: #0000ff;">!--- It is no longer possible to ping the Internet host 192.168.20.1 if the ping
!--- is sourced from the LAN on R2 because R1 tries to send the replies
!--- via the Serial 3/2, which is down.</span>
</em>
R2#<strong>ping</strong>
Protocol [ip]:
Target IP address: 192.168.30.1
Repeat count [5]:
Datagram size [100]:
Timeout in seconds [2]:
Extended commands [n]: y
Source address or interface: 172.31.10.2
Type of service [0]:
Set DF bit in IP header? [no]:
Validate reply data? [no]:
Data pattern [0xABCD]:
Loose, Strict, Record, Timestamp, Verbose[none]:
Sweep range of sizes [n]:
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.20.1, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)</pre>
</td>
</tr>
</tbody>
</table>
<p>The floating static route was not installed on R1 and the primary 	 static route is still in the routing table of R1 even though the Serial 3/2 	 link is shut down. The reason this happens is because static routes are 	 recursive in nature. You always keep the static route in the routing table as 	 long as you have a route to the next hop. In this case, R1 thinks it can get to 	 10.10.10.2 through 192.168.10.2 because 192.168.10.2 is the next hop for 	 0.0.0.0 0.0.0.0.</p>
<p>The route to a next hop can be a more specific, a less specific, or a 	 default route. In this problem scenario, you would think that since the link is 	 down you should not have a route to 10.10.10.2, but if you look at the routing 	 table on R1, you see that there is a static default route pointing to the ISP 	 router. R1, therefore believes that it can reach the next hop (10.10.10.2) for 	 172.31.10.0/24 through this default route, so the static route to 	 172.31.10.0/24 through 10.10.10.2 remains in the routing table and the floating 	 static route never gets installed.</p>
<p>There is a better way to configure static routes that would allow you 	 to avoid this problem. If you specify the interface through which the next hop 	 should be found, you will install the floating static route only if the next 	 hop IP address is reachable through the specified interface. Before the 	 solution to this problem is presented, you will bring the Serial 3/2 interface 	 on R1 back up again.</p>
<table border="1" cellspacing="1" cellpadding="3" width="60%" bgcolor="#ffffff">
<tbody>
<tr>
<th>R1</th>
</tr>
<tr>
<td bgcolor="#ffffff">
<pre>R1#<strong>configure terminal</strong>
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#int s 3/2
R1(config-if)#no shut
R1(config-if)#end
R1#
2d22h: %LINK-3-UPDOWN: Interface Serial3/2, changed state to up
2d22h: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial3/2, changed state to up
2d22h: %SYS-5-CONFIG_I: Configured from console by console

R1#<strong>show ip int brief</strong>
Interface              IP-Address      OK? Method Status                Protocol
Serial3/0&amp;             192.168.10.1    YES manual up                    up
Serial3/1              unassigned      YES unset  administratively down down
Serial3/2              10.10.10.1      YES manual up                    up
Serial3/3              192.168.20.1    YES manual up                    up

R1#<strong>show ip route</strong>
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
       U - per-user static route, o - ODR

Gateway of last resort is 0.0.0.0 to network 0.0.0.0

     10.0.0.0/30 is subnetted, 1 subnets
C       10.10.10.0 is directly connected, Serial3/2
     192.168.10.0/30 is subnetted, 1 subnets
C       192.168.10.0 is directly connected, Serial3/0
     192.168.20.0/30 is subnetted, 1 subnets
C       192.168.20.0 is directly connected, Serial3/3
     172.31.0.0/24 is subnetted, 1 subnets
S       172.31.10.0 [1/0] via 10.10.10.2
S*   0.0.0.0/0 is directly connected, Serial3/0
R1#</pre>
</td>
</tr>
</tbody>
</table>
<h2><a name="topic2">Solution</a></h2>
<p>The solution is to remove the old static routes to the LAN 	 (172.31.10.0) and configure new static routes, this time specifying the 	 interface through which the next hop must be reached. This allows the floating 	 static route on R1 to get installed when the Serial 3/2 interface is shut.</p>
<table border="1" cellspacing="1" cellpadding="3" width="60%" bgcolor="#ffffff">
<tbody>
<tr>
<th>R1</th>
</tr>
<tr>
<td bgcolor="#ffffff">
<pre>R1#<strong>configure terminal</strong>
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#no ip route 172.31.10.0 255.255.255.0 10.10.10.2
R1(config)#no ip route 172.31.10.0 255.255.255.0 192.168.20.2 250
R1(config)#ip route 172.31.10.0 255.255.255.0 Serial3/2 10.10.10.2
R1(config)#ip route 172.31.10.0 255.255.255.0 Serial3/3 192.168.20.2 250
R1(config)#end
R1#
2d22h: %SYS-5-CONFIG_I: Configured from console by console</pre>
</td>
</tr>
</tbody>
</table>
<p>The static route to 172.31.10.0 through 10.10.10.2 is installed in the 	 routing table of R1 if 10.10.10.2 is seen through Serial 3/2. If this condition 	 is not met, the static route through 10.10.10.2 is removed from the routing 	 table and the floating static route to 172.31.10.0 through Serial 3/3 with next 	 hop 192.168.20.2 is installed.</p>
<p>In order to test how this works and bring the T1 link down, shut down 	 Serial 3/2 and see if the floating static route gets installed in the routing 	 table.</p>
<table border="1" cellspacing="1" cellpadding="3" width="60%" bgcolor="#ffffff">
<tbody>
<tr>
<th>R1</th>
</tr>
<tr>
<td bgcolor="#ffffff">
<pre>R1#<strong>configure terminal</strong>
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#int s 3/2
R1(config-if)#shut
R1(config-if)#end
R1#
3d00h: %LINEPROTO-5-UPDOWN: Line protocol on Interface Serial3/2, changed state to down
3d00h: %SYS-5-CONFIG_I: Configured from console by console
3d00h: %LINK-5-CHANGED: Interface Serial3/2, changed state to administratively down

R1#<strong>show ip interface brief</strong>
Interface              IP-Address      OK? Method Status                Protocol
Serial3/0              192.168.10.1    YES manual up                    up
Serial3/1              unassigned      YES unset  administratively down down
Serial3/2              10.10.10.1      YES manual administratively down down
Serial3/3              192.168.20.1    YES manual up                    up

R1#<strong>show ip route</strong>
Codes: C - connected, S - static, I - IGRP, 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, E - EGP
       i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
       U - per-user static route, o - ODR

Gateway of last resort is 0.0.0.0 to network 0.0.0.0

     192.168.10.0/30 is subnetted, 1 subnets
C       192.168.10.0 is directly connected, Serial3/0
     192.168.20.0/30 is subnetted, 1 subnets
C       192.168.20.0 is directly connected, Serial3/3
     172.31.0.0/24 is subnetted, 1 subnets
S       172.31.10.0 [250/0] via 192.168.20.2, Serial3/3
S*   0.0.0.0/0 is directly connected, Serial3/0
R1#</pre>
</td>
</tr>
</tbody>
</table>
<p>Now R1 can ping the Internet host 192.168.20.1 with packets sourced 	 from the LAN.</p>
<table border="1" cellspacing="1" cellpadding="3" width="60%" bgcolor="#ffffff">
<tbody>
<tr>
<th>R2</th>
</tr>
<tr>
<td bgcolor="#ffffff">
<pre>R2#<strong>ping</strong>
Protocol [ip]:
Target IP address: 192.168.20.1
Repeat count [5]:
Datagram size [100]:
Timeout in seconds [2]:
Extended commands [n]: y
Source address or interface: 172.31.10.2
Type of service [0]:
Set DF bit in IP header? [no]:
Validate reply data? [no]:
Data pattern [0xABCD]:
Loose, Strict, Record, Timestamp, Verbose[none]:
Sweep range of sizes [n]:
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.20.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 32/32/32 ms</pre>
</td>
</tr>
</tbody>
</table>
<p>The floating static route gets installed as expected.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.dide3d.com/2009/04/perils-of-ip-route-xxxx-25525500-nexthopip-work-around/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
