Wednesday 17 February 2010

Configuring RIP

In this post I will configure a small network with RIP routing.



Currently all routers can only communicate with the routers they are directly connected to. I will enable RIP v2 across all routers and perform some troubleshooting steps along the way.


R0

On R0 I enable RIP and turn on debugging to view the RIP updates when RIP is enabled on a connected router.

R0#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R0(config)#router rip
R0(config-router)#version 2
R0(config-router)#network 192.168.1.0
R0(config-router)#end

R0#debug ip rip


R1

On R1 I enable RIP.

R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#router rip
R1(config-router)#version 2
R1(config-router)#network 192.168.1.0
R1(config-router)#network 192.168.2.0
R1(config-router)#end


R0

Back on R0 I can see the R0 sending updates to the multicast address and I can see it receive updates RIP updates from R1.

R0#
*Mar 1 00:26:29.483: RIP: sending v2 update to 224.0.0.9 via Serial1/0 (192.168.1.1)
*Mar 1 00:26:29.487: RIP: build update entries - suppressing null update
R0#
*Mar 1 00:26:35.091: RIP: received v2 request from 192.168.1.2 on Serial1/0
*Mar 1 00:26:35.095: RIP: sending update with long TTL
*Mar 1 00:26:35.099: RIP: sending v2 update to 192.168.1.2 via Serial1/0 (192.168.1.1)
*Mar 1 00:26:35.099: RIP: build update entries - suppressing null update
R0#
*Mar 1 00:26:44.539: RIP: received v2 update from 192.168.1.2 on Serial1/0
*Mar 1 00:26:44.543: 192.168.2.0/24 via 0.0.0.0 in 1 hops
R0#
*Mar 1 00:26:46.543: RIP: sending v2 flash update to 224.0.0.9 via Serial1/0 (192.168.1.1)
*Mar 1 00:26:46.547: RIP: build flash update entries - suppressing null update
R0#
*Mar 1 00:26:58.951: RIP: sending v2 update to 224.0.0.9 via Serial1/0 (192.168.1.1)
*Mar 1 00:26:58.955: RIP: build update entries - suppressing null update


I know check the routing table.

R0#sh 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

C 192.168.1.0/24 is directly connected, Serial1/0
R 192.168.2.0/24 [120/1] via 192.168.1.2, 00:00:07, Serial1/0

I can see the RIP route to the 192.168.2.0 network listed.

I can verify connectivity with ping.


R0#ping 192.168.2.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.2.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 4/5/8 ms


I can also check details of my routing protocols.

R0#sh 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 2 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
Serial1/0 2 2
Automatic network summarization is in effect
Maximum path: 4
Routing for Networks:
192.168.1.0
Routing Information Sources:
Gateway Distance Last Update
192.168.1.2 120 00:00:03
Distance: (default is 120)


Here I can see information on the timers, the protocols and version and the interfaces RIP is enabled on.

Now I configure RIP on the rest of the network and test connectivity.

R2

R2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R2(config)#router rip
R2(config-router)#version 2
R2(config-router)#network 192.168.2.0
R2(config-router)#network 192.168.3.0
R2(config-router)#end

R2#ping 192.168.1.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.1.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/11/16 ms

R2#sh ip route
--cut--
R 192.168.1.0/24 [120/1] via 192.168.2.1, 00:00:24, Ethernet0/0
C 192.168.2.0/24 is directly connected, Ethernet0/0
C 192.168.3.0/24 is directly connected, Ethernet0/1

All good. R2 can communicate with R0 so RIP is working fine.


R3

Finally I enable RIP and test connectivity.

R3#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R3(config)#router rip
R3(config-router)#network 192.168.3.0
R3(config-router)#end

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


Great that all works. But wait a minute. Lets add another interface in a new network and see if R0 can see it. I'll just use a loopback interface to simulate a network.

R3#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R3(config)#int loopback 0
R3(config-if)#ip address 192.168.4.1 255.255.255.0
R3(config-if)#no keepalive
R3(config-if)#end


