Saturday, December 17, 2011

DEFAULT INFORMATION ORIGINATE RIP

For rip default routing we have a few options the previously discussed default network or the newer default-information originate command which is run under the rip
process
router rip
default-information originate

this will send out a default route out all rip enabled interfaces
You may want to filter which interfaces you send it out you can do this with a route map
route-map DEFAULT
set int fa0/7
router rip
default-information originate route-map DEFAULT
this will only send the default route out the fa0/7 interface
as you do this with a route map you have many advanced configuration you can do

LAB
---




R2 connected to sw2 which is connected to sw1 which is connected to r5

r5 will act as the service provider router with sw1 being our ce router

also R2 connects to sw2 which connects to sw3 which connects to BB3
BB3 will act as another service provider pe router
So we will run rip protocol version 2 between all routers to ensure reachability


The scenerio will be that sw1 will advertise a default route only if it can ping the service provider r5 loopback of 5.5.5.5 if 5.5.5.5 goes down sw 3 will advertise the default route with next hop of BB3
We will use ip sla and enhanced object tracking to get around the potential issue of the link protocol not being a good inicator of reachability via r5
r5 will not advertise 5.5.5.5 sw1 will have a static route pointing at it
bb3 will not advertise 3.3.3.3 sw 3 will have a static route pointing at it
so the result we want is that when lo0 on r5 5.5.5.5 is up switch 1 will advertise default router we should be able to ping 5.5.5.5 from r2 but not 3.3.3.3
when lo0 on r5 goes down we should get the default route from s3 we should be able to ping 3.3.3.3 but not 5.5.5.5

sw3
----
ok so on switch 3 i issued the default-information originate command
switch3(config-router)#do sh run | begin router rip
router rip
 version 2
 network 172.5.0.0
 network 172.25.0.0
 default-information originate

This created a default route om sw2 of 1 hop with admin distance of rip 120 now the issue is that i want this to be the backup default route. I can say for certain that this will not be selected over sw1 default route as both are 120 admin and 1 hop away so i need a way of increasing either the hop count or the admin distance for the default route. If i only could do something on sw3 i would do an offset-list matching a standard acess list of permit 0.0.0.0 so matching the default route and add 2 hops or something just to offset it.
For this i will do another technique on sw2 i will set the admin distance 140 so when i create the default route on switch 1 it will be preferred

sw2
----

access-list 10 permit 0.0.0.0
switch2#sh run | begin router rip
router rip
 version 2
 network 172.25.0.0
 network 192.168.1.0
 distance 130 172.25.13.2 0.0.0.0 10
 no auto-summary
!
switch2#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 172.25.13.2 to network 0.0.0.0
     172.5.0.0/24 is subnetted, 1 subnets
R       172.5.5.0 [120/1] via 172.25.13.2, 00:00:21, Port-channel1
     172.25.0.0/24 is subnetted, 1 subnets
C       172.25.13.0 is directly connected, Port-channel1
     10.0.0.0/24 is subnetted, 2 subnets
R       10.164.50.0 [120/1] via 192.168.1.2, 00:00:20, Port-channel2
C       10.164.49.0 is directly connected, Vlan100
C    192.168.1.0/24 is directly connected, Port-channel2
R*   0.0.0.0/0 [130/1] via 172.25.13.2, 00:00:21, Port-channel1
switch2#

sw1
---
My current ios does not support ip sla so i am using a very similar tool known as saa

switch1#sh run | begin rtr
rtr 1
 type echo protocol ipIcmpEcho 5.5.5.5
 timeout 2000
 frequency 5
rtr schedule 1 life forever start-time now

do a enhanced object tracking
switch1(config)#track 1 rtr 1
switch1(config-track)#

switch1#sh rtr oper
Entry number: 1
Modification time: *01:33:43.093 UTC Mon Mar 1 1993
Number of Octets Used by this Entry: 2288
Number of operations attempted: 82
Number of operations skipped: 0
Current seconds left in Life: Forever
Operational state of entry: Active
Last time this entry was reset: Never
Connection loss occurred: FALSE
Timeout occurred: FALSE
Over thresholds occurred: FALSE
Latest RTT (milliseconds): 1
Latest operation start time: *01:40:28.095 UTC Mon Mar 1 1993
Latest operation return code: OK
RTT Values:
RTTAvg: 1       RTTMin: 1       RTTMax: 1
NumOfRTT: 1     RTTSum: 1       RTTSum2: 1

I am going now use a technique of using a place holder ip address this is a non routable reserved ip subnt that can be used for opertation like this the address i will use is 169.254.0.1
#ip route 169.254.0.1 255.255.255.255 null0 track 1
so the place holder route will remain in the table as long as the track 1 rtr result is ok i.e 5.5.5.5 is up and replying to ping
next we will do a prefix list to match the PLACE HOLDER route
switch1(config)#ip prefix-list PLACE permit 169.254.0.1/32
switch1(config)#route-map PLACE
switch1(config-route-map)#match ip address prefix-list PLACE
then a route map to match the prefix list we will then assign the route-map to default-originate command so if the place holder route is not in the routing table because the track of 5.5.5.5 is not ok the prefix list will not match the place holder and the route-map will not match the prefix list this will then cause the default route not to advertise via sw1

