Static routing problems

BennyLavaBennyLava Member Posts: 60 ■■□□□□□□□□
I've been playing around with static routes and saw some things going on that I don't understand. I feel like I'm overlooking something simple but I'm not sure what it is. I tried to boil it down to just the relevant examples to explain the issues so if I left anything out let me know. R1 and R2 are connected by 2 serial interfaces:
R1:
interface Serial0/0
 ip address 10.1.1.1 255.255.255.0

interface Serial0/1
 ip address 192.168.1.1 255.255.255.252


R2:
interface Serial0/0
 ip address 10.1.1.2 255.255.255.0

interface Serial0/1
 ip address 192.168.1.2 255.255.255.252

If I configure a static default route with an exit interface, it seems that other static routes configured with a next-hop that matches the default route are only added if no subnets of the major network for the next-hop exist:
R1(config)#do debug ip routing
R1(config)#ip route 0.0.0.0 0.0.0.0 s0/0
Mar  1 03:48:23.995: RT: add 0.0.0.0/0 via 0.0.0.0, static metric [1/0]
Mar  1 03:48:23.999: RT: NET-RED 0.0.0.0/0
Mar  1 03:48:23.999: RT: default path is now 0.0.0.0 via 0.0.0.0
Mar  1 03:48:23.999: RT: new default network 0.0.0.0
Mar  1 03:48:24.003: RT: NET-RED 0.0.0.0/0
R1(config)#do sh ip rou
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 0.0.0.0 to network 0.0.0.0

     10.0.0.0/24 is subnetted, 1 subnets
C       10.1.1.0 is directly connected, Serial0/0
     192.168.1.0/30 is subnetted, 1 subnets
C       192.168.1.0 is directly connected, Serial0/1
S*   0.0.0.0/0 is directly connected, Serial0/0

R1(config)#ip route 1.0.0.0 255.0.0.0 20.1.1.1
Mar  1 03:52:12.559: RT: SET_LAST_RDB for 1.0.0.0/8
  NEW rdb: via 20.1.1.1

Mar  1 03:52:12.559: RT: add 1.0.0.0/8 via 20.1.1.1, static metric [1/0]
Mar  1 03:52:12.563: RT: NET-RED 1.0.0.0/8

R1(config)#ip route 2.0.0.0 255.0.0.0 10.1.1.2
Mar  1 03:53:01.187: RT: SET_LAST_RDB for 2.0.0.0/8
  NEW rdb: via 10.1.1.2

Mar  1 03:53:01.187: RT: add 2.0.0.0/8 via 10.1.1.2, static metric [1/0]
Mar  1 03:53:01.191: RT: NET-RED 2.0.0.0/8

R1(config)#ip route 3.0.0.0 255.0.0.0 10.1.2.2

R1(config)#ip route 4.0.0.0 255.0.0.0 192.168.1.2 
Mar  1 03:56:36.763: RT: SET_LAST_RDB for 4.0.0.0/8
  NEW rdb: via 192.168.1.2

Mar  1 03:56:36.767: RT: add 4.0.0.0/8 via 192.168.1.2, static metric [1/0]
Mar  1 03:56:36.767: RT: NET-RED 4.0.0.0/8

R1(config)#ip route 5.0.0.0 255.0.0.0 192.168.1.6

R1(config)#do sh ip rou
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 0.0.0.0 to network 0.0.0.0

S    1.0.0.0/8 [1/0] via 20.1.1.1
S    2.0.0.0/8 [1/0] via 10.1.1.2
S    4.0.0.0/8 [1/0] via 192.168.1.2
     10.0.0.0/24 is subnetted, 1 subnets
C       10.1.1.0 is directly connected, Serial0/0
     192.168.1.0/30 is subnetted, 1 subnets
C       192.168.1.0 is directly connected, Serial0/1
S*   0.0.0.0/0 is directly connected, Serial0/0

The most specific match for the next-hop of 1.0.0.0 is the default route. No subnets of the major network 20.0.0.0 exist. 1.0.0.0 is added to the routing table.

