Saturday, July 5, 2008

RIP - default routes

This blog covers how to advertise a default route in RIP, how to suppress the smaller routes, and how to conditionally advertise the default route based on the appearance of another route.

The Network:

[R1]---FR---[R4]

Frame network: 10.0.0.0/8

R1(config)#router rip
R1(config-router)#default-information originate ?
route-map Route-map reference


R1(config-router)#default-information originate

R4#sho ip route | begin Gate
Gateway of last resort is 10.0.0.1 to network 0.0.0.0

1.0.0.0/16 is subnetted, 4 subnets
R 1.1.0.0 [120/1] via 10.0.0.1, 00:00:21, Serial1/0
R 1.0.0.0 [120/1] via 10.0.0.1, 00:00:21, Serial1/0
R 1.3.0.0 [120/1] via 10.0.0.1, 00:00:21, Serial1/0
R 1.2.0.0 [120/1] via 10.0.0.1, 00:00:21, Serial1/0
C 4.0.0.0/8 is directly connected, Loopback0
C 10.0.0.0/8 is directly connected, Serial1/0
R 11.0.0.0/8 [120/1] via 10.0.0.1, 00:00:21, Serial1/0
R* 0.0.0.0/0 [120/1] via 10.0.0.1, 00:00:21, Serial1/0

How do we prevent RIP from advertising the other RIP routes? We can filter them with a distribute/prefix list:

R1(config)#ip prefix-list DEFAULT permit 0.0.0.0/0
R1(config)#router rip
R1(config-router)#distribute-list prefix DEFAULT out

R4#sho ip route | begin Gate
Gateway of last resort is 10.0.0.1 to network 0.0.0.0

C 4.0.0.0/8 is directly connected, Loopback0
C 10.0.0.0/8 is directly connected, Serial1/0
R* 0.0.0.0/0 [120/1] via 10.0.0.1, 00:00:04, Serial1/0

Conditional default route advertisement:

Suppose we want RIP to only advertise a default route if a different route exists in it's route table, we can use a route-map with default-information originate. In our example R1 has a loopback 1.3.0.1/16. If this looopback is up, we want R1 to advertise a default route, if it is down, then we don't want the default route advertised. Here's how we do it:

R1(config)#ip prefix-list LOOPBACK3 permit 1.3.0.0/16
R1(config)#route-map LOOPBACK3
R1(config-route-map)#match ip address prefix-list LOOPBACK3
R1(config-route-map)#exit
R1(config)#router rip
R1(config-router)#default-information originate route-map LOOPBACK3
R1(config-router)#int lo 3
R1(config-if)#ip address 1.3.0.1 255.255.0.0
R1(config-if)#shut

Now check R4:

R4#sho ip route | begin Gate
Gateway of last resort is not set

C 4.0.0.0/8 is directly connected, Loopback0
C 10.0.0.0/8 is directly connected, Serial1/0
R4#

Let's bring up the loopback now on R3:

R1(config)#int lo 3
R1(config-if)#no shut

R4#sho ip route | begin Gate
Gateway of last resort is 10.0.0.1 to network 0.0.0.0

C 4.0.0.0/8 is directly connected, Loopback0
C 10.0.0.0/8 is directly connected, Serial1/0
R* 0.0.0.0/0 [120/1] via 10.0.0.1, 00:00:09, Serial1/0
R4#

This may be my last RIP blog for awhile, I am not sure what else to lab, maybe offset-lists in the future or when I start doing more advanced full-scale practice labs.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.