Configuring RIP on a Cisco Router

0

The Routing Information Protocol (RIP) is the most basic distance-vector routing protocol in use these days. It has been designed for small and local networks and because it’s configuration is very simple, it’s still commonly used. By default, RIP sends out it’s entire routing table every 30 seconds. While in small networks with few routes in the routing table this is not an issue and RIP can route efficiently; in larger networks with many routers and routes this routing update would cause unnecessary network traffic. You can read more about RIP in the document RFC 2453.

If you enable routing on your Windows Servers you could configure them to exchange routing information with your RIP router(s).

required steps

Configuring RIP is very simple. All you have to do is to enable it and tell the router which networks you want to advertise. Unlike OSPF or EIGRP, RIP does not require or accept subnet mask in the network command. Also whenever implementing RIP, version 2 should be used.

optional commands

It is recommended to disable the auto summarisation of routes with the no auto-summary command to prevent any headaches in the future. On the router which connects to the internet the ip route 0.0.0.0 0.0.0.0 X.X.X.X and the default-information originate command has to be issued in order to allow other routers to communicate to the world. Note that X.X.X.X is the IP Address of the ISP’s router.
You could also tweak the RIP Timers so the router sends out its updates more or less often, and you could set up RIP authentication as well.

before you begin

Have a look the following topology.

Configuring RIP

Note that in this example R1 is directly connected to another router which is connected to the internet so the ip route 0.0.0.0 0.0.0.0 X.X.X.X and default-information originate commands are required!

configuration

Let’s start by configuring the interfaces on all three routers.

R1

R1>enable
R1#conf terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#interface f0/0
R1(config-if)#description LINK TO R2  f0/1
R1(config-if)#speed 100
R1(config-if)#duplex full
R1(config-if)#ip address 192.168.1.1 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#interface f0/1
R1(config-if)#description LINK TO R3 f0/0
R1(config-if)#speed 100
R1(config-if)#duplex full
R1(config-if)#ip address 192.168.3.2 255.255.255.0
R1(config-if)#no shutdown
R1(config-if)#interface f1/0
R1(config-if)#description LINK TO ISP
R1(config-if)#speed 100
R1(config-if)#duplex full
R1(config-if)#ip address 10.0.0.4 255.255.255.224
R1(config-if)#no shutdown
R1(config-if)#interface loopback1
R1(config-if)#ip address 172.16.1.1 255.255.0.0
R1(config-if)#

R2

R2>enable
R2#conf terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R2(config)#interface f0/1
R2(config-if)#description LINK TO R1 f0/0
R2(config-if)#speed 100
R2(config-if)#duplex full
R2(config-if)#ip address 192.168.1.2 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#interface f0/0
R2(config-if)#description LINK TO R3 f0/1
R2(config-if)#speed 100
R2(config-if)#duplex full
R2(config-if)#ip address 192.168.2.1 255.255.255.0
R2(config-if)#no shutdown
R2(config-if)#interface loopback1
R2(config-if)#ip address 172.17.1.1 255.255.0.0
R2(config-if)#

R3

R3>enable
R3#conf terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R3(config)#interface f0/0
R3(config-if)#description LINK TO R1 f0/1
R3(config-if)#speed 100
R3(config-if)#duplex full
R3(config-if)#ip address 192.168.3.1 255.255.255.0
R3(config-if)#no shutdown
R3(config-if)#interface f0/1
R3(config-if)#description LINK TO R2 f0/0
R3(config-if)#speed 100
R3(config-if)#duplex full
R3(config-if)#ip address 192.168.2.2 255.255.255.0
R3(config-if)#no shutdown
R3(config-if)#interface loopback1
R3(config-if)#ip address 172.18.1.1 255.255.0.0
R3(config-if)#

Before going any further we need to confirm that the interfaces are up and configured properly. We could use the show ip interface brief command to verify the IP addresses and a few pings to test the connections. We can also verify everything from the output of the show cdp neighbors detail command. Here is a snippet from it:

R3#show cdp neighbors detail
-------------------------
Device ID: R2
Entry address(es):
  IP address: 192.168.2.1
Platform: Cisco 2621XM,  Capabilities: Router Switch IGMP
Interface: FastEthernet0/1,  Port ID (outgoing port): FastEthernet0/0
Holdtime : 125 sec