The most specific match for the next-hop of 2.0.0.0 and 4.0.0.0 are the directly connected routes, and both of them are added to the routing table.

The most specific match for the next-hop of 3.0.0.0 and 5.0.0.0 is the default route. Other subnets of 10.0.0.0 and 192.168.1.0 exist but none that match the next hop. Neither route is added to the routing table.





If I configure any type of static route besides a default route with an exit interface, this behavior no longer happens and other static routes configured with a next-hop that matches the route are added even if other subnets of the major network for the next-hop exist:
<all previous ip route statements deleted>
R1(config)#ip route 0.0.0.0 128.0.0.0 s0/0
Mar  1 03:57:56.547: RT: SET_LAST_RDB for 0.0.0.0/1
  NEW rdb: is directly connected

Mar  1 03:57:56.551: RT: add 0.0.0.0/1 via 0.0.0.0, static metric [1/0]
Mar  1 03:57:56.551: RT: NET-RED 0.0.0.0/1

R1(config)#ip route 128.0.0.0 128.0.0.0 s0/0
Mar  1 03:58:13.375: RT: SET_LAST_RDB for 128.0.0.0/1
  NEW rdb: is directly connected

Mar  1 03:58:13.375: RT: add 128.0.0.0/1 via 0.0.0.0, static metric [1/0]
Mar  1 03:58:13.375: RT: NET-RED 128.0.0.0/1

R1(config)#do sh ip rou                             
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

     10.0.0.0/24 is subnetted, 1 subnets
C       10.1.1.0 is directly connected, Serial0/0
     192.168.1.0/30 is subnetted, 1 subnets
C       192.168.1.0 is directly connected, Serial0/1
S    0.0.0.0/1 is directly connected, Serial0/0
S    128.0.0.0/1 is directly connected, Serial0/0

R1(config)#ip route 1.0.0.0 255.0.0.0 20.1.1.1
Mar  1 04:00:29.119: RT: SET_LAST_RDB for 1.0.0.0/8
  NEW rdb: via 20.1.1.1

Mar  1 04:00:29.119: RT: add 1.0.0.0/8 via 20.1.1.1, static metric [1/0]
Mar  1 04:00:29.123: RT: NET-RED 1.0.0.0/8

R1(config)#ip route 2.0.0.0 255.0.0.0 10.1.1.2
Mar  1 04:00:37.359: RT: SET_LAST_RDB for 2.0.0.0/8
  NEW rdb: via 10.1.1.2

Mar  1 04:00:37.359: RT: add 2.0.0.0/8 via 10.1.1.2, static metric [1/0]
Mar  1 04:00:37.359: RT: NET-RED 2.0.0.0/8

R1(config)#ip route 3.0.0.0 255.0.0.0 10.1.2.2
Mar  1 04:00:43.263: RT: SET_LAST_RDB for 3.0.0.0/8
  NEW rdb: via 10.1.2.2

Mar  1 04:00:43.263: RT: add 3.0.0.0/8 via 10.1.2.2, static metric [1/0]
Mar  1 04:00:43.267: RT: NET-RED 3.0.0.0/8

R1(config)#ip route 4.0.0.0 255.0.0.0 192.168.1.2 
Mar  1 04:00:50.231: RT: SET_LAST_RDB for 4.0.0.0/8
  NEW rdb: via 192.168.1.2

Mar  1 04:00:50.235: RT: add 4.0.0.0/8 via 192.168.1.2, static metric [1/0]
Mar  1 04:00:50.235: RT: NET-RED 4.0.0.0/8

R1(config)#ip route 5.0.0.0 255.0.0.0 192.168.1.6
Mar  1 04:00:56.483: RT: SET_LAST_RDB for 5.0.0.0/8
  NEW rdb: via 192.168.1.6

Mar  1 04:00:56.483: RT: add 5.0.0.0/8 via 192.168.1.6, static metric [1/0]
Mar  1 04:00:56.483: RT: NET-RED 5.0.0.0/8

R1(config)#do sh ip rou
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

