Previous section   Next section

Recipe 6.5 Creating a Default Route in RIP

6.5.1 Problem

You want RIP to propagate a default route.

6.5.2 Solution

There are two ways to get RIP to propagate a default route. The preferred method is to use the default-information originate command as follows:

Router1#configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.
Router1(config)#ip route 0.0.0.0 0.0.0.0 172.25.1.1
Router1(config)#router rip
Router1(config-router)#default-information originate
Router1(config-router)#end
Router1#

In simple situations, you can accomplish the same thing by just redistributing a static route:

Router1#configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.
Router1(config)#ip route 0.0.0.0 0.0.0.0 172.25.1.1
Router1(config)#access-list 7 permit 0.0.0.0
Router1(config)#router rip
Router1(config-router)#redistribute static
Router1(config-router)#distribute-list 7 out static
Router1(config-router)#end
Router1#

6.5.3 Discussion

There are two main advantages to using default originate instead of simply redistributing static routes. The first is that you may have other static routes on your router that you do not want to distribute, or that you want to distribute with a different default metric. In this case, if you just use redistribute static, you will need to filter out the unwanted routes using route maps, as shown in Recipe 6.4.

The other important advantage is that the default originate option lets you create a conditional default route. This means that you can configure the router to create and distribute a default route only if some other route is present. Usually this other route points to a distant network. If the route is present, it indicates that the router is able to see enough of the outside world to be a reliable default router:

Router1#configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.
Router1(config)#access-list 20 permit 192.168.55.0
Router1(config)#route-map DEFAULTROUTE permit 10
Router1(config-route-map)#match ip address 20
Router1(config-route-map)#exit 
Router1(config)#router rip
Router1(config-router)#default-information originate route-map DEFAULTROUTE
Router1(config-router)#end
Router1#

In this example, if the distant network 192.168.55.0 is present in the routing table, RIP will generate and distribute a default route. Usually you would use this type of configuration on the RIP router that forms a gateway to another network.

You can see how RIP distributes the default route with the show ip rip database command:

Router1#show ip rip database 0.0.0.0 0.0.0.0
0.0.0.0/0    redistributed
    [1] via 0.0.0.0, 
Router1#

6.5.4 See Also

Recipe 6.4


  Previous section   Next section
Top