Networking

Dynamic routing with RIP

Although RIP routing can take up precious CPU cycles, it may in some instances be your only option. RIP is a simple protocol to configure, and Todd Lammle is here to explain the gory details.

The Routing Information Protocol (RIP) was the first dynamic routing protocol to be used in an internetwork, so it was created and used primarily with UNIX hosts for the purpose of sharing routing information.

In my last Daily Drill Down, “Configuring static and default routing,” I covered both default and static routing, so now we're going to jump into dynamic RIP routing using Cisco routers.

The rumor mill
Like most early inceptions, RIP certainly does have its limitations! A biggie is that it's a distance vector routing protocol, meaning that it sends the complete routing table out all active interfaces by default on periodic time intervals. This is known as routing by rumor because a router that receives those broadcasts just believes the information, even though it has no way to verify that information as true (that the routes really exist).

Why use RIP?
So why do we use RIP at all? Well, we probably shouldn't. But sadly, there are some routers that don't run anything but RIP (or OSPF), so we're not always left with a choice. Maybe lurking somewhere in your network is an old legacy router, say, a UNIX router. That being the case, you just might be stuck supporting RIP on the network so this old horse can participate in the routing updates.

Because IT spending budgets aren't always unlimited, this Daily Drill Down will show you how to replace static routing and add dynamic routing using the RIP protocol. The good news is that adding RIP routing on a Cisco router is really easy, to say the least. The bad news is that what happens in the background is the problem! RIP sends out periodic updates every 30 seconds by default. This nasty habit can cause problems on already overly stressed serial links. But no worries—future Daily Drill Downs will cover some solutions and strategies for dealing with the bandwidth gremlins and evils caused by RIP routing.

Deleting the existing static routes
To show you how to configure RIP, I'm going to use the same figure I used in my last Daily Drill Down, “Configuring static and default routing” (see Figure A). I'm not doing that because I'm lazy—it'll really help you understand if we build on our existing model! Plus, before we begin, I'm going to show you how to remove our existing static routes and replace all that with the dynamic routing protocol RIP.

Figure A
Each router must have all three networks in the routing table in order to send packets through the internetwork.


At this point, the routing tables look like this.

The 2500A router must know how to get to the 192.168.10.96 network, so a static route was used telling the router to forward all packets to 192.168.10.66, which is the next hop.

Next, let's look at the 2500B router.

The 2500B router has a static route that describes how to get to subnet 32 and a default route to the Internet.

Removing the static routes
First, before we can add RIP routing, we must remove the static routes, since the administrative distance of a static route is one (1) by default. RIP uses an administrative distance of 120 by default. If we added RIP without first removing the static routes, then RIP routes would never be updated and placed in the routing table.

From the 2500A router, we need to remove the route to subnet 96. Here is how that will look.

The routing table now only shows the directly connected routes.

From the 2500B router, we'll remove the static route to subnet 32, but leave the default route to the Internet.

Notice that the routing table now shows only the two directly connected and the default router to the Internet.

Configuring RIP routing
Now that the static routes have been removed, we can add the RIP routing protocol to each router and allow the dynamic routing to find each network and place these into the routing tables of both routers.

From the 2500A router, the router rip command is used to turn on RIP routing.

The router rip command turns on RIP routing and places you at the config-router prompt. The network command must be used to tell RIP which network you want advertised with RIP. Notice that this is a classful network address and a subnet address is not used. The router will now find all the subnets and advertise each one throughout the internetwork. RIP is a classful routing protocol, which means that every device on the network must use the same subnet mask.

Let's add RIP to the 2500B router.

Now that both routers have been configured with the RIP routing protocol, let's take a look at the routing tables.

The R’s represent a RIP-found route. The most interesting part of this output is the R*, which indicates a default route. We have a default route configured on the 2500B router, which is now being advertised by RIP as the network’s default route—perfect since that's our Internet connection!

Here's the routing table on the 2500B router.

This output tells us that the 32 subnet was found and is being advertised by the serial 0 interface of the 2500A router. The default route has been both found and advertised by RIP to the 2500A router.

Verifying RIP routing
The show ip route command is probably the best command to use when verifying your router’s configuration of routing protocols, but there are a few more commands that are pretty helpful, as well.

show ip protocols
The show ip protocols command provides routing protocol information, including the timers and neighbors found. >Here is an example from the 2500A router.

All configured routing protocols on the router will be displayed with this command, but only RIP is configured, so we only see RIP information. This command provides the update time, hold down and flush timers, as well as the neighbor's IP address and administrative distance.

Show protocols
Although the show protocols command displays no routing protocol information, it does provide a list of all configured interfaces and the logical addresses that are configured on each interface. This is truly very valuable information.
2500A#show protocols
Global values:
  Internet Protocol routing is enabled
Ethernet0 is up, line protocol is up
  Internet address is 192.168.10.33/27
Serial0 is up, line protocol is up
  Internet address is 192.168.10.65/27
Serial1 is administratively down, line protocol is down
2500A#


Debug ip rip
The debug ip rip command is a great way to see RIP updates being sent and received on the router. To turn off debugging, >use the no debug ip rip command or the undebug all command.

>Let's take this apart piece by piece, because this is important information.

Notice that the 2500A router is sending out Ethernet0 an update telling about the path to subnets 64 and 96. The metric is the hop count to each network. Since the 2500A router is connected to the 64 network, it's advertising that route in one hop. However, the 96 subnet is one hop away, so it will advertise that route as a hop count of 2. The default route is also being advertised as two hops away.

>Let's take a look at the next output.

Notice that network 32 is only being advertised out serial 0. Why? Because the 2500B router already knows about network 64 and 96. This is called the split-horizon rule, and it's used to stop incorrect information from being advertised throughout the internetwork. If networks 64 and 96 were advertised out serial 0 of the 2500A router, then the 2500B router might consider the 2500A router to get to the 96 subnet. That would be bad because it's incorrect; it's how network loops can occur.

Okay, now >let's look at what we are receiving.

The 2500B router is advertising two routers to the 2500A router. One describes how to get to the 96 subnet, and the other advertises the default route.

Suppressing RIP updates
But wait. Remember the Ethernet0 interface of 2500A advertising RIP networks? RIP is advertised out all active interface routes every 30 seconds by default. So what if we don't want RIP advertised out Ethernet0, or even worse, the serial 1 interface of the 2500B router that's connected to the Internet? Can you say “security problem”? Do you really want to advertise your network out to the Internet? We'll solve that little issue with the passive-interface command.

>Here is an example of stopping RIP from being sent out the Ethernet0 interface of the 2500A router and the serial 1 and Ethernet0 interfaces of the 2500B router.

Now, let's take a look at >a debug ip rip command from the 2500B router.

The 2500B router is now sending routing information out serial 0 only. Okay, let's check >the 2500A router with the debug ip rip command.

Cool! The 2500A router is now advertising the routing table only out serial 0 and not out Ethernet0.

Conclusion
One man's trash is another man's treasure—RIP routing is actually a good, fast routing protocol in smaller networks, but if you configure larger networks, you can be in for some serious trouble because RIP has a tendency to consume bandwidth and CPU processes!
0 comments

Editor's Picks