router rip
Enters RIP router configuration mode to enable and configure the Routing Information Protocol (RIP) on a Cisco router.
Definition: router rip is a Cisco IOS global config command. Enters RIP router configuration mode to enable and configure the Routing Information Protocol (RIP) on a Cisco router.
Overview
The `router rip` command is the gateway to configuring the Routing Information Protocol (RIP) on a Cisco router. RIP is a distance-vector routing protocol that uses hop count as its metric, with a maximum of 15 hops to prevent routing loops. It is one of the oldest routing protocols, defined in RFC 1058 (RIPv1) and RFC 2453 (RIPv2). While RIP is often considered legacy and is rarely used in modern large-scale networks due to its slow convergence and limited scalability, it remains relevant in small networks, lab environments, and for CCNA/CCNP certification purposes. Understanding RIP provides a foundation for learning more advanced protocols like EIGRP and OSPF.
When you enter `router rip` in global configuration mode, the router enters RIP router configuration mode, indicated by a prompt like `Router(config-router)#`. From here, you can enable RIP on specific interfaces using the `network` command, configure version (RIPv1 or RIPv2), adjust timers, enable authentication, and apply route filtering. Without this command, RIP is not active on the router.
The key networking concept behind RIP is that each router periodically sends its entire routing table to neighboring routers (every 30 seconds by default). Routers then update their tables based on received routes, using the Bellman-Ford algorithm to calculate the best path. RIP uses split horizon, route poisoning, and hold-down timers to prevent loops. RIPv2 adds support for VLSM (Variable Length Subnet Mask) and authentication.
You would reach for `router rip` in scenarios where you need a simple, easy-to-configure routing protocol for a small network (e.g., fewer than 15 routers) where bandwidth and convergence time are not critical. Alternatives include static routing (for very small or stub networks), EIGRP (Cisco proprietary, faster convergence, more scalable), or OSPF (open standard, hierarchical, suitable for larger networks). RIP is often used in labs for learning because of its simplicity.
In the broader network configuration workflow, enabling RIP is typically one of the first steps after basic interface IP addressing. The workflow might be: configure interfaces with IP addresses, then enable a routing protocol (like RIP) to exchange routes dynamically. For troubleshooting, `show ip route` and `show ip protocols` are commonly used alongside RIP configuration.
Important IOS behavior: The `router rip` command does not require any special privilege level beyond global config (privilege level 15). It immediately enters RIP configuration mode. The running config will show `router rip` and any subsequent RIP commands. If you exit without configuring any networks, RIP will be enabled but will not advertise any routes. Also, RIP is a classful protocol by default (RIPv1), so it will automatically summarize at classful boundaries unless you disable auto-summary. The command `no router rip` removes the entire RIP configuration.
RIP updates are sent to UDP port 520. The router listens on this port and sends updates from all interfaces that have an IP address matching a network statement. By default, RIP sends updates to the broadcast address 255.255.255.255 (RIPv1) or multicast 224.0.0.9 (RIPv2).
router ripWhen to Use This Command
- Enable RIP on a router to exchange routing information with neighboring RIP-enabled routers in a small to medium-sized network.
- Configure RIP version 2 to support classless routing, VLSM, and authentication.
- Redistribute static routes or connected networks into RIP to propagate them across the network.
- Disable RIP on a specific interface using the passive-interface command to prevent unnecessary routing updates.
Command Examples
Basic RIP Configuration with Network Statements
router rip
version 2
network 192.168.1.0
network 10.0.0.0
no auto-summaryrouter rip version 2 network 192.168.1.0 network 10.0.0.0 no auto-summary
The 'router rip' command enters RIP configuration mode. 'version 2' sets RIP to use RIPv2. 'network 192.168.1.0' enables RIP on interfaces in that subnet. 'network 10.0.0.0' enables RIP on interfaces in that subnet. 'no auto-summary' disables automatic summarization at classful boundaries, allowing VLSM.
RIP Configuration with Passive Interface
router rip
version 2
network 192.168.1.0
passive-interface gigabitethernet0/1
no auto-summaryrouter rip version 2 network 192.168.1.0 passive-interface gigabitethernet0/1 no auto-summary
The 'passive-interface gigabitethernet0/1' command prevents RIP updates from being sent out that interface, while still allowing the router to receive updates on that interface. This is useful for interfaces connected to end devices or networks where you don't want to send routing updates.
Understanding the Output
The 'router rip' command itself does not produce output; it enters a configuration mode. The output shown in examples is the configuration commands as typed. To verify RIP configuration, use 'show ip protocols' or 'show run | section router rip'.
The 'show ip protocols' output displays RIP version, networks, passive interfaces, and timers. Key fields include 'Routing Protocol is RIP' confirming RIP is enabled, 'Outgoing update filter list for all interfaces' showing filters, 'Default version control' indicating version, 'Routing for Networks' listing advertised networks, 'Routing Information Sources' showing neighbors, and 'Distance' (default 120). A good configuration shows all intended networks listed and neighbors appearing.
Watch for missing networks or incorrect version.
Configuration Scenarios
Enable RIPv2 on a small network with two routers
A small office network consists of two Cisco routers connected via a serial link. The goal is to enable dynamic routing so that both routers learn about each other's directly connected networks. RIPv2 is chosen to support VLSM and classless routing.
Topology
R1(Gi0/0)---192.168.1.0/30---(Gi0/0)R2
R1: Lo0 10.0.0.1/24
R2: Lo0 172.16.0.1/24Steps
- 1.Step 1: Enter global configuration mode on R1: enable, configure terminal
- 2.Step 2: Enter RIP router configuration mode: router rip
- 3.Step 3: Enable RIPv2: version 2
- 4.Step 4: Advertise the directly connected networks: network 192.168.1.0, network 10.0.0.0
- 5.Step 5: Exit configuration mode: end
- 6.Step 6: Repeat steps on R2 with its networks: network 192.168.1.0, network 172.16.0.0
! R1 configuration interface GigabitEthernet0/0 ip address 192.168.1.1 255.255.255.252 ! interface Loopback0 ip address 10.0.0.1 255.255.255.0 ! router rip version 2 network 192.168.1.0 network 10.0.0.0 ! ! R2 configuration interface GigabitEthernet0/0 ip address 192.168.1.2 255.255.255.252 ! interface Loopback0 ip address 172.16.0.1 255.255.255.0 ! router rip version 2 network 192.168.1.0 network 172.16.0.0
Verify: Use 'show ip route' on either router. Expected output includes routes to 10.0.0.0/24 and 172.16.0.0/24 via the serial interface. Also 'show ip protocols' should display RIP as the routing protocol, version 2, and the networks being advertised.
Watch out: A common mistake is forgetting to include the network statement for the link between routers. Without 'network 192.168.1.0', RIP will not send updates on that interface, and routes will not be exchanged.
Configure RIP with passive interface and default route redistribution
A branch router connects to the corporate network via a single serial link. The branch has multiple LANs. To prevent RIP updates from being sent to the LAN interfaces (unnecessary broadcast traffic), those interfaces should be made passive. Additionally, the branch router should advertise a default route to the LANs pointing to the corporate network.
Topology
Branch(Gi0/0)---10.0.0.0/30---(Gi0/0)Corp
Branch: Gi0/1 192.168.1.0/24, Gi0/2 192.168.2.0/24
Corp: has default route to InternetSteps
- 1.Step 1: On Branch, enter global config and then router rip: router rip
- 2.Step 2: Enable RIPv2: version 2
- 3.Step 3: Advertise all networks: network 10.0.0.0, network 192.168.1.0, network 192.168.2.0
- 4.Step 4: Make LAN interfaces passive: passive-interface GigabitEthernet0/1, passive-interface GigabitEthernet0/2
- 5.Step 5: Redistribute the default route from Corp: default-information originate (if Corp sends default via RIP) or redistribute static (if static default on Branch). Assume Corp sends default via RIP, so on Branch: default-information originate
- 6.Step 6: Exit and verify
! Branch router configuration interface GigabitEthernet0/0 ip address 10.0.0.2 255.255.255.252 ! interface GigabitEthernet0/1 ip address 192.168.1.1 255.255.255.0 ! interface GigabitEthernet0/2 ip address 192.168.2.1 255.255.255.0 ! router rip version 2 network 10.0.0.0 network 192.168.1.0 network 192.168.2.0 passive-interface GigabitEthernet0/1 passive-interface GigabitEthernet0/2 default-information originate
Verify: On Branch, 'show ip route' should show a default route (0.0.0.0/0) learned via RIP from Corp (or redistributed). 'show ip protocols' should list passive interfaces. On a PC in LAN, it should have a default gateway pointing to Branch's LAN IP, and Branch should forward traffic to Corp.
Watch out: A common mistake is not including the network statement for the serial link (10.0.0.0). Without it, RIP will not send updates on that interface, and the default route will not be propagated. Also, 'default-information originate' only works if the router has a default route in its routing table (either static or learned).
Troubleshooting with This Command
When troubleshooting RIP, the primary commands are `show ip route`, `show ip protocols`, `debug ip rip`, and `show ip rip database` (if available). Healthy RIP operation is indicated by routes in the routing table with a code of 'R' and an administrative distance of 120. The `show ip route` output should show RIP routes with the next-hop IP and the metric (hop count). For example, 'R 10.0.0.0/8 [120/1] via 192.168.1.2, 00:00:17, GigabitEthernet0/0' indicates a valid RIP route with a metric of 1 hop.
Problem indicators include missing routes, high hop counts (15 or 16 indicates unreachable), or routes that appear and disappear (flapping). Common symptoms: a router does not learn routes from a neighbor, or routes are learned but not installed in the routing table. This could be due to mismatched versions (RIPv1 vs RIPv2), passive interface configuration, access lists blocking RIP updates (UDP 520), or network statements missing.
Step-by-step diagnostic flow: 1. Verify that RIP is enabled: `show ip protocols`. Check the 'Routing Protocol is "rip"' line, the version, and the list of networks under 'Routing for Networks'. Ensure the correct interfaces are listed under 'Routing Information Sources'. 2. Check the routing table: `show ip route rip`. If no RIP routes appear, verify connectivity between routers (ping the neighbor's IP). 3. Use `debug ip rip` to see RIP updates being sent and received. Look for 'RIP: sending' and 'RIP: received' messages. If no updates are received, check for ACLs or firewall rules blocking UDP 520. If updates are sent but not received, check the network statement on the sending router. 4. Verify interface IP addresses and subnet masks. RIP (especially v1) is classful; mismatched masks can cause issues. RIPv2 supports VLSM, but auto-summary can cause problems if not disabled. 5. Check for passive interfaces: `show ip protocols` lists passive interfaces. If an interface is passive, it will not send updates but will still receive them. If you need to prevent both sending and receiving, use `passive-interface default` and then `no passive-interface` on the desired interface. 6. Correlate with other commands: `show ip interface brief` to verify interface status, `show access-lists` to check for ACLs blocking RIP, and `show running-config | section router rip` to review the RIP configuration.
Common issues: Forgetting to include the network statement for the link between routers. Using RIPv1 when VLSM is in use (RIPv1 does not carry subnet masks). Auto-summary causing routes to be summarized at classful boundaries, leading to suboptimal routing. The `debug ip rip` command can be CPU-intensive; use with caution in production.
CCNA Exam Tips
Remember that 'router rip' is entered in global configuration mode, not interface mode.
CCNA exam often tests the difference between RIPv1 (classful, no VLSM) and RIPv2 (classless, supports VLSM and authentication).
The 'no auto-summary' command is critical for RIPv2 to advertise subnets; without it, RIPv2 behaves like RIPv1.
Passive interfaces are a common exam topic: they prevent sending updates but still receive them.
Common Mistakes
Forgetting to use 'version 2' and relying on default RIPv1, which does not support VLSM.
Omitting 'no auto-summary', causing subnets to be summarized at classful boundaries.
Applying 'network' statements with incorrect wildcard masks or classful boundaries instead of exact subnets.
router rip vs show ip protocols
The commands 'router rip' and 'show ip protocols' are often considered together because both relate to the RIP routing protocol on a Cisco router. However, they serve fundamentally different purposes: one is used for configuration, the other for verification. Understanding their distinct roles helps prevent confusion during router setup and troubleshooting.
| Aspect | router rip | show ip protocols |
|---|---|---|
| Scope | Configuration of RIP parameters | Verification of routing protocol state |
| Mode | Global configuration mode | Privileged EXEC mode |
| Persistence | Changes saved to running-config | Output is transient, not saved |
| Impact | Enables/modifies RIP routing process | No impact; read-only display |
| Typical Use | Initially enabling RIP or adjusting timers/filters | Checking protocol status, timers, or network advertisements |
Use router rip when you need to enter RIP configuration mode to enable or adjust RIP parameters such as network statements, timers, or distribute-lists.
Use show ip protocols when you need to verify the operational state of all routing protocols, including RIP timers, filters, and advertised networks.
Platform Notes
In IOS-XE (e.g., Catalyst 9000 switches), the `router rip` command syntax is identical to classic IOS. However, IOS-XE may have additional features like RIPng for IPv6 (using `ipv6 router rip`). The output of `show ip protocols` may include additional fields like 'Graceful Restart' or 'NSF' information.
On NX-OS (e.g., Nexus switches), RIP is not supported; instead, use EIGRP or OSPF. There is no direct equivalent. For ASA firewalls, RIP is not supported; they use static routing or OSPF/EIGRP in routed mode.
In IOS-XR (e.g., ASR 9000), RIP is not supported; the routing protocols available are OSPF, ISIS, BGP, and EIGRP (limited). Therefore, `router rip` is only available on classic IOS and IOS-XE platforms. Differences between IOS versions: In IOS 12.x, RIP was the default routing protocol for some platforms; in 15.x and 16.x, it is not enabled by default.
The `auto-summary` command is enabled by default in older versions but disabled by default in newer versions (15.x and later). Also, the `default-information originate` command behavior may vary; in some versions, it requires a default route in the routing table, while in others it advertises a default route regardless. Always check the specific IOS version documentation.
Related Commands
show ip protocols
Displays the current state of all IP routing protocols running on the router, including timers, filters, and network advertisements.
show ip route
Displays the IP routing table showing all known routes, their source protocols, administrative distances, metrics, next-hops, and outgoing interfaces.
Practice for the CCNA 200-301
Test your knowledge with practice questions covering all CCNA 200-301 exam domains.
Practice CCNA 200-301 Questions