switch1(config)#router rip
switch1(config-router)#default-inform originate route-map PLACE
switch1(config-router)#


current operational state of rtr is ok  It is not putting the default route to s1
in s2 routing table it is maintaining the higher admin distance default route to sw3 i am not sure why
I played around with it a bit if i do no default-information originate on s3 the sw1 default route comes in if i do a default-information originate on s3 again the route to sw1 remains it does not seem to preempt
I put a static route with admin distance of 150 pointing at the backup route
ip route 0.0.0.0 0.0.0.0  172.25.13.2 150

switch2#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 192.168.1.2 to network 0.0.0.0
     172.5.0.0/24 is subnetted, 1 subnets
R       172.5.5.0 [120/1] via 172.25.13.2, 00:00:17, Port-channel1
     172.25.0.0/24 is subnetted, 1 subnets
C       172.25.13.0 is directly connected, Port-channel1
     10.0.0.0/24 is subnetted, 2 subnets
R       10.164.50.0 [120/1] via 192.168.1.2, 00:00:21, Port-channel2
C       10.164.49.0 is directly connected, Vlan100
C    192.168.1.0/24 is directly connected, Port-channel2
R*   0.0.0.0/0 [120/1] via 192.168.1.2, 00:00:21, Port-channel2
switch2#
now in the routing table i am going the primary route notice on sw 2 i do not have a route to 5.5.5.5 so in order to get there i have to use the default route i will tracert from r2 to see what path i take

r2#traceroute 5.5.5.5 ttl 0 5
Type escape sequence to abort.
Tracing the route to 5.5.5.5
  0 10.164.49.1 0 msec 0 msec 0 msec
  1 10.164.49.1 0 msec 0 msec 4 msec
  2 192.168.1.2 0 msec 4 msec 4 msec
  3 10.164.50.1 0 msec *  0 msec
r2#
 it is going the path via sw1 as expected
i can also ping 5.5.5.5

r2#ping 5.5.5.5
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 5.5.5.5, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 1/2/4 ms
r2#

ok now i will shut int lo0 on r5 this should take the default route out of the network via sw1 and the default route via sw3 should come in to the network

r5>en
r5#config t
Enter configuration commands, one per line.  End with CNTL/Z.
r5(config)#int lo0
r5(config-if)#shut
r5(config-if)#

it looks good from sw2 perspective
sw2
----
switch2#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 172.25.13.2 to network 0.0.0.0
     172.5.0.0/24 is subnetted, 1 subnets
R       172.5.5.0 [120/1] via 172.25.13.2, 00:00:11, Port-channel1
     172.25.0.0/24 is subnetted, 1 subnets
C       172.25.13.0 is directly connected, Port-channel1
     10.0.0.0/24 is subnetted, 2 subnets
R       10.164.50.0 [120/1] via 192.168.1.2, 00:00:09, Port-channel2
C       10.164.49.0 is directly connected, Vlan100
C    192.168.1.0/24 is directly connected, Port-channel2
R*   0.0.0.0/0 [130/1] via 172.25.13.2, 00:00:11, Port-channel1
switch2#

r2
---
2#ping 5.5.5.5
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 5.5.5.5, timeout is 2 seconds:
U.U.U
Success rate is 0 percent (0/5)
r2#ping 3.3.3.3
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 3.3.3.3, timeout is 2 seconds:
.!!!!
Success rate is 80 percent (4/5), round-trip min/avg/max = 4/4/4 ms
r2#traceroute 3.3.3.3
Type escape sequence to abort.
Tracing the route to 3.3.3.3
  1 10.164.49.1 0 msec 4 msec 0 msec
  2 172.25.13.2 4 msec 4 msec 0 msec
  3 172.5.5.2 4 msec *  0 msec
r2#

i can not ping 5.5.5.5 as expected but i can ping 3.3.3.3 which is simulating the other service provider
I am still not sure why the route to sw3 remained when the loopback 5 was availible i will need to investigate more


update
--------

i see what the earlier issue was of the default route not reappearing

Ok i was able to figure this out. It was not split horizons.
I had enabled on
s1
router rip
default-information originate


this generated a new default route with hop count metric of 1 as there was no default route in the routing table

I then had enable

router rip
default-information originate

with an offset list on the 0.0.0.0 set it to 10 hops away


What was happening was that when the lo0 was shutdown and the enhanced object track took out the original defaul route via sw1.

Switch 1 recieved the default route from switch 3

so this default route was then in the routing table with a metric of 12

when the loopback on  r5 was brought backup.

The enhanced object tracking went to state up and s1 default-information originate condition was true it started advertising the default route again  but it was advertising the default route it had in it routing table the one it recieved from switch 3 via sw2 with the metric of 12 hops when i disabled split horizon it was advertising this back to sw2 with metric of 13 hops so obviously switch 2 just kept it 12 hop metric via sw3

The solution was to put a static ip route 0 0 fa0/0 on sw1 . This time when lo0 went s1 kept it static route not recieving the default route from sw3 via sw2. Sw 2 switched to the default route via s3. When i brought backup the lo0 s1 started advertising it lower metric static and was choosen by s2 as preference.
So working as expected

No comments:

Post a Comment