Routing Information Protocol (RIP)

RIP Conceptual Overview

Routing Information Protocol (RIP) is a routing protocol typically used as an Interior Gateway Protocol (IGP). RIP uses hop counts only to determine the shortest path to a destination. To avoid loops, RIP limits its paths to a maximum of 15 hops, making it an ineffective protocol for large networks. RIP version 2 supports Classless Inter-Domain Routing (CIDR) and uses IP multicast at address 224.0.0.9 to share the routing table with adjacent routers.

RIP sends updates whenever there is a change in the network topology and periodic updates when there are no changes. Receiving switches update their routing table whenever the update includes topology changes. Because RIP transmits the entire routing table every 30 seconds, RIP updates can generate heavy traffic loads in large or complicated networks.

Each switch also sends a list of distance-vectors to each of its neighbors periodically. The distance-vector is the metric RIP uses to express the cost of a route, and it describes the number of hops required to reach a destination. Each hop is typically assigned a hop count value of 1, and the router adds 1 to the metric when it receives a routing update and adds the network to its routing table.

To remove dead routes from its routing table, RIP marks a route for deletion if the router does not receive an advertisement for it within the expiration interval, then removes it from the routing table after the deletion interval.

Running RIP on the Switch

Accessing RIP Configuration Mode and Enabling RIP

RIP Configuration Mode

The router rip command places the switch in router-RIP configuration mode to configure Routing Information Protocol (RIP) routing.

Example

This command places the switch in router-RIP configuration mode.
switch(config)#router rip
switch(config-router-rip)#

Using the router rip command puts the switch in router-RIP configuration mode, but does not enable RIP on the switch.

Enabling RIP

Routing Information Protocol (RIP) is disabled on the switch by default. The no shutdown (RIP) command in router-RIP configuration mode will enable RIP.

Example

This command enables RIP on the switch.
switch(config-router-rip)#no shutdown
switch(config-router-rip)#

Issuing this command enables RIP, but to send and receive RIP route updates and to route packets via RIP you must also specify interfaces on which RIP will run by using the network (RIP) command.

Disabling RIP

You can disable RIP in two ways. The shutdown (RIP) command disables RIP on the switch but maintains all user-entered router-RIP configuration statements in the running-config. The no router rip command disables RIP and removes all user-entered router-RIP configuration statements from the running-config.

Examples
  • This command disables RIP on the switch and removes all user-entered router-RIP configuration.
    switch(config)#no router rip
    switch(config)#
  • This command disables RIP on the switch, but preserves all user-entered router-RIP configuration.
    switch(config-router-rip)#shutdown
    switch(config-router-rip)#

Configuring RIP

Issuing the no shutdown (RIP) command in router-RIP configuration mode enables RIP, but to run RIP on an interface you must specify a RIP network by using the network (RIP) command.

You can also configure the redistribution of routes learned from other protocols, set the default metric and administrative distance for redistributed routes, configure the timing of various RIP events, and configure specific interfaces to send RIP update packets by broadcast instead of multicast.

Specifying RIP Networks

The network (RIP) command identifies networks on which RIP will run and also specifies which routes RIP will accept into its routing table. You can issue the network (RIP) command multiple times to build up a list of RIP networks. No RIP networks are configured by default, so in order to route packets and send and receive RIP updates you must specify one or more RIP networks.

To disable RIP on a specific network, use the no network (RIP) command.

Examples
  • This command enables RIP on 10.168.1.1/24.
    switch(config-router-rip)network 10.168.1.1/24
    switch(config-router-rip)#
  • This command disables RIP on 10.168.1.1/24.
    switch(config-router-rip)#no network 10.168.1.1/24
    switch(config-router-rip)#

Redistributing Routes Learned from Other Protocols into RIP

To enable route import from a specified protocol into RIP, use the redistribute (RIP) command. Additionally, you can apply a route map to the incoming routes to filter which routes are added to the RIP routing table. All connected routes are redistributed into RIP by default.

Example

This command redistributes all routes learned from OSPF into RIP.
switch(config-router-rip)#redistribute OSPF
switch(config-router-rip)#

Configuring RIP Timers

When RIP is running on the switch, it sends unsolicited route updates and deletes expired routes at regular intervals. To configure the timing of those events, use the timers (RIP) command. The command takes three parameters: the update interval, the route expiration time, and the route deletion time.