S    1.0.0.0/8 [1/0] via 20.1.1.1
S    2.0.0.0/8 [1/0] via 10.1.1.2
S    3.0.0.0/8 [1/0] via 10.1.2.2
S    4.0.0.0/8 [1/0] via 192.168.1.2
S    5.0.0.0/8 [1/0] via 192.168.1.6
     10.0.0.0/24 is subnetted, 1 subnets
C       10.1.1.0 is directly connected, Serial0/0
     192.168.1.0/30 is subnetted, 1 subnets
C       192.168.1.0 is directly connected, Serial0/1
S    0.0.0.0/1 is directly connected, Serial0/0
S    128.0.0.0/1 is directly connected, Serial0/0

3.0.0.0 and 5.0.0.0 were added this time, unlike with the default route.





If I configure a static default route with a next-hop, no other static routes with a next-hop that matches the default route as it's best match are added to the routing table:
<all previous ip route statements deleted>
R1(config)#ip route 0.0.0.0 0.0.0.0 10.1.1.2
Mar  1 04:08:37.607: RT: SET_LAST_RDB for 0.0.0.0/0
  NEW rdb: via 10.1.1.2

Mar  1 04:08:37.607: RT: add 0.0.0.0/0 via 10.1.1.2, static metric [1/0]
Mar  1 04:08:37.611: RT: NET-RED 0.0.0.0/0
Mar  1 04:08:37.611: RT: default path is now 0.0.0.0 via 10.1.1.2
Mar  1 04:08:37.611: RT: new default network 0.0.0.0
Mar  1 04:08:37.611: RT: NET-RED 0.0.0.0/0

R1(config)#do sh ip rou
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 10.1.1.2 to network 0.0.0.0

     10.0.0.0/24 is subnetted, 1 subnets
C       10.1.1.0 is directly connected, Serial0/0
     192.168.1.0/30 is subnetted, 1 subnets
C       192.168.1.0 is directly connected, Serial0/1
S*   0.0.0.0/0 [1/0] via 10.1.1.2

R1(config)#ip route 1.0.0.0 255.0.0.0 20.1.1.1
R1(config)#ip route 2.0.0.0 255.0.0.0 10.1.1.2
R1(config)#ip route 3.0.0.0 255.0.0.0 10.1.2.2
R1(config)#ip route 4.0.0.0 255.0.0.0 192.168.1.2
R1(config)#ip route 5.0.0.0 255.0.0.0 192.168.1.6
Mar  1 04:10:17.687: RT: SET_LAST_RDB for 2.0.0.0/8
  NEW rdb: via 10.1.1.2

Mar  1 04:10:17.687: RT: add 2.0.0.0/8 via 10.1.1.2, static metric [1/0]
Mar  1 04:10:17.687: RT: NET-RED 2.0.0.0/8
Mar  1 04:10:17.935: RT: SET_LAST_RDB for 4.0.0.0/8
  NEW rdb: via 192.168.1.2

Mar  1 04:10:17.935: RT: add 4.0.0.0/8 via 192.168.1.2, static metric [1/0]
Mar  1 04:10:17.935: RT: NET-RED 4.0.0.0/8

R1(config)#do sh ip rou
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 10.1.1.2 to network 0.0.0.0

S    2.0.0.0/8 [1/0] via 10.1.1.2
S    4.0.0.0/8 [1/0] via 192.168.1.2
     10.0.0.0/24 is subnetted, 1 subnets
C       10.1.1.0 is directly connected, Serial0/0
     192.168.1.0/30 is subnetted, 1 subnets
C       192.168.1.0 is directly connected, Serial0/1
S*   0.0.0.0/0 [1/0] via 10.1.1.2

Only 2.0.0.0 and 4.0.0.0, which had better matches than the default route were added.





If I configure a non-default static route with a next-hop, more specific static routes that match it are not put in the routing table but less specific routes are:
<all previous ip route statements deleted>
R1(config)#ip route 2.0.0.0 255.0.0.0 10.1.1.2
Mar  1 04:22:18.731: RT: SET_LAST_RDB for 2.0.0.0/8
  NEW rdb: via 10.1.1.2

