Previous section   Next section

Recipe 6.1 Configuring RIP Version 1

6.1.1 Problem

You want to run RIP on a simple network.

6.1.2 Solution

The following commands show how to configure basic RIP functionality:

Router2#configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.
Router2(config)#interface Ethernet0
Router2(config-if)#ip address 192.168.30.1 255.255.255.0
Router2(config-if)#interface Serial0.1
Router2(config-subif)#ip address 172.25.2.2 255.255.255.0
Router2(config-subif)#exit
Router2(config-router)# router rip
Router2(config-router)#network 172.25.0.0
Router2(config-router)#network 192.168.30.0
Router2(config-router)#end
Router2#

6.1.3 Discussion

You enable RIP for an interface by associating its IP address with a network. For example, the Serial0.1 interface in this example has an IP address of 172.25.2.2. So, if you want this interface to take part in RIP route distribution, you just need to include a network statement that includes its address:

Router2(config)#router rip
Router2(config-router)#network 172.25.0.0

If you have other interfaces that are also part of 172.25.0.0/16 on this router, they will take part in RIP as well. It's important to note that RIP network statements work with classful network addresses. Since 172.25.0.0 is a Class B network, the statement network 172.25.0.0 tells the router to include all interfaces in this range. Note, however, that the other address on this router, 192.168.30.1, is part of the Class C network 192.168.30.0/24, which is why we need the second network command. If your router has several addresses that belong to different network classes (for example, 192.168.x.0/24), you have to specify them all separately:

Router2(config)#router rip
Router2(config-router)#network 192.168.1.0
Router2(config-router)#network 192.168.2.0
Router2(config-router)#network 192.168.3.0

It can be somewhat confusing to know which networks to specify. If your router receives a route from another router, it will pass it along to other routers whether you have specified a network statement for this address or not. However, the router will only distribute information about directly connected routes if there is a network statement for these routes. And the router will exchange RIP information only through interfaces specified by network statements.

The show ip protocol command gives a lot of useful information about what interfaces and address ranges are involved in the routing protocol:

Router2#show ip protocol
Routing Protocol is "rip"
  Sending updates every 30 seconds, next due in 7 seconds
  Invalid after 180 seconds, hold down 0, flushed after 240
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  Redistributing: rip
  Default version control: send version 1, receive any version
    Interface             Send  Recv  Triggered RIP  Key-chain
     Ethernet0             1     1 2                                  
     Serial0.1             1     1 2                                  
  Automatic network summarization is in effect
  Maximum path: 4
  Routing for Networks:
    172.25.0.0
    192.168.30.0
  Routing Information Sources:
    Gateway         Distance      Last Update
    172.25.2.1           120      00:00:17
  Distance: (default is 120)
   
Router2#

As you can see from the output of this command, the router will send RIP Version 1 on both interfaces Ethernet0 and Serial0.1, but it will listen for both Versions 1 and 2. You can force the router to use only Version 1 to send and receive routing information for all interfaces with the following command:

Router2#configure terminal 
Enter configuration commands, one per line.  End with CNTL/Z.
Router2(config)#router rip
Router2(config-router)#version 1
Router2(config-router)#end
Router2#

However, it is usually better to restrict what you send rather than what you receive. That way, if another device is misconfigured to send the other version, it doesn't break the network. We will discuss how to configure different RIP version options in Recipe 6.13.

Once you have RIP running successfully between two or more routers, you can look at your routing table to see which routes the router is learning and from where it is learning them:

Router2#show ip route rip
R    172.22.0.0/16 [120/1] via 172.25.2.1, 00:00:00, Serial0.1
R    172.25.1.0/24 [120/1] via 172.25.2.1, 00:00:00, Serial0.1
R    192.168.20.0/24 [120/2] via 172.25.2.1, 00:00:00, Serial0.1
Router2#

This command just gives a subset of the output of the more general show ip route command discussed in Chapter 5. The example output shows that the router has learned that it can get to the destination network 192.168.20.0/24 through the next-hop router, 172.25.2.1, which is on interface Serial0.1.

The numbers in the square brackets, [120/2], are the administrative distance and the RIP metric, respectively. Cisco routers give all RIP routes a default administrative distance of 120. The metric value of 2 indicates the distance to this network. By default, the metric is the same as the number of hops, but you can adjust metric values to break this rule. We discuss how to change metric values in Recipe 6.3, Recipe 6.4, Recipe 6.5, and Recipe 6.8, and we talk about administrative distances in Chapter 5.

Another useful command for looking at RIP functions on your router is the show ip rip database command, introduced in IOS 12.0(6)T:

Router2#show ip rip database
172.22.0.0/16    auto-summary
172.22.0.0/16
    [1] via 172.25.2.1, 00:00:13, Serial0.1
172.25.0.0/16    auto-summary
172.25.1.0/24
    [1] via 172.25.2.1, 00:00:13, Serial0.1
172.25.2.0/24    directly connected, Serial0.1
192.168.20.0/24    auto-summary
192.168.20.0/24
    [2] via 172.25.2.1, 00:00:13, Serial0.1
192.168.30.0/24    auto-summary
192.168.30.0/24    directly connected, Ethernet0
Router2#

This allows you to see more detailed information about each of the routes in the RIP database.

6.1.4 See Also

Recipe 6.3; Recipe 6.4; Recipe 6.5; Recipe 6.8; Recipe 6.13; Chapter 5


  Previous section   Next section
Top