The update interval is the amount of time in seconds that the switch waits between sending unsolicited RIP route updates to its neighbors. The route expiration time is how long the switch waits before marking an unadvertised route for deletion (the counter resets whenever an advertisement for the route is received). And the route deletion time is how long the switch waits between marking a route for deletion and removing it from the routing table. During the deletion interval, the switch continues to forward packets on the route.

Example

This command sets the update interval to 60 seconds, expiration time to 90 seconds, and deletion time to 150 seconds.
switch(config-router-rip)#timers 60 90 150
switch(config-router-rip)#

Configuring an Interface to Transmit Broadcast RIP Updates

By default, the switch uses RIP version 2 and multicasts RIP update packets from all participating interfaces. To reconfigure a specific interface to send updates as broadcast packets, use the rip v2 multicast disable command in the configuration mode for the interface.

Example

The following commands configure RIP version 2 broadcasting on interface ethernet5.
switch(config)#interface ethernet5
switch(config-if-Et5)#rip v2 multicast disable
switch(config-if-Et5)#exit
switch(config)#

Displaying RIP Information

Displaying RIP Routes

To see a listing of the RIP routes in the switch’s routing table, use the show ip rip database command. (You can also display similar information using the RIP option in the show ip route command.)

Examples
  • This command displays all active rip routes.
    switch>show ip rip database
    10.168.11.0/24 directly connected, Et4
    10.168.13.0/24
    [1] via 10.168.14.2, 00:00:25, Et4
    [2] via 10.168.15.2, 00:00:20, Et1
    10.168.13.0/24
    [1] via 10.168.14.2, 00:00:25, Et3
  • switch>show ip rip database 10.168.13.0/16
    10.168.13.0/24
    [1] via 10.168.14.2, 00:00:25, Et4
    [2] via 10.168.15.2, 00:00:20, Et1
    This command submits a query for RIP route information for a network.

Displaying RIP Route Gateways

To see information about the switch’s RIP route gateways, use the show ip rip neighbors command. The output displays the IPv4 address, the last heard time of the gateway, and characteristic flags applying to the gateway.

Example

This command displays information about all the gateways of RIP routes.
switch>show ip rip neighbors
Gateway     Last-Heard   Bad-Packets   Bad-Routes   Flags
10.2.12.33  00:00:15                                SRC, TRSTED,
                                                    ACCPTED, RJCTED,
                                                    Q_RJCTED, AUTHFAIL

Configuring RIP on Multiple VRFs

VRF support for Routing Information Protocol (RIP) allows instances of RIP on multiple non-default VRFs on the same router. By default, all interfaces belong to the default VRF until VRF forwarding is executed.

The vrf instanceand vrf (Interface mode) commands configure a non-default VRF, enable routing in it, and configure the network command under the configuration router RIP for the prefix to which the interface belongs.

The router rip vrf command places the switch in router-RIP configuration mode to configure a RIP routing instance in a non-default VRF.

Examples
  • These commands configure a non-default VRF and enable unicast routing in it.
    switch(config)# vrf instance test
    switch(config-vrf-test)# exit
    switch(config)# ip routing vrf test
    switch(config)#
  • This command configures a RIP instance in a non-default VRF.
    switch(config)# router rip vrf test
    switch(config-router-rip-router-rip-vrf-test)# no shutdown
    switch(config-router-rip)# exit
    switch(config)#
  • This command configures an interface as part of a non-default VRF by configuring the network command under the configuration router RIP for the prefix to which the interface belongs.
    switch(config)# interface Ethernet 3 / 1
    switch(config-if-Et3/1)# no switchport
    switch(config-if-Et3/1)# ip address 1.0.0.1/24
    switch(config-if-Et3/1)# vrf test
    switch(config-if-Et3/1)# network 1.0.0.1
    switch(config-if-Et3/1)# exit
    switch(config)#

RIP Commands

distance (RIP)

The distance command assigns an administrative distance to routes that the switch learns through RIP. Routers use administrative distances to select a route when two protocols provide routing information to the same destination. Distance values range from 1 to 255; lower distance values correspond to higher reliability. The default RIP distance value is 120.

The no distance and default distance commands restore the administrative distance default value of 120 by removing the distance command from running-config.

Command Mode

Router-RIP Configuration

Command Syntax

distance distance_value

no distance

default distance

Parameter

distance_value     distance assigned to RIP routes. Values range from 1 to 255.

Example

These commands assign an administrative distance of 75 to RIP routes.