-------------------------
Device ID: R1
Entry address(es):
  IP address: 192.168.3.2
Platform: Cisco 2621XM,  Capabilities: Router Switch IGMP
Interface: FastEthernet0/0,  Port ID (outgoing port): FastEthernet0/1
Holdtime : 120 sec

R3#

The next step is to enable RIP on all routers and to advertise the desired networks. But first, define the default route so the router knows where to send packets with unknown destination addresses.

R1

R1#conf terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#ip route 0.0.0.0 0.0.0.0 10.0.0.1
R1(config)#router rip
R1(config)#version 2
R1(config-router)#no auto-summary
R1(config-router)#default-information originate
R1(config-router)#network 192.168.1.0
R1(config-router)#network 192.168.3.0
R1(config-router)#network 172.16.0.0
R1(config-router)#do write
Building configuration...
[OK]
R1(config-router)#

The highlighted commands are only required on R1!

R2

R2#conf terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R2(config)#router rip
R2(config-router)#version 2
R2(config-router)#no auto-summary
R2(config-router)#network 192.168.1.0
R2(config-router)#network 192.168.2.0
R2(config-router)#network 172.17.0.0
R2(config-router)#do write
Building configuration...
[OK]
R2(config-router)#

R3

R3#conf terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R3(config)#router rip
R3(config-router)#version 2
R3(config-router)#no auto-summary
R3(config-router)#network 192.168.2.0
R3(config-router)#network 192.168.3.0
R3(config-router)#network 172.18.0.0
R3(config-router)#do write
Building configuration...
[OK]
R3(config-router)#

verification

Check the routing table on R1 to confirm that it knows about the advertised routes.

R1#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
       D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
       N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
       E1 - OSPF external type 1, E2 - OSPF external type 2
       i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1
       L2 - IS-IS level-2, ia - IS-IS inter area, * - candidate default
       U - per-user static route, o - ODR, P - periodic downloaded static
       route

Gateway of last resort is not set

R    172.17.0.0/16 [120/1] via 192.168.1.2, 00:00:02, FastEthernet0/0
C    172.16.0.0/16 is directly connected, Loopback1
R    172.18.0.0/16 [120/1] via 192.168.3.1, 00:00:12, FastEthernet0/1
     10.0.0.0/27 is subnetted, 1 subnets
C       10.0.0.0 is directly connected, FastEthernet1/0
C    192.168.1.0/24 is directly connected, FastEthernet0/0
R    192.168.2.0/24 [120/1] via 192.168.3.1, 00:00:12, FastEthernet0/1
                    [120/1] via 192.168.1.2, 00:00:02, FastEthernet0/0
C    192.168.3.0/24 is directly connected, FastEthernet0/1
R1#

To verify that our router can communicate with the outside network ping an IP Address on the internet.

R3#ping 8.8.8.8

Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 8.8.8.8, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 36/77/124 ms
R3#

When troubleshooting the best command to use is the debug ip rip command.

