rip: seperate ways to inject a default-route

Hi!
Right now I am going to lab up default-routing with RIP. By the way…NO this post has nothing to do with the song “seperate ways” by “moby” :)…although its a very good song. I am going to show which methods can be used to inject a default route into a rip domain. Dont blame me if I forgot one…comment :).

In general there are roughly 6 ways to inject a default route. Here they are:

1) summary address
2) redistribution
3) default-information originate
4) default-information originate with route-map
5) default-information originate with conditional route-map
6) default-information originate with reliable conditional route-map

So we also need a little topology. Two routers arent enough for that so we need at least 3 to show how ALL of those work.

In our case R1 will inject a default-route to provide access to the internet.

Setup:
– all routers are in a RIPv2 domain with auto-summary disabled
– every router has a loopback interface corresponding to its number R1 = 1.1.1.1/32 and so on

Goal:
– R1 will inject a default route based on different methods

First lets check if everythin is clear and converged.

R1#sh ip route rip
2.0.0.0/32 is subnetted, 1 subnets
R 2.2.2.2 [120/1] via 172.16.21.2, 00:00:12, FastEthernet0/0
3.0.0.0/32 is subnetted, 1 subnets
R 3.3.3.3 [120/1] via 172.16.31.2, 00:00:13, FastEthernet0/1
172.16.0.0/30 is subnetted, 3 subnets
R 172.16.32.0 [120/1] via 172.16.31.2, 00:00:13, FastEthernet0/1
[120/1] via 172.16.21.2, 00:00:12, FastEthernet0/0

R2#sh ip route rip
1.0.0.0/32 is subnetted, 1 subnets
R 1.1.1.1 [120/1] via 172.16.21.1, 00:00:15, FastEthernet0/0
3.0.0.0/32 is subnetted, 1 subnets
R 3.3.3.3 [120/1] via 172.16.32.2, 00:00:13, FastEthernet0/1
172.16.0.0/30 is subnetted, 3 subnets
R 172.16.31.0 [120/1] via 172.16.32.2, 00:00:13, FastEthernet0/1
[120/1] via 172.16.21.1, 00:00:15, FastEthernet0/0

R3#sh ip route rip
1.0.0.0/32 is subnetted, 1 subnets
R 1.1.1.1 [120/1] via 172.16.31.1, 00:00:15, FastEthernet0/1
2.0.0.0/32 is subnetted, 1 subnets
R 2.2.2.2 [120/1] via 172.16.32.1, 00:00:12, FastEthernet0/0
172.16.0.0/30 is subnetted, 3 subnets
R 172.16.21.0 [120/1] via 172.16.32.1, 00:00:12, FastEthernet0/0
[120/1] via 172.16.31.1, 00:00:15, FastEthernet0/1

Looks good. Now we will begin with step 1.

1) summary-address

Under R1 we will use the “summary-address” command to inject a default router into the rip domain.

R1(config)#int fa0/0
R1(config-if)#ip summary-address rip 0.0.0.0 0.0.0.0
R1(config-if)#int fa0/1
R1(config-if)#ip summary-address rip 0.0.0.0 0.0.0.0

So lets wait a little for convergence and check the FIB of R2:

R2#sh ip route rip
1.0.0.0/32 is subnetted, 1 subnets
R 1.1.1.1 [120/2] via 172.16.32.2, 00:00:13, FastEthernet0/1
3.0.0.0/32 is subnetted, 1 subnets
R 3.3.3.3 [120/1] via 172.16.32.2, 00:00:13, FastEthernet0/1
172.16.0.0/30 is subnetted, 3 subnets
R 172.16.31.0 [120/1] via 172.16.32.2, 00:00:13, FastEthernet0/1
R* 0.0.0.0/0 [120/1] via 172.16.21.1, 00:00:07, FastEthernet0/0

Ok there is a default route, perfect..but wait…where has the entry gone to the 172.16.31.0/30 network? There were formerly two of them as this network can be equally reached via R1 and R3.
Answer: The summary-route suppresses more specific updates. So the network is not longer load-balanced.

NOTE:
When doing a summary-address under an interface or more one should create a static route pointing to null0 for 0.0.0.0/0. This is for preventing the router learning its own update about 0.0.0.0/0 letting the metric raise to “inaccessible” metric and preventing loops.

2) Redistirbution