switch(config)# router rip
switch(config-router-rip)# distance 75
switch(config-router-rip)#

distribute-list (RIP)

The distribute-list command allows users to filter out routes that are received or sent out. The distribute-list command influences which routes the router installs into its routing table and advertises to its neighbors.

Configuration Notes:
  • Only one inbound distribute-list is allowed per interface.
  • Only one outbound distribute-list is allowed per interface.
  • Only one globally-defined inbound distribute-list is allowed.
  • Only one globally-defined outbound distribute-list is allowed.
  • Not all match clauses in a route-map are supported using RIP routes filtering. These match clauses for distribute-lists are supported:
    • match ip address access-list
    • match ip address prefix-list
  • The distribute-list command does not enforce the specified route-map to contain only supported match clauses.
  • Permit or deny can be specified in both prefix/access list and route-map configurations. The following rules apply when filtering routes:

    • Routes permitted by the prefix/access lists are treated as matched.
    • Matched routes are filtered based on the permit or deny option configured for the route-map clause.
    • Unmatched routes are further evaluated by the next route-map clause.
    • If a route does not match any clause in a route-map, it is denied.
    • If the route-map given in the distribute-list command is not configured, then all routes are permitted.
    • When multiple inbound (or outbound) distribute-lists are configured, only the most specific one is applied.

The no distribute-list and default distribute-list commands remove the corresponding distribute-list command from running-config.

Command Mode

Router-RIP Configuration

Command Syntax

distribute-list DIRECTION MAP [INTF]

no distribute-list DIRECTION MAP [INTF]

default distribute-list DIRECTION MAP [INTF]

Parameters
  • DIRECTION     direction specifies if distribute-list is applied on inbound or outbound traffic. Valid options include:
    • in     specifies inbound as the direction the distribute-list is applied.
    • out     specifies outbound as the direction the distribute-list is applied.
  • MAP     specifies route map that assigns attribute values to the network. Options include:
    • no parameter     attributes are not assigned through a route map.
    • route-map map_name     attributes listed by specified route map are assigned to the network.
  • INTF     interface to be configured. Options include:

    • ethernet e_num    Ethernet interface.
    • loopback l_num   Loopback interface.
    • port-channel p_num    Port channel interface.
    • vlan v_num    VLAN interface.
Examples
  • The following commands demonstrate that an access-list or prefix-list can be used within a route-map for use in a distribute-list.
    switch(config)# ip prefix-list 8to24 seq 5 permit 0.0.0.0/0 ge 8 le 24
    switch(config)# route-map myRouteMap permit 10
    switch(config-route-map-myRouteMap)# match ip address prefix-list 8to24
    switch(config-route-map-myRouteMap)# exit
    switch(config)#
    switch(config)# router rip
    switch(config-router-rip)# distribute-list in route-map myRouteMap
    switch(config-router-rip)#
  • These commands suppress routes advertised on a particular interface.

    switch(config)# ip prefix-list 2 seq 10 deny 30.1.1.0/24
    switch(config)# route-map myRmOut permit 10
    switch(config-route-map-myRmOut)# match ip address prefix-list 2
    switch(config-route-map-myRouteMap)# exit
    switch(config)# router rip
    switch(config-router-rip)# distribute-list out route-map myRmOut

metric default

The metric default command specifies the metric value assigned to RIP routes learned from other protocols. All routes imported into RIP receive the default metric unless a matching route-map exists for the route. The route metric of 0 is assigned to redistributed connected and static routes. The default metric values range from 0 to 16 with a default value of 1.

The no metric default and default metric default commands remove the metric default command from running-config and returns the metric value to its default value of 1.

Command Mode

Router-RIP Configuration

Command Syntax

metric default metric_value

no metric default

default metric default

Parameter

metric_value     default metric value assigned. Values range from 0 to 16; default is 1.

Example

This command sets the default metric value to 5.

switch(config)# router rip
switch(config-router-rip)# metric default 5
switch(config-router-rip)#

network (RIP)

The network command specifies which network the switch runs Routing Information Protocol (RIP), and also specifies which routes will be accepted into the RIP routing table. Multiple network commands can be issued to create a network list on which RIP runs.

The switch enables RIP on all interfaces in the specified network.

The no network and default network commands disable RIP on the specified network by removing the corresponding network command from running-config.

Command Mode

Router-RIP Configuration

Command Syntax

network NETWORK_ADDRESS

no network NETWORK_ADDRESS

default network NETWORK_ADDRESS

