Page Nav

HIDE

Grid

GRID_STYLE

RIP vs EIGRP vs OSPF: Routing Protocols Compared (with Lab)

RIP, EIGRP, and OSPF are the three dynamic routing protocols every CCNA student meets first. They all do the same basic job — learn routes a...

RIP, EIGRP, and OSPF are the three dynamic routing protocols every CCNA student meets first. They all do the same basic job — learn routes and share them between routers — but they differ sharply in how they measure the best path, how fast they react to changes, and whether they are open standards or Cisco-specific. In this post I compare them side by side, then configure all three on the same small three-router network so you can see the exact commands and the resulting routing table.

The Three Protocols at a Glance

  • RIP (Routing Information Protocol) is the oldest and simplest. It is a distance-vector protocol that picks paths by hop count — the fewest routers to cross wins — and it does not care about link speed.
  • EIGRP (Enhanced Interior Gateway Routing Protocol) is Cisco's advanced distance-vector protocol. It uses a richer metric based mainly on bandwidth and delay, and it converges very fast thanks to its DUAL algorithm and backup routes.
  • OSPF (Open Shortest Path First) is the open-standard link-state protocol. Each router builds a full map of the area and runs the Dijkstra algorithm to compute shortest paths by cost, which is derived from bandwidth.

Comparison Table

Attribute RIP (v2) EIGRP OSPF
Type Distance vector Advanced distance vector (hybrid) Link state
Administrative distance 120 90 (internal) 110
Metric Hop count Bandwidth and delay (by default) Cost (based on bandwidth)
Maximum hops 15 (16 = unreachable) 100 by default (up to 255) No hop limit
Convergence Slow Very fast Fast
Standard or proprietary Open standard Cisco (now published, originally proprietary) Open standard
Update method Full table every 30 s Triggered, partial updates Triggered LSAs, periodic refresh
Algorithm Bellman-Ford DUAL Dijkstra (SPF)
Transport UDP port 520 IP protocol 88 IP protocol 89

A couple of these rows deserve a note. Administrative distance (AD) is how much a router trusts a source of routing information when two protocols offer a route to the same destination — the lower the AD, the more trusted. So if a router learns the same network through EIGRP (90) and OSPF (110), it installs the EIGRP route. The 15-hop limit is RIP's famous weakness: any network more than 15 routers away is considered unreachable, which rules RIP out of large networks.

The Lab Topology

Three routers in a line (R1 — R2 — R3), each with a LAN. We will configure RIP first, then wipe it and configure EIGRP, then OSPF, so you see all three on identical addressing.

R1 LAN R1 R2 R3 R3 LAN G0/0 .1 G0/1 .1 G0/0 .2 G0/1 .1 G0/0 .2 G0/1 .1 192.168.1.0/24 10.0.12.0/30 10.0.23.0/30 192.168.3.0/24 Same addressing for RIPv2, EIGRP AS 100 and OSPF area 0
Figure: Three-router lab topology used for RIP, EIGRP and OSPF.
Link / LANNetworkR1R2R3
R1 LAN192.168.1.0/24G0/0: 192.168.1.1––
R1–R210.0.12.0/30G0/1: 10.0.12.1G0/0: 10.0.12.2–
R2–R310.0.23.0/30–G0/1: 10.0.23.1G0/0: 10.0.23.2
R3 LAN192.168.3.0/24––G0/1: 192.168.3.1

Configure the interface IPs first (with no shutdown on each) before adding any routing protocol.

Option A: RIP Version 2

On every router, start RIP, force version 2 (which supports subnet masks), turn off auto-summary, and advertise the directly connected networks. On R1:

R1(config)# router rip
R1(config-router)# version 2
R1(config-router)# no auto-summary
R1(config-router)# network 192.168.1.0
R1(config-router)# network 10.0.12.0
R1(config-router)# exit