R3#debug ip rip
RIP protocol debugging is on
R3#
*Mar  1 00:47:33.763: RIP: sending v2 update to 224.0.0.9 via FastEthernet0/1 (192.168.2.2)
*Mar  1 00:47:33.767: RIP: build update entries
*Mar  1 00:47:33.767:   0.0.0.0/0 via 0.0.0.0, metric 2, tag 0
*Mar  1 00:47:33.771:   172.16.0.0/16 via 0.0.0.0, metric 2, tag 0
*Mar  1 00:47:33.775:   172.18.0.0/16 via 0.0.0.0, metric 1, tag 0
*Mar  1 00:47:33.779:   192.168.3.0/24 via 0.0.0.0, metric 1, tag 0
*Mar  1 00:47:35.137: RIP: received v2 update from 192.168.2.1 on FastEthernet0/1
*Mar  1 00:47:35.137:      0.0.0.0/0 via 0.0.0.0 in 2 hops
*Mar  1 00:47:35.141:      172.16.0.0/16 via 0.0.0.0 in 2 hops
*Mar  1 00:47:35.145:      172.17.0.0/16 via 0.0.0.0 in 1 hops
*Mar  1 00:47:35.145:      192.168.1.0/24 via 0.0.0.0 in 1 hops
*Mar  1 00:47:36.740: RIP: sending v2 update to 224.0.0.9 via FastEthernet0/0 (192.168.3.1)
*Mar  1 00:47:36.744: RIP: build update entries
*Mar  1 00:47:36.744:   172.17.0.0/16 via 0.0.0.0, metric 2, tag 0
*Mar  1 00:47:36.748:   172.18.0.0/16 via 0.0.0.0, metric 1, tag 0
*Mar  1 00:47:36.752:   192.168.2.0/24 via 0.0.0.0, metric 1, tag 0
*Mar  1 00:47:36.924: RIP: received v2 update from 192.168.3.2 on Fast Ethernet0/0
*Mar  1 00:47:36.924:      0.0.0.0/0 via 0.0.0.0 in 1 hops
*Mar  1 00:47:36.928:      172.16.0.0/16 via 0.0.0.0 in 1 hops
*Mar  1 00:47:36.932:      172.17.0.0/16 via 0.0.0.0 in 2 hops
*Mar  1 00:47:36.932:      192.168.1.0/24 via 0.0.0.0 in 1 hops
*Mar  1 00:47:37.180: RIP: sending v2 update to 224.0.0.9 via Loopback1 (172.18.1.1)
*Mar  1 00:47:37.184: RIP: build update entries
*Mar  1 00:47:37.184:   0.0.0.0/0 via 0.0.0.0, metric 2, tag 0
*Mar  1 00:47:37.188:   172.16.0.0/16 via 0.0.0.0, metric 2, tag 0
*Mar  1 00:47:37.188:   172.17.0.0/16 via 0.0.0.0, metric 2, tag 0
*Mar  1 00:47:37.188:   192.168.1.0/24 via 0.0.0.0, metric 2, tag 0
*Mar  1 00:47:37.192:   192.168.2.0/24 via 0.0.0.0, metric 1, tag 0
*Mar  1 00:47:37.192:   192.168.3.0/24 via 0.0.0.0, metric 1, tag 0
*Mar  1 00:47:37.192: RIP: ignored v2 packet from 172.18.1.1 (sourced from one of our addresses)

This output is a HUGE help when troubleshooting RIP! It tells us what version of RIP updates we are sending and receiving and on which interfaces; from which addresses this updates are coming from and it even tells us the destination address of the RIP update packets. We can see the networks as well as the router receives and sends them. In the last few rows we can see that the router builds it’s routing table using the information it received from the neighbouring routers.

Another useful command to remember is the show ip protocols.

R3#show ip protocols
Routing Protocol is "rip"
  Outgoing update filter list for all interfaces is not set
  Incoming update filter list for all interfaces is not set
  Sending updates every 30 seconds, next due in 12 seconds
  Invalid after 180 seconds, hold down 180, flushed after 240
  Redistributing: rip
  Default version control: send version 2, receive version 2
    Interface             Send  Recv  Triggered RIP  Key-chain
    FastEthernet0/0       2     2
    FastEthernet0/1       2     2
    Loopback1             2     2
  Automatic network summarization is not in effect
  Maximum path: 4
  Routing for Networks:
    172.18.0.0
    192.168.2.0
    192.168.3.0
  Routing Information Sources:
    Gateway         Distance      Last Update
    192.168.3.2          120      00:00:21
    192.168.2.1          120      00:00:08
  Distance: (default is 120)

R3#

We can see the routing protocol(s) in use on the router, timers, versions, networks, … Make sure you remember this one too!

commands explained

Commands used with a brief explanation.

ip route 0.0.0.0 0.0.0.0 10.0.0.1: Tells the router where to send packets with unknown destination address
router rip: Enables RIP
version 2: Switches to RIP version 2
no auto-summary: Disables auto summarisation of routes
default-information originate: Tells to all other RIP routers that if they receive a packet with unknown destination address, send it to this router
network x.x.x.x: Advertises network x.x.x.x
do write: Writes the running config into the startap config. The do command can be used to execute EXEC level commands from global configuration or other modes.
show ip route: Shows the entire routing table
debug ip rip: Turns on the debugging of RIP events
show ip protocols: Shows information about the enabled routing protocols on the router

Sisko Warrior

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.