Mar  1 04:22:18.731: RT: add 2.0.0.0/8 via 10.1.1.2, static metric [1/0]
Mar  1 04:22:18.735: RT: NET-RED 2.0.0.0/8

R1(config)#ip route 2.0.0.0 255.128.0.0 2.255.1.1
R1(config)#ip route 2.0.0.0 254.0.0.0 2.255.1.1 
Mar  1 04:22:49.967: RT: SET_LAST_RDB for 2.0.0.0/7
  NEW rdb: via 2.255.1.1

Mar  1 04:22:49.967: RT: add 2.0.0.0/7 via 2.255.1.1, static metric [1/0]
Mar  1 04:22:49.971: RT: NET-RED 2.0.0.0/7

R1(config)#do sh ip rou
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

S    2.0.0.0/8 [1/0] via 10.1.1.2
     10.0.0.0/24 is subnetted, 1 subnets
C       10.1.1.0 is directly connected, Serial0/0
     192.168.1.0/30 is subnetted, 1 subnets
C       192.168.1.0 is directly connected, Serial0/1
S    2.0.0.0/7 [1/0] via 2.255.1.1


2.0.0.0/7 is added but 2.0.0.0/9 is not even though both have 2.0.0.0/8 as the best match for their next-hop. This seems like possibly a measure to prevent a route from being self recursive but in this case the next-hop for 2.0.0.0/9 is outside of it's own range so 2.0.0.0/8 would be the best match even if 2.0.0.0/9 was in the routing table.




Can anyone explain to me why these things are happening?