So next thing we can do is redistributing a static route. For redistribution we first need a static route. That static route usually points to the next-hop, in our case it would be a router providing internet access to us. I will let it point to “null0” because I dont have one (or at least I am too lazy to configure one now).

NOTE:
I deconfigured the summarization of point 1).

R1(config)#ip route 0.0.0.0 0.0.0.0 null0
R1(config)#router rip
R1(config-router)#redistribute static

Lets check the FIB of R2.

R2#sh ip route rip
1.0.0.0/32 is subnetted, 1 subnets
R 1.1.1.1 [120/1] via 172.16.21.1, 00:00:03, FastEthernet0/0
3.0.0.0/32 is subnetted, 1 subnets
R 3.3.3.3 [120/1] via 172.16.32.2, 00:00:03, FastEthernet0/1
172.16.0.0/30 is subnetted, 3 subnets
R 172.16.31.0 [120/1] via 172.16.32.2, 00:00:03, FastEthernet0/1
[120/1] via 172.16.21.1, 00:00:03, FastEthernet0/0
R* 0.0.0.0/0 [120/1] via 172.16.21.1, 00:00:03, FastEthernet0/0

There it is and the advantage now is that in that case the other specific routes originated by R1 e.g. the loopback address are not pruned and are kept in the FIB.

3) default-information originate

NOTE:
I deconfigured the static route and the redistribute static under the routing process.
We can now issue the “default-information originate” command under the rip process to inject a default route into the rip domain. That route is automatically sent through all rip-enabled interfaces, like it is with the static redistribution.

R1(config)#router rip
R1(config-router)#default-information originate

Lets check the FIB of R2:

R2# sh ip route rip
1.0.0.0/32 is subnetted, 1 subnets
R 1.1.1.1 [120/1] via 172.16.21.1, 00:00:00, FastEthernet0/0
3.0.0.0/32 is subnetted, 1 subnets
R 3.3.3.3 [120/1] via 172.16.32.2, 00:00:07, FastEthernet0/1
172.16.0.0/30 is subnetted, 3 subnets
R 172.16.31.0 [120/1] via 172.16.32.2, 00:00:07, FastEthernet0/1
[120/1] via 172.16.21.1, 00:00:00, FastEthernet0/0
R* 0.0.0.0/0 [120/1] via 172.16.21.1, 00:00:00, FastEthernet0/0

Very good it works. And here also the other more specific networks are also kept in the routing table.
Drawback of that solution is that we cannot specify on which interface the default route is injected into the RIP domain.

4) default-information originate with route-map

Ok same thing like in 3) but we will specify and exit interface where the route-map is sent out. For me it was a little bit confusing at the beginning because the route-map is used in a non-standard fashion in our case. We will first need to configure a route map where we declare the interface where the default route should be sent out. All other interfaces are denied then.

R1(config)#default-in
R1(config)#route-map RMAP-DEFAULT-FA00
R1(config-route-map)#set interface fastEthernet 0/0

R1(config)#router rip
R1(config-router)#default-information originate route-map RMAP-DEFAULT-FA00

To check if it works we need to have a look at the FIB of R3. R3 usually should have its deault route directly via 172.16.31.1 due to hop-count.

R3#sh ip route rip
1.0.0.0/32 is subnetted, 1 subnets
R 1.1.1.1 [120/1] via 172.16.31.1, 00:00:26, FastEthernet0/1
2.0.0.0/32 is subnetted, 1 subnets
R 2.2.2.2 [120/1] via 172.16.32.1, 00:00:07, FastEthernet0/0
172.16.0.0/30 is subnetted, 3 subnets
R 172.16.21.0 [120/1] via 172.16.32.1, 00:00:07, FastEthernet0/0
[120/1] via 172.16.31.1, 00:00:26, FastEthernet0/1
R* 0.0.0.0/0 [120/8] via 172.16.32.1, 00:00:03, FastEthernet0/0

As we can see R3 default routes packets to R2, which means that R3 does not get a default route via Fa0/1 of R1. Last check: We shutdown fa0/0 of R1 and the default-route should then disappear.

R1(config)#int fa0/0
R1(config-if)#shut

