Routing Information Protocol
Introduction
The Routing Information Protocol (RIP) is a dynamic routing protocol. RIP is an example of a distance vector routing protocol, and historically it has been one of the most widely used intra-domain unicast routing protocol within the Internet.
RIP is relatively simple to setup, but does not handle topology changes as rapidly as the OSPF dynamic routing protocol. Therefore, OSPF is generally preferred over RIP when it is possible to select dynamic routing protocol.
For information on OSPF, see the OSPF configuration page.
Overview
RIP enabled routers will exchange routing information with their neighbors periodically. This in order to construct their own routing tables, with entries describing how to reach each of the participating routers.
In Figure 1 below, we have an example network of 5 RIP enabled routers. Each RIP router only needs to know the networks where other RIP enabled routers are located. Afterwards they will automatically construct their routing tables, no need for configuring static routing entries.
| |
.---+---. .---+---.
| | | |
| R | | R |
| | | |
'---+---' '---+---'
|.1 |.2
-------------+------------+-------------+-------------
10.0.1.0/24 |.3
.---+---.
.1| |.1
+---+ R1 +---+
| | | |
| '-------' |
10.0.2.0/24 | | 10.0.3.0/24
-------------+----+--- ---+-----+-------------
|.2 |.2
.---+---. .---+---.
| | | |
| R | | R |
| | | |
'---+---' '---+---'
| |
Figure 1: Showing a router R1 connected to other routers across three different networks. With RIP running on each of the routers they will automatically learn routes to each other.
In order for a RIP router to find the best path, between the source and destination network, it utilizes hop count as a metric. The hop count is simply the amount of routers between the source and destination network. Therefore, when adding entries to the routing table, the path with the lowest hop count will be selected. For more information on routing table entries, see the Static Routing section.
Note
RIP has a maximum hop count of 15. This means that any destination that is more than 15 routers away from the source will be unreachable. One reason for this limitation is to prevent routing loops.
There are two different versions of RIP v1 and v2. One big difference is that RIPv2 routers exchange routing information using IP multicast (IP address 224.0.0.9). While RIPv1 uses broadcast to exchange routing information.
Authentication
RIPv2 allows authentication of RIP messages. This can be helpful to avoid that
false routing information is injected into your network (deliberately or by
mistake). This is configured for each iface
using the auth
command.
Route Redistribution
It is possible to redistribute routing information learnt externally (OSPF, con-
nected routes or static routes) inside the RIP routing domain, using the
redistribute
command.
You can also let a RIP router inject a default route (0.0.0.0/0) into your RIP
domain, using the distribute-default
command.
Passive Interface
In some situations you may wish to include a router’s subnets as part of the RIP
routing domain without running RIP on the associated network interface. This can
be done using the passive
command under each iface
.
Configuration
The configuration of RIP is separated into two different parts. The actual router configuration and RIP related settings for each individual interface.
Router
RIP is configured under the router
section of the global configuration
context:
example:/#> configure example:/config/#> router example:/config/router/#> rip example:/config/router/rip/#>
Syntax
[no] version <1|2>
[no] distance <1-255>
[no] timers [update SEC] [invalid SEC] [flush SEC]
[no] passive-interface
[no] neighbor <IPADDR[,IPADDR,...]>
[no] network <IFACE|NETWORK[,NETWORK,...]>
[no] redistribute <connected|static|ospf>
[no] distribute-default
Interface Specific Settings
To configure RIP related settings for an interface is located under the iface
context:
example:/#> configure example:/config/#> iface vlan1 example:/config/iface-vlan1/#> rip example:/config/iface-vlan1/rip/#>
Syntax
[no] passive [auto]
[no] split-horizon [poisoned-reverse]
[no] send-version <1,2>
[no] receive-version <1,2>
[no] auth <md5 KEYID | plain> [hash] <SECRET>
Status
The current status of a RIP configured router can be observed in the exec context in the following manner:
example:/#> show rip Routing Protocol is "rip" Sending updates every 30 seconds with +/-50%, next due in 17 seconds Timeout after 180 seconds, garbage collect after 120 seconds Outgoing update filter list for all interface is not set Incoming update filter list for all interface is not set Default redistribution metric is 1 Redistributing: Default version control: send version 2, receive version 2 Interface Send Recv Key-chain vlan1 2 2 Routing for Networks: vlan1 Routing Information Sources: Gateway BadPackets BadRoutes Distance Last Update 10.0.2.1 0 0 120 00:00:10 Distance: (default is 120)
We can also see any potential routes that RIP have added using show ip route
as such:
example:/#> show ip route S - Static | C - Connected | K - Kernel route | > - Selected route O - OSPF | R - RIP | [Distance/Metric] | * - FIB route R>* 10.0.1.0/24 [120/2] via 10.0.2.1, vlan1, 00:02:08 C>* 10.0.2.0/24 is directly connected, vlan1
Any route denoted with an R
is a route that have been learned by RIP.