Parameters

NETWORK_ADDRESS     network IP address. Entry formats include the following:
  • ipv4_subnet     IPv4 subnet (CIDR notation).
  • ipv4_addr mask wildcard_mask     IP address and wildcard-mask.
Examples
  • This command enables RIP on 10.168.1.1/24.
    switch(config)# router rip
    switch(config-router-rip)# network 10.168.1.1/24
    switch(config-router-rip)#
  • This command also enables RIP on 10.168.1.1/24.
    switch(config-router-rip)# network 10.168.1.1 mask 0.0.0.255
    switch(config-router-rip)#

redistribute (RIP)

The redistribute command enables the importing of routes from a specified routing domain to RIP.
  • connected by default, RIP redistributes all connected routes that are established when IP is enabled on an interface. The route-map parameter facilitates the exclusion of connected routes from redistribution by specifying a route map that denies the excluded routes.
  • BGP, OSPF, and IP static routes by default, routes are not redistributed. The redistribute command without the route-map parameter facilitates the redistribution of all routes from the specified source.

The no redistribute and default redistribute commands reset the default route redistribution setting by removing the redistribute statement from running-config.

Command Mode

Router-RIP Configuration

Command Syntax

redistribute connected ROUTE_MAP

redistribute ROUTE_TYPE [ROUTE_MAP]

no redistribute connected ROUTE_MAP

no redistribute ROUTE_TYPE

default redistribute connected ROUTE_MAP

default redistribute ROUTE_TYPE

Parameters
  • ROUTE_TYPE     source from which routes are redistributed. Options include:
    • BGP     routes from a BGP domain.
    • OSPF routes from an OSPF domain.
    • OSPF match external     routes external to RIP, but imported from OSPF.
    • OSPF match internal OSPF routes that are internal to the AS.
    • static     IP static routes.
  • ROUTE_MAP    route map that determines the routes that are redistributed. Options include:
    • no parameter     all routes are redistributed.
    • route-map map_name      only routes in the specified route map are redistributed.

Example

These commands redistribute OSPF routes into RIP.

switch(config)# router rip
switch(config-router-rip)# redistribute OSPF
switch(config-router-rip)#

rip v2 multicast disable

The rip v2 multicast disable command specifies the transmission of Routing Information Protocol (RIP) version 2 update packets from the configuration mode interface as broadcast to 255.255.255.255.

The no rip v2 multicast disable and default rip v2 multicast disable commands specify the transmission of update packets as multicast to 224.0.0.9 if the configuration mode interface is multicast capable. Updates are broadcast if the interface is not multicast capable.

Command Mode

Interface-Ethernet Configuration

Interface-Port-Channel Configuration

Interface-VLAN Configuration

Command Syntax

rip v2 multicast disable

no rip v2 multicast disable

default rip v2 multicast disable

Example

The following example configures version 2 broadcasting on interface ethernet 5.

switch(config)# interface ethernet 5
switch(config-if-Et5)# rip v2 multicast disable
switch(config-if-Et5)# exit
switch(config)#

router rip vrf

The router rip command places the switch in router-RIP configuration mode to configure an RIP routing instance in the non-default VRF.

The no router rip vrf and default router rip vrf commands disable an RIP routing instance in the non-default VRF, and remove all user-entered router-rip configuration statements from running-config. To disable RIP without removing configuration statements, use the shutdown (RIP) command.

The exit command returns the switch to global configuration mode.

Command Mode

Global Configuration

Command Syntax

router rip vrf [RIP_INSTANCE]

no router rip vrf [RIP_INSTANCE]

default router rip vrf [RIP_INSTANCE]

Parameter

RIP_INSTANCE     configure a RIP VRF instance in the non-default VRF.

Examples
  • This command configures a RIP instance in the non-default VRF.
    switch(config)# router rip vrf test
    switch(config-router-rip-router-rip-vrf-test)# no shutdown
    switch(config-router-rip)# exit
    switch(config)#
  • This command disables a RIP instance in the non-default VRF.
    switch(config)# no router rip vrf test
    switch(config)#

router rip

The router rip command places the switch in router-rip configuration mode to configure the Routing Information Protocol (RIP) routing process. Router-rip configuration mode is not a group change mode; running-config is changed immediately upon command entry. The exit command does not affect running-config.

The no router rip and default router rip commands disable RIP and remove all user-entered router-rip configuration statements from running-config. To disable RIP without removing configuration statements, use the shutdown (RIP) command.