R2#sh ip route rip
1.0.0.0/32 is subnetted, 1 subnets
R 1.1.1.1 [120/1] via 172.16.21.1, 00:00:33, FastEthernet0/0
3.0.0.0/32 is subnetted, 1 subnets
R 3.3.3.3 [120/1] via 172.16.32.2, 00:00:02, FastEthernet0/1
172.16.0.0/30 is subnetted, 3 subnets
R 172.16.31.0 [120/1] via 172.16.32.2, 00:00:02, FastEthernet0/1
[120/1] via 172.16.21.1, 00:00:33, FastEthernet0/0

Its gone. Perfect.

5) default-information originate with conditional route-map

Another use of the route-map in our case is a “match” value instead of a “set” value. We can use the route map to say “inject a default route when some criterias are present”. What I will do for simplicity here is to let R1 inject a default-route into the RIP domain as long as the loopback of R2 is in the FIB of R1. Ok sure…that does not make sense in real life scenarios, this is just to show/explain the function.

R1(config)#route-map RMAP-COND-DEFAULT
R1(config-route-map)#match ip address 2
R1(config-route-map)#access-list 2 permit host 2.2.2.2
R1(config)#router rip
R1(config-router)#default-information originate route-map RMAP-COND-DEFAULT

Ok lets check R2 if the default route is available.

R2#sh ip route rip
1.0.0.0/32 is subnetted, 1 subnets
R 1.1.1.1 [120/1] via 172.16.21.1, 00:00:19, FastEthernet0/0
3.0.0.0/32 is subnetted, 1 subnets
R 3.3.3.3 [120/1] via 172.16.32.2, 00:00:08, FastEthernet0/1
172.16.0.0/30 is subnetted, 3 subnets
R 172.16.31.0 [120/1] via 172.16.32.2, 00:00:08, FastEthernet0/1
[120/1] via 172.16.21.1, 00:00:19, FastEthernet0/0
R* 0.0.0.0/0 [120/1] via 172.16.21.1, 00:00:19, FastEthernet0/0

Yes it is. Now we will shutdown R2s loopback0 to remove the entry 2.2.2.2/32 in the FIB of R1.

R2(config)#int lo0
R2(config-if)#shut
R2(config-if)#
*Mar 1 15:16:25.144: %LINK-5-CHANGED: Interface Loopback0, changed state to administratively down
*Mar 1 15:16:26.144: %LINEPROTO-5-UPDOWN: Line protocol on Interface Loopback0, changed state to down

And indeed…

R2#sh ip route rip
1.0.0.0/32 is subnetted, 1 subnets
R 1.1.1.1 [120/1] via 172.16.21.1, 00:00:00, FastEthernet0/0
3.0.0.0/32 is subnetted, 1 subnets
R 3.3.3.3 [120/1] via 172.16.32.2, 00:00:17, FastEthernet0/1
172.16.0.0/30 is subnetted, 3 subnets
R 172.16.31.0 [120/1] via 172.16.32.2, 00:00:17, FastEthernet0/1
[120/1] via 172.16.21.1, 00:00:00, FastEthernet0/0

The default-route is gone!

6) default-information originate with conditional reliable route-map

Well now the last thing is that we can add “reliable” information to our route-map. With the conditions we used in 5) we can only take care of conditions that are brought to us by routing-protocols etc. With reliable here we want to actively track some cases. To do this we use the IOS feature called IP SLA.
what I am going to do now is I will actively track the loopback of R2 (could be of course any other ip address) with icmp echoes and will inject a default route into the rip domain as long as R2s loopback is available. I will not explain the “ip sla” and the “track” command here, please refer to the Cisco IOS documentation.

R1(config)#ip sla 1
R1(config-ip-sla)#icmp-echo 2.2.2.2 source-interface lo0
R1(config-ip-sla-echo)#timeout 1000
R1(config-ip-sla-echo)#frequency 2
R1(config-ip-sla-echo)#ip sla schedule 1 start now life forever
R1(config)#track 1 rtr 1 state

Lets check if the track is up!

R1#sh track
Track 1
Response Time Reporter 1 state
State is Up
6 changes, last change 00:00:11
Latest operation return code: OK
Latest RTT (millisecs) 120

Ok good. Now within a route-map we cannot match for tracks, but we can match for routes that are connected to a track. So we first will establish a dummy-route that is installed in the routing table which is only kept in the FIB when the track “1” is “up”

R1(config)#ip route 169.254.0.1 255.255.255.255 null0 track 1