The network command tells RIP which interfaces to run on and which networks to advertise. RIP network statements are classful, so IOS stores network 10.0.12.0 as network 10.0.0.0; that still matches the right interfaces here. On R2, advertise both of its connected networks:

R2(config)# router rip
R2(config-router)# version 2
R2(config-router)# no auto-summary
R2(config-router)# network 10.0.12.0
R2(config-router)# network 10.0.23.0
R2(config-router)# exit

On R3:

R3(config)# router rip
R3(config-router)# version 2
R3(config-router)# no auto-summary
R3(config-router)# network 192.168.3.0
R3(config-router)# network 10.0.23.0
R3(config-router)# exit

After a minute, check R1's routing table:

R1# show ip route
Gateway of last resort is not set

      10.0.0.0/8 is variably subnetted, 3 subnets, 2 masks
C        10.0.12.0/30 is directly connected, GigabitEthernet0/1
L        10.0.12.1/32 is directly connected, GigabitEthernet0/1
R        10.0.23.0/30 [120/1] via 10.0.12.2, 00:00:08, GigabitEthernet0/1
      192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.1.0/24 is directly connected, GigabitEthernet0/0
L        192.168.1.1/32 is directly connected, GigabitEthernet0/0
R     192.168.3.0/24 [120/2] via 10.0.12.2, 00:00:08, GigabitEthernet0/1

Routes learned via RIP are marked R. In [120/2] the 120 is RIP's administrative distance and the 2 is the hop count to reach 192.168.3.0 (across R2, then R3).

Option B: EIGRP

If you are following along on the same topology, first remove RIP with no router rip on each router. EIGRP uses an autonomous-system number that must match on all routers — we use 100. On R1:

R1(config)# router eigrp 100
R1(config-router)# no auto-summary
R1(config-router)# network 192.168.1.0
R1(config-router)# network 10.0.12.0 0.0.0.3
R1(config-router)# exit

EIGRP lets you use a wildcard mask on the network command to match an exact subnet — 0.0.0.3 matches the /30. On R2 and R3:

R2(config)# router eigrp 100
R2(config-router)# no auto-summary
R2(config-router)# network 10.0.12.0 0.0.0.3
R2(config-router)# network 10.0.23.0 0.0.0.3
R2(config-router)# exit

R3(config)# router eigrp 100
R3(config-router)# no auto-summary
R3(config-router)# network 192.168.3.0
R3(config-router)# network 10.0.23.0 0.0.0.3
R3(config-router)# exit

Check the table on R1:

R1# show ip route
      10.0.0.0/8 is variably subnetted, 3 subnets, 2 masks
C        10.0.12.0/30 is directly connected, GigabitEthernet0/1
L        10.0.12.1/32 is directly connected, GigabitEthernet0/1
D        10.0.23.0/30 [90/3072] via 10.0.12.2, 00:01:14, GigabitEthernet0/1
      192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.1.0/24 is directly connected, GigabitEthernet0/0
L        192.168.1.1/32 is directly connected, GigabitEthernet0/0
D     192.168.3.0/24 [90/3328] via 10.0.12.2, 00:01:14, GigabitEthernet0/1

EIGRP routes are marked D (for DUAL). The [90/3072] shows AD 90 and the composite metric. The large metric number reflects bandwidth and delay rather than a simple hop count: with default K-values the metric is 256 x (107 / slowest bandwidth in kbps + total delay in tens of microseconds). Every link here is Gigabit (bandwidth part 10, delay 10 microseconds per interface), so 10.0.23.0/30 crosses two interfaces for 256 x (10 + 2) = 3072, and 192.168.3.0/24 crosses three for 256 x (10 + 3) = 3328.

Option C: OSPF

Remove EIGRP with no router eigrp 100. OSPF uses a process ID (locally significant) and requires an area — we use area 0, the backbone. OSPF network statements take a wildcard mask and an area. On R1:

R1(config)# router ospf 1
R1(config-router)# network 192.168.1.0 0.0.0.255 area 0
R1(config-router)# network 10.0.12.0 0.0.0.3 area 0
R1(config-router)# exit