R3#sh ip route
--cut--
C 192.168.4.0/24 is directly connected, Loopback0
R 192.168.1.0/24 [120/1] via 192.168.3.1, 00:00:11, Ethernet0/0
R 192.168.2.0/24 [120/1] via 192.168.3.1, 00:00:11, Ethernet0/0
C 192.168.3.0/24 is directly connected, Ethernet0/0

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


Now I add the new route in.

R3#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R3(config)#router rip
R3(config-router)#network 192.168.4.0
R3(config-router)#end


Great. And back on R0....

R0

R0#ping 192.168.4.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.4.1, timeout is 2 seconds:
.....
Success rate is 0 percent (0/5)


Strange. I'll try the other interface...

R0#ping 192.168.3.2
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.3.2, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 12/14/16 ms


Well I can get to that one. What does the routing table on R0 show?

R0#sh ip route
--cut--
C 192.168.1.0/24 is directly connected, Serial1/0
R 192.168.2.0/24 [120/1] via 192.168.1.2, 00:00:02, Serial1/0
R 192.168.3.0/24 [120/1] via 192.168.1.2, 00:00:02, Serial1/0


Well there is no route for the 192.168.4.0 network. Lets do some debugging.

Ah here we are ...

R2

R2#debug ip rip
*Mar 1 02:34:39.755: RIP: ignored v1 packet from 192.168.3.2 (illegal version)
R2#
*Mar 1 02:34:48.511: RIP: sending v2 update to 224.0.0.9 via Ethernet0/1 (192.168.3.1)


R3 is still configured to send RIP version 1 updates. A closer look at the the output of show ip protocols tells us this.


R3

R3#sh 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 24 seconds
Invalid after 180 seconds, hold down 180, flushed after 240
Redistributing: rip
Default version control: send version 1, receive any version
Interface Send Recv Triggered RIP Key-chain
Ethernet0/0 1 1 2
Loopback0 1 1 2
Automatic network summarization is in effect
Maximum path: 4
Routing for Networks:
192.168.3.0
192.168.4.0
Routing Information Sources:
Gateway Distance Last Update
192.168.3.1 120 00:00:11
Distance: (default is 120)

Line 7 of the output tells us that it will only send version 1 but will receive any version. Unfortunately RIP version 2 will only send and receive RIP version 2 so the RIP v1 updates will not be added to the route table.

I fix the problem on R3 by changing the version to RIP v2 and recheck connectivity from R0.


R3

R3(config)#router rip
R3(config-router)#version 2
R3(config-router)#end


R0

R0#sh ip route
--cut--
R 192.168.4.0/24 [120/1] via 192.168.1.2, 00:00:09, Serial1/0
C 192.168.1.0/24 is directly connected, Serial1/0
R 192.168.2.0/24 [120/1] via 192.168.1.2, 00:00:09, Serial1/0
R 192.168.3.0/24 [120/1] via 192.168.1.2, 00:00:09, Serial1/0

R0#ping 192.168.4.1
Type escape sequence to abort.
Sending 5, 100-byte ICMP Echos to 192.168.4.1, timeout is 2 seconds:
!!!!!
Success rate is 100 percent (5/5), round-trip min/avg/max = 8/14/20 ms


There we go. Everything working just fine.

Finally a few things about RIP for my exam:


RIP v1
  • Distance Vector Protocol
  • Classfull Routing Protocol
  • Uses Broadcast to send updates
  • Administrative Distance is 120
  • Max Hops 15
  • Sends Updates Every 30 Seconds
  • Holddown Timer is 180 Seconds
  • Invalid after 180 Seconds
  • Route Flushed after 240 Seconds

RIP v2
  • Distance Vector Protocol
  • Classless Routing Protocol (supports VLSM)
  • Uses Multicast to send updates (224.0.0.9)
  • Administrative Distance is 120
  • Supports Authentication
  • Max Hops 15
  • Sends Updates Every 30 Seconds
  • Holddown Timer is 180 Seconds
  • Invalid after 180 Seconds
  • Route Flushed after 240 Seconds


Loop Prevention

Rip uses the follow mechanisms to prevent routing loops:

  • Maximum Distance (15 hops)
  • Poison Reverse
  • Holddown Timers
  • Split Horizen
  • Triggered Updates