R1#sh ip route 169.254.0.1
Routing entry for 169.254.0.1/32
Known via "static", distance 1, metric 0 (connected)
Routing Descriptor Blocks:
* directly connected, via Null0
Route metric is 0, traffic share count is 1

Now we can let the route-map match for the dummy route.

R1(config)#route-map RMAP-RELIABLE-COND
R1(config-route-map)#match ip address prefix-list DUMMY-ROUTE
R1(config-route-map)#ip prefix-list DUMMY-ROUTE seq 10 permit 169.254.0.1/32
R1(config)#router rip
R1(config-router)#default-information originate route-map RMAP-RELIABLE-COND

Lets see if the default route is injected into the rip domain.

R2#sh ip route rip
1.0.0.0/32 is subnetted, 1 subnets
R 1.1.1.1 [120/1] via 172.16.21.1, 00:00:13, FastEthernet0/0
3.0.0.0/32 is subnetted, 1 subnets
R 3.3.3.3 [120/1] via 172.16.32.2, 00:00:07, FastEthernet0/1
172.16.0.0/30 is subnetted, 3 subnets
R 172.16.31.0 [120/1] via 172.16.32.2, 00:00:07, FastEthernet0/1
[120/1] via 172.16.21.1, 00:00:13, FastEthernet0/0
R* 0.0.0.0/0 [120/1] via 172.16.21.1, 00:00:13, FastEthernet0/0

Ok its there. Now we will let track 1 fail by shutting down the loopback of R2.

R2(config)#int lo0
R2(config-if)#shut

R1 already shows an error message for track 1:

*Mar 1 15:43:23.536: %TRACKING-5-STATE: 1 rtr 1 state Up->Down
R1(config-router)#do sh track
Track 1
Response Time Reporter 1 state
State is Down
7 changes, last change 00:00:14
Latest operation return code: Timeout
Tracked by:
STATIC-IP-ROUTING 0
!
R1#sh ip route 169.254.0.1
% Network not in table

Now R2 should not see a default route any longer.

R2#sh ip route rip
1.0.0.0/32 is subnetted, 1 subnets
R 1.1.1.1 [120/1] via 172.16.21.1, 00:00:29, FastEthernet0/0
3.0.0.0/32 is subnetted, 1 subnets
R 3.3.3.3 [120/1] via 172.16.32.2, 00:00:06, FastEthernet0/1
172.16.0.0/30 is subnetted, 3 subnets
R 172.16.31.0 [120/1] via 172.16.32.2, 00:00:06, FastEthernet0/1
[120/1] via 172.16.21.1, 00:00:29, FastEthernet0/0

Works :). With the IP SLA statement you can define a lot of conditions and scenarios, just have a look at the documentation.

Feel free to comment!
Regards!

Advertisements

About markus.wirth

Living near Limburg in Germany, working as a Network Engineer around Frankfurt am Main.
This entry was posted in RIP and tagged , , , , , , , , , , , , , , , , . Bookmark the permalink.

3 Responses to rip: seperate ways to inject a default-route

  1. sheno says:

    great topic bro.

    actually i have first comment on

    1) summary-address
    u said
    When doing a summary-address under an interface or more one should create a static route pointing to null0 for 0.0.0.0/0. This is for preventing the router learning its own update about 0.0.0.0/0 letting the metric raise to “inaccessible” metric and preventing loops.

    now lets imagine together that R1 only send the default summary on interface fa0/1
    and not send on fa0/0
    so now the route will goto R2 THEN R3 AND then back to R1 again and make the loop

    ok i believe that

    but when u do a summary on the interface fa0/1 and fa0/0
    then R1 WILL send to R2 and R2 SEND to R3 and when R3 is tring to send to R1
    it will automatic stop

    because it will find a f0/0 send the same route 0.0.0.0/0 so as we know from the split horizon mechanism
    R1 SEND VIA F0/0 the default route
    so it cant receive the default route again via R3 on the same interface

    because split horizon will stop that and stoop the loop

    so as i thought
    if we are deploy the summary only via one R1 interface so we have to make the null static route

    but if we deploy the summary via the R1 f0/0 and f0/1

    so there is no need for static null because split horizon will be charge in and play its rule to stop the loop.

    best regards for this great topic

  2. Pingback: Another RIP sample « Routed Hues

  3. Mohamed says:

    You are great… many thanks for this post.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s