On R2 and R3:

R2(config)# router ospf 1
R2(config-router)# network 10.0.12.0 0.0.0.3 area 0
R2(config-router)# network 10.0.23.0 0.0.0.3 area 0
R2(config-router)# exit

R3(config)# router ospf 1
R3(config-router)# network 192.168.3.0 0.0.0.255 area 0
R3(config-router)# network 10.0.23.0 0.0.0.3 area 0
R3(config-router)# exit

Check R1 again:

R1# show ip route
      10.0.0.0/8 is variably subnetted, 3 subnets, 2 masks
C        10.0.12.0/30 is directly connected, GigabitEthernet0/1
L        10.0.12.1/32 is directly connected, GigabitEthernet0/1
O        10.0.23.0/30 [110/2] via 10.0.12.2, 00:02:41, GigabitEthernet0/1
      192.168.1.0/24 is variably subnetted, 2 subnets, 2 masks
C        192.168.1.0/24 is directly connected, GigabitEthernet0/0
L        192.168.1.1/32 is directly connected, GigabitEthernet0/0
O     192.168.3.0/24 [110/3] via 10.0.12.2, 00:02:41, GigabitEthernet0/1

OSPF routes are marked O. In [110/3] the 110 is OSPF's AD and the 3 is the cumulative cost: with the default reference bandwidth of 100 Mbps, every Gigabit interface has a cost of 1, and the path crosses three outgoing interfaces (R1 G0/1, R2 G0/1 and R3's LAN interface G0/1). The L entries in all three tables are R1's own interface addresses as /32 local routes.

Common Mistakes

  • Mismatched EIGRP AS number or OSPF parameters. EIGRP neighbors only form if the AS number matches on both sides. OSPF neighbors must agree on the area ID, subnet, hello and dead timers, and authentication; the OSPF process ID does not have to match.
  • Wrong wildcard masks. In EIGRP and OSPF the network command uses a wildcard mask, not a subnet mask. A /30 is 0.0.0.3, not 255.255.255.252.
  • Forgetting no shutdown. No neighbor forms over a down interface. Always bring interfaces up first.
  • Leaving auto-summary on. With discontiguous subnets, auto-summary in RIP or older EIGRP can hide routes. no auto-summary is the safe habit.
  • Mixing protocols by accident. If you are comparing, remove the old protocol (no router rip, etc.) before configuring the next, or the router keeps the lower-AD route and your results look confusing.

Which Should You Use?

RIP is fine for a tiny lab or a very small, flat network, but its 15-hop limit and slow convergence rule it out of anything serious. EIGRP is excellent inside an all-Cisco network: fast, easy to configure, and efficient. OSPF is the right choice when you need an open standard, mixed-vendor support, or a large hierarchical design with multiple areas. For CCNA, know all three — the exam leans heavily on OSPF.

Summary

The three differ in approach: RIP counts hops (AD 120), EIGRP uses bandwidth and delay with very fast DUAL convergence (AD 90), and OSPF builds a link-state map and runs SPF on cost (AD 110). In the routing table they show up as R, D, and O respectively, and the bracketed [AD/metric] tells you at a glance how each route was learned.

Build this topology yourself in Packet Tracer using the addressing table above, then work through the three options in order.

Related tutorials

  • Configuring Static VLANs on a Cisco Switch (Packet Tracer Lab)
  • Site-to-Site IPsec VPN on Cisco Routers: Packet Tracer Lab
  • Cisco Catalyst 2950 Password Recovery: Step-by-Step Guide

Sources

  • RFC 2453, "RIP Version 2"
  • RFC 2328, "OSPF Version 2"
  • RFC 7868, "Cisco's Enhanced Interior Gateway Routing Protocol (EIGRP)"
  • Cisco IOS IP Routing Configuration Guides (RIP, EIGRP, OSPF)

No comments