The exit command returns the switch to the global configuration mode.

Command Mode

Global Configuration

Command Syntax

router rip

no router rip

default router rip

Commands Available in router-rip Configuration Mode

Example

This command places the switch in the router-rip configuration mode.

switch(config)# router rip 
switch(config-router-rip)#

show ip rip database

The show ip rip database command displays information about routes in the Routing Information Base. The default command displays active routes and learned routes not used in deference to higher priority routes from other protocols.

This command has the following forms:

  • default (no arguments): information about all RIP routes.
  • IPv4 address and mask: information about the referenced addresses.
  • active: information about routes not superseded by routes from other protocols.

Command Mode

EXEC

Command Syntax

show ip rip database [FILTER]

Parameters

FILTER     routing table entries that the command displays. Values include :.
  • no parameter     displays all routing table entries.
  • active  displays all active routing table entries.
  • net_addr     subnet address (CIDR or address-mask). Command displays entries in this subnet.
Examples
  • This command displays all active rip routes.
    switch> show ip rip database active
    10.168.11.0/24 directly connected, Et4
    10.168.13.0/24
    [1] via 10.168.14.2, 00:00:25, Et4
    [2] via 10.168.15.2, 00:00:20, Et1
    10.168.13.0/24
    [1] via 10.168.14.2, 00:00:25, Et3
  • This command submits a query for RIP route information for a network.
    switch> show ip rip database 10.168.13.0/16
    10.168.13.0/24
    [1] via 10.168.14.2, 00:00:25, Et4
    [2] via 10.168.15.2, 00:00:20, Et1
  • This command returns information for all RIP routes.
    switch> show ip rip database
    10.1.0.0/255.255.255.0
    [1] via 10.8.31.15, 00:00:21, Et2, holddown
    10.2.0.0/255.255.255.0
    [1] via 10.8.31.15, 00:00:21, Et2, holddown
    10.3.0.0/255.255.255.0
    [1] via 10.8.31.15, 00:00:21, Et2, inactive
    10.212.0.0/255.255.255.0
    [1] via 10.8.31.15, 00:00:21, Et2, active
    10.214.0.0/255.255.255.0
    [1] via 10.8.12.17, 00:00:30, Et4, active

show ip rip neighbors

The show ip rip neighbors command displays information about all RIP route gateways. The output displays the IPv4 address, the last heard time of the gateway, and characteristic flags applying to the gateway.

Command Mode

EXEC

Command Syntax

show ip rip neighbors

Example

The show ip rip neighbors command displays information about all gateways of RIP routes.
switch> show ip rip neighbors
Gateway     Last-Heard      Bad-Packets     Bad-Routes    Flags
10.2.12.33  00:00:15                                      SRC, TRSTED,
                                                          ACCPTED, RJCTED,
                                                          Q_RJCTED, AUTHFAIL

shutdown (RIP)

The shutdown command disables RIP on the switch without modifying the RIP configuration. RIP is disabled by default.

The no shutdown command enables RIP. The default shutdown command disables RIP.

Command Mode

Router-RIP Configuration

Command Syntax

shutdown

no shutdown

default shutdown

Examples
  • This command disables RIP on the switch.

    switch(config)# router rip
    switch(config-router-rip)# shutdown
    switch(config-router-rip)#
  • This command enables RIP on the switch.

    switch(config-router-rip)# no shutdown
    switch(config-router-rip)#

timers (RIP)

The timers command configures the update interval, the expiration time, and the deletion time for routes received and sent through RIP. The command requires value declaration of all values.
  • The update time is the interval between unsolicited route responses.
  • The expiration time is initialized when a route is established and any time an update is received for the route.
  • The deletion time is initialized when the expiration time elapses and the route is invalid. It is retained in the routing table until deletion time expiry.

The no timers and default timers commands return the timer values to their default values by removing the timers command from running-config.

Command Mode

Router-RIP Configuration

Command Syntax

timers update_time expire_time deletion_time

no timers

default timers

Parameters
  • update_time      Default is 30 seconds.
  • expire_time    Default is 180 seconds.
  • deletion_time     Default is 120 seconds.

Parameter values are in seconds and range from 5 to 2147483647.

Example

This command sets the update (60 seconds), expiration (90 seconds), and deletion (150 seconds) times.

switch(config)# router rip
switch(config-router-rip)# timers 60 90 150
switch(config-router-rip)#