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
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
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.
- 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.
- 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
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
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
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.)
- 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
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
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
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.
- 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
Global Configuration Commands
Interface Configuration Commands
Router-rip Configuration Mode
Display Commands – EXEC Mode
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.
- 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]
- 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.
- 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
- ipv4_subnet IPv4 subnet (CIDR notation).
- ipv4_addr mask wildcard_mask IP address and wildcard-mask.
-
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)
- 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
- 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.
-
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
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
- 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.
-
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
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
-
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 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
- 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)#