Comments

  • EdTheLadEdTheLad Member Posts: 2,111 ■■■■□□□□□□
    Is "ip classless" configured?
    which version of ios are you using?
    Networking, sometimes i love it, mostly i hate it.Its all about the $$$$
  • BennyLavaBennyLava Member Posts: 60 ■■□□□□□□□□
    ip classless is configured. The IOS version is 12.4(1icon_cool.gif.
  • kryollakryolla Member Posts: 785
    static routes are only added to the routing table if the next hop can be reached or the interface is up depending on configuring the static with a next hop or exit interface.


    ip route 1.0.0.0 255.0.0.0 20.1.1.1 next hop can't be reached thus it is not in the RIB

    R1(config)#ip route 5.0.0.0 255.0.0.0 192.168.1.6 next hop cant be reached thus it is not int the RIB

    S 2.0.0.0/8 [1/0] via 10.1.1.2
    S 4.0.0.0/8 [1/0] via 192.168.1.2
    these two recurse to an exit interface and the other 2 probably dont


    S 2.0.0.0/8 [1/0] via 10.1.1.2
    change this to a /16 and the other route will probably be added
    Studying for CCIE and drinking Home Brew
  • EdTheLadEdTheLad Member Posts: 2,111 ■■■■□□□□□□
    kryolla wrote: »
    static routes are only added to the routing table if the next hop can be reached or the interface is up depending on configuring the static with a next hop or exit interface.


    ip route 1.0.0.0 255.0.0.0 20.1.1.1 next hop can't be reached thus it is not in the RIB

    R1(config)#ip route 5.0.0.0 255.0.0.0 192.168.1.6 next hop cant be reached thus it is not int the RIB

    S 2.0.0.0/8 [1/0] via 10.1.1.2
    S 4.0.0.0/8 [1/0] via 192.168.1.2
    these two recurse to an exit interface and the other 2 probably dont


    S 2.0.0.0/8 [1/0] via 10.1.1.2
    change this to a /16 and the other route will probably be added


    I haven't really checked this out but, the first output had

    R1(config)#do sh ip rou

    Gateway of last resort is not set

    S 1.0.0.0/8 [1/0] via 20.1.1.1
    S 2.0.0.0/8 [1/0] via 10.1.1.2
    S 3.0.0.0/8 [1/0] via 10.1.2.2
    S 4.0.0.0/8 [1/0] via 192.168.1.2
    S 5.0.0.0/8 [1/0] via 192.168.1.6
    10.0.0.0/24 is subnetted, 1 subnets
    C 10.1.1.0 is directly connected, Serial0/0
    192.168.1.0/30 is subnetted, 1 subnets
    C 192.168.1.0 is directly connected, Serial0/1
    S 0.0.0.0/1 is directly connected, Serial0/0
    S 128.0.0.0/1 is directly connected, Serial0/0


    Since 20.1.1.1 doesn't exist, 1.0.0.0/8 shouldn't be in the RIB as per your post above.
    Looks similar to the classful forwarding behavior regarding the default-route and having a major network address.
    Networking, sometimes i love it, mostly i hate it.Its all about the $$$$
  • kryollakryolla Member Posts: 785
    that because it will recurse to the route below once he takes that out it wont recurse and those routes wont be in the routing table

    S 0.0.0.0/1 is directly connected, Serial0/0

    when troubleshooting do the recursion process and see if it ends up pointing to an exit interface if it doesnt then it wont be put in the routing table and since these are serial interfaces with default encap it wont hurt to put the exit interface for static routes since there is only 2 end points. You dont want to put the exit interface for multiaccess interfaces or it will arp for every final destination and the next hop router will proxy arp. Thus next hop IP for multiaccess and you only have to arp for the next hop
    Studying for CCIE and drinking Home Brew
  • EdTheLadEdTheLad Member Posts: 2,111 ■■■■□□□□□□
    kryolla wrote: »
    that because it will recurse to the route below once he takes that out it wont recurse and those routes wont be in the routing table

    S 0.0.0.0/1 is directly connected, Serial0/0

    R1(config)#ip route 5.0.0.0 255.0.0.0 192.168.1.6


    S 1.0.0.0/8 [1/0] via 20.1.1.1
    S 2.0.0.0/8 [1/0] via 10.1.1.2
    S 4.0.0.0/8 [1/0] via 192.168.1.2
    10.0.0.0/24 is subnetted, 1 subnets
    C 10.1.1.0 is directly connected, Serial0/0
    192.168.1.0/30 is subnetted, 1 subnets
    C 192.168.1.0 is directly connected, Serial0/1
    S* 0.0.0.0/0 is directly connected, Serial0/0


    So why is 5.0.0.0/8 not in the RIB? 192.168.1.6 doesn't exist, why does recursion not occur for this network.
    Networking, sometimes i love it, mostly i hate it.Its all about the $$$$
  • kryollakryolla Member Posts: 785
    Alright Ed now I have to lab this up see below but on a 3550. This is for the first example

    Rack1SW1#
    Rack1SW1#sh run | inc class
    ip classless
    Rack1SW1#sh run | inc zero
    ip subnet-zero
    Rack1SW1#end
    Translating "end"
    % Unknown command or computer name, or unable to find computer address
    Rack1SW1#sh 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 0.0.0.0 to network 0.0.0.0

    10.0.0.0/24 is subnetted, 1 subnets
    C 10.1.1.0 is directly connected, FastEthernet0/20
    192.168.1.0/30 is subnetted, 1 subnets
    C 192.168.1.0 is directly connected, FastEthernet0/19
    S* 0.0.0.0/0 is directly connected, FastEthernet0/19
    Rack1SW1#deb ip rou
    Rack1SW1#deb ip routing ?
    <1-199> Access list
    <1300-2699> Access list (expanded range)
    static IP Static routing
    <cr>

    Rack1SW1#deb ip routing st
    Rack1SW1#deb ip routing static ?
    detail IP Static routing detail
    route IP Static routing route
    summary IP Static routing control summary
    time IP Static routing time spent

    Rack1SW1#deb ip routing static det
    IP static routing detail debugging is on
    Rack1SW1#deb ip routing static r
    Rack1SW1#deb ip routing static route
    % Incomplete command.

    Rack1SW1#deb ip routing static route ?
    A.B.C.D Destination prefix

    Rack1SW1#deb ip routing static route
    *Mar 4 22:36:57.976: IP-Static: 0.0.0.0 0.0.0.0 FastEthernet0/19 Path = 1, rou
    te table no change, recursive flag clear
    *Mar 4 22:36:57.976: IP-Static: 3.0.0.0 255.0.0.0 10.1.2.2 Path = 2 5 6 8, rou
    te table deleted, recursive flag set
    Rack1SW1#end
    Translating "end"
    % Unknown command or computer name, or unable to find computer address
    Rack1SW1#
    *Mar 4 22:37:57.976: IP-Static: 0.0.0.0 0.0.0.0 FastEthernet0/19 Path = 1, rou
    te table no change, recursive flag clear
    *Mar 4 22:37:57.976: IP-Static: 3.0.0.0 255.0.0.0 10.1.2.2 Path = 2 5 6 8, rou
    te table deleted, recursive flag set
    Rack1SW1#conf t
    Enter configuration commands, one per line. End with CNTL/Z.
    Rack1SW1(config)#ip route 5.0.0.0 255.0.0.0 192.168.1.6
    Rack1SW1(config)#
    *Mar 4 22:38:27.304: IP-Static: 5.0.0.0 255.0.0.0 192.168.1.6 Path = 2 5 6 8,
    route table deleted, recursive flag set
    Rack1SW1(config)#
    Studying for CCIE and drinking Home Brew
  • kryollakryolla Member Posts: 785
    Here is the second example the 3. network and the 5. network and why it is working

    Rack1SW1#sh ip route 192.168.1.6
    Routing entry for 128.0.0.0/1, supernet
    Known via "static", distance 1, metric 0 (connected)
    Routing Descriptor Blocks:
    * directly connected, via FastEthernet0/19
    Route metric is 0, traffic share count is 1


    Rack1SW1#sh ip route 10.1.2.2
    Routing entry for 0.0.0.0/1, supernet
    Known via "static", distance 1, metric 0 (connected)
    Routing Descriptor Blocks:
    * directly connected, via FastEthernet0/19
    Route metric is 0, traffic share count is 1

    Rack1SW1#

    It is using these 2 static routes
    ip route 0.0.0.0 128.0.0.0 FastEthernet0/19
    ip route 128.0.0.0 128.0.0.0 FastEthernet0/19

    The 3rd example is the same thing recursive failures
    To solve this put a static route for 10.1.2.2 to an exit interface
    or ip route 3.0.0.0 255.0.0.0 s0/0
    Studying for CCIE and drinking Home Brew
  • kryollakryolla Member Posts: 785
    the 4th and final example is not a recursion error its jut not getting installed. It has something to do with the path below.

    Rack1SW1#
    *Mar 5 00:19:58.028: IP-Static: 2.0.0.0 255.0.0.0 10.1.1.2 Path = 2 3 5 7, rou
    te table no change, recursive flag clear
    *Mar 5 00:19:58.028: IP-Static: 2.0.0.0 255.128.0.0 2.255.1.1 Path = 2 3 5 6 8
    , route table deleted, recursive flag clear
    *Mar 5 00:19:58.028: IP-Static: 2.0.0.0 255.240.0.0 2.255.1.1 Path = 2 3 5 6 8
    , route table deleted, recursive flag clear
    *Mar 5 00:19:58.032: IP-Static: 2.0.0.0 255.128.0.0 192.168.1.2 Path = 2 3 5 7
    , route table no change, recursive flag clear
    Studying for CCIE and drinking Home Brew
  • BennyLavaBennyLava Member Posts: 60 ■■□□□□□□□□
    I understand why the routes in the 2nd example are installed, I mainly included it to show that it behaved different than with just the default route configured in the 1st example. What I still don't understand is why 3.0.0.0 and 5.0.0.0 are installed in the 2nd example but not in the 1st. Their next-hop should match the default route but it seems like it is behaving classfully. I tried your debug and it shows this for the first example:

    *Mar 1 00:49:25.427: IP-Static: 0.0.0.0 0.0.0.0 Serial0/0 Path = 1, route table no change, recursive flag clear
    *Mar 1 00:49:25.427: IP-Static: 1.0.0.0 255.0.0.0 20.1.1.1 Path = 2 3 4 5 7, route table no change, recursive flag clear
    *Mar 1 00:49:25.427: IP-Static: 2.0.0.0 255.0.0.0 10.1.1.2 Path = 2 3 5 7, route table no change, recursive flag clear
    *Mar 1 00:49:25.427: IP-Static: 3.0.0.0 255.0.0.0 10.1.2.2 Path = 2 5 6 8, route table deleted, recursive flag set
    *Mar 1 00:49:25.427: IP-Static: 4.0.0.0 255.0.0.0 192.168.1.2 Path = 2 3 5 7, route table no change, recursive flag clear
    *Mar 1 00:49:25.427: IP-Static: 5.0.0.0 255.0.0.0 192.168.1.6 Path = 2 5 6 8, route table deleted, recursive flag set


    What do the numbers after Path mean?
  • BennyLavaBennyLava Member Posts: 60 ■■□□□□□□□□
    Can you explain why you think the 3rd example is a recursive failure? It seems to me that the next hop for 1.0.0.0, 3.0.0.0, and 5.0.0.0 should all match the default route, and the default route's next hop matches 10.1.1.0/24 out Serial0/0, so I don't see what the problem with these routes is.
  • kryollakryolla Member Posts: 785
    You figure a static route is pretty simple but this thing is giving me a head ache. For some reason it is not hitting the default route, maybe because there is an entry for the 10. network and 192.168.1 network thus being classfull but ip classless is configured. I also turned it off and still no change. It doesnt matter if you put the default route pointing to a ip address or interface, recursion still fails because it is not hitting the default. But in the 2nd example recursion happens to the 2 static routes. Now why would it recurse for example 2 but not a default route. Ive been trying to research this all day and I still cant explain the last example. I found this from the cisco docs but your last example is different. Maybe someone that is more familair with static routes will jump in. The CCIE lab does not cover static routes.

    The following example defines an invalid recursive IPv4 static route. This static route will not be inserted into the IPv4 routing table because it is self-recursive. The next hop of the static route, 192.168.1.0/30, resolves via the first static route 192.168.1.0/24, which is itself a recursive route (that is, it only specifies a next hop). The next hop of the first route, 192.168.1.0/24, resolves via the directly connected route via the serial interface 2/0. Therefore, the first static route would be used to resolve its own next hop.

    interface serial 2/0
    ip address 10.0.0.1 255.255.255.252
    ip route 192.168.1.0 255.255.255.0 10.0.0.2
    ip route 192.168.1.0 255.255.255.252 192.168.1.100

    In Routing TCP/IP vol1 there is a section on static routes which I will read this weekend and maybe I will have closure on this.
    Studying for CCIE and drinking Home Brew
  • BennyLavaBennyLava Member Posts: 60 ■■□□□□□□□□
    I saw that example in the Cisco docs and I don't understand why those routes wouldn't both be installed. If both routes were in the routing table, a packet to 192.168.1.1 would match 192.168.1.0/30 and a lookup on the next hop (192.168.1.100) would match 192.168.1.0/24. A lookup on the next hop for the /24 (10.0.0.2) would match the directly connected route on S2/0.

    I think that whatever is causing these routes to not be installed in the 3rd example, the 4th example, and the cisco doc example are all related. In all of these cases, the next-hop for routes that are not placed in the routing table resolves to a less specific route that includes the route in question. The default route obviously is the least specific route so that would explain why anything matching the default route as it's best match in the 3rd example is not put in the routing table. I've tried out several different route statements and have yet to find an example that goes against this idea. I don't understand why it would work this way though.
  • kryollakryolla Member Posts: 785
    for example 3 the 1. network is the same issue as example 4 and the 3 & 4. network is the same issue as example 1. I know how to fix these issues but I cant explain why it is happening.


    Rack1SW1(config)#do sh ip route | beg Gateway
    Gateway of last resort is 10.1.1.2 to network 0.0.0.0

    S 1.0.0.0/8 [1/0] via 20.1.1.1
    S 3.0.0.0/8 [1/0] via 10.1.2.2
    S 20.0.0.0/8 [1/0] via 10.1.1.2
    S 5.0.0.0/8 [1/0] via 192.168.1.6
    10.0.0.0/24 is subnetted, 2 subnets
    S 10.1.2.0 [1/0] via 10.1.1.2
    C 10.1.1.0 is directly connected, FastEthernet0/20
    192.168.1.0/30 is subnetted, 2 subnets
    C 192.168.1.0 is directly connected, FastEthernet0/19
    S 192.168.1.4 [1/0] via 192.168.1.2
    S* 0.0.0.0/0 [1/0] via 10.1.1.2

    Rack1SW1(config)#do sh run | inc ip route
    ip route static adjust-time 30
    ip route 0.0.0.0 0.0.0.0 10.1.1.2
    ip route 1.0.0.0 255.0.0.0 20.1.1.1
    ip route 3.0.0.0 255.0.0.0 10.1.2.2
    ip route 5.0.0.0 255.0.0.0 192.168.1.6
    ip route 10.1.2.0 255.255.255.0 10.1.1.2
    ip route 20.0.0.0 255.0.0.0 10.1.1.2
    ip route 192.168.1.4 255.255.255.252 192.168.1.2
    Rack1SW1(config)#
    Studying for CCIE and drinking Home Brew
  • EdTheLadEdTheLad Member Posts: 2,111 ■■■■□□□□□□
    kryolla wrote: »
    You figure a static route is pretty simple but this thing is giving me a head ache. For some reason it is not hitting the default route, maybe because there is an entry for the 10. network and 192.168.1 network thus being classfull but ip classless is configured.

    Glad to see the penny finally dropped and you see the issue. icon_smile.gif
    Networking, sometimes i love it, mostly i hate it.Its all about the $$$$
  • kryollakryolla Member Posts: 785
    EdTheLad wrote: »
    Glad to see the penny finally dropped and you see the issue. icon_smile.gif


    The issue is still kinda blurry because ip classless is configured buy why isnt it recursing to the default? Also why in example 3 when the default is configured with an ip the 1. network wont recurse to it but it will when the default is configured with an exit interface.

    I will ponder this while I drink some of my home brew

    Mar 1 01:50:24.699: IP-Static: 1.0.0.0 255.0.0.0 20.1.1.1 Path = 2 3 5 6 8, route table deleted, recursive flag clear
    No recursive error but why is it being deleted from RIB

    *Mar 1 01:43:43.863: IP-Static: 5.0.0.0 255.0.0.0 192.168.1.6 Path = 2 5 6 8, route table deleted, recursive flag set
    recursive error but why isnt it recursing to the default
    Studying for CCIE and drinking Home Brew
  • EdTheLadEdTheLad Member Posts: 2,111 ■■■■□□□□□□
    Yes, i don't know why, i just saw the similarity between classful forwarding behavior, i've no time to research this as i started working on a new cable project last week.I'm up to my eyes in the frequency domain.
    Networking, sometimes i love it, mostly i hate it.Its all about the $$$$
  • BennyLavaBennyLava Member Posts: 60 ■■□□□□□□□□
    Have either of you (or anyone else) found out anything else about either of these issues? I've tried searching around a little bit more but haven't been able to find anything yet to explain them.
  • kryollakryolla Member Posts: 785
    I talked to Scott Morris from IE and he said from a design perspective it didnt make sense that all those static routes are going through the same path but didnt mentioned anything about the internal workings of the IOS and why it wasn't getting into the routing table. If you wanted a longer match to go a different route it would probably work. I chalked this lesson up as it is what it is. I didnt want to bother him with too much questions but I did put in my question list for when I take the lab bootcamp.

    EDIT: A static route that points to a next hop address is resolved by classful lookup in the routing table and can be bypasses by pointing it to an interface even though IP classless is configured. Source is Cisco IP Routing Book
    Studying for CCIE and drinking Home Brew
Sign In or Register to comment.