WeOS
5.20.1

# Routing Information Protocol

## Introduction

The Routing Information Protocol (RIP) is a dynamic routing protocol. RIP is an example of a distance vector routing protocol, and historically it has been one of the most widely used intra-domain unicast routing protocol within the Internet.

RIP is relatively simple to setup, but does not handle topology changes as rapidly as the OSPF dynamic routing protocol. Therefore, OSPF is generally preferred over RIP when it is possible to select dynamic routing protocol.

For information on OSPF, see the OSPF configuration page.

## Overview

RIP enabled routers will exchange routing information with their neighbors periodically. This in order to construct their own routing tables, with entries describing how to reach each of the participating routers.

In Figure 1 below, we have an example network of 5 RIP enabled routers. Each RIP router only needs to know the networks where other RIP enabled routers are located. Afterwards they will automatically construct their routing tables, no need for configuring static routing entries.

                 |                          |
             .---+---.                  .---+---.
             |       |                  |       |
             |   R   |                  |   R   |
             |       |                  |       |
             '---+---'                  '---+---'
                 |.1                        |.2
    -------------+------------+-------------+-------------
     10.0.1.0/24              |.3
                          .---+---.
                        .1|       |.1
                      +---+  R1   +---+
                      |   |       |   |
                      |   '-------'   |
     10.0.2.0/24      |               |       10.0.3.0/24
    -------------+----+---         ---+-----+-------------
                 |.2                        |.2
             .---+---.                  .---+---.
             |       |                  |       |
             |   R   |                  |   R   |
             |       |                  |       |
             '---+---'                  '---+---'
                 |                          |

Figure 1: Showing a router R1 connected to other routers across three different networks. With RIP running on each of the routers they will automatically learn routes to each other.

In order for a RIP router to find the best path, between the source and destination network, it utilizes hop count as a metric. The hop count is simply the amount of routers between the source and destination network. Therefore, when adding entries to the routing table, the path with the lowest hop count will be selected. For more information on routing table entries, see the Static Routing section.

Note

RIP has a maximum hop count of 15. This means that any destination that is more than 15 routers away from the source will be unreachable. One reason for this limitation is to prevent routing loops.

There are two different versions of RIP v1 and v2. One big difference is that RIPv2 routers exchange routing information using IP multicast (IP address 224.0.0.9). While RIPv1 uses broadcast to exchange routing information.

### Authentication

RIPv2 allows authentication of RIP messages. This can be helpful to avoid that false routing information is injected into your network (deliberately or by mistake). This is configured for each `iface` using the `auth` command.

### Route Redistribution

It is possible to redistribute routing information learnt externally (OSPF, con- nected routes or static routes) inside the RIP routing domain, using the `redistribute` command.

You can also let a RIP router inject a default route (0.0.0.0/0) into your RIP domain, using the `distribute-default` command.

### Passive Interface

In some situations you may wish to include a router’s subnets as part of the RIP routing domain without running RIP on the associated network interface. This can be done using the `passive` command under each `iface`.

## Configuration

The configuration of RIP is separated into two different parts. The actual router configuration and RIP related settings for each individual interface.

### Router

RIP is configured under the `router` section of the global configuration context:

    example:/#> configure
    example:/config/#> router
    example:/config/router/#> rip
    example:/config/router/rip/#>

#### Syntax

`[no] version <1|2>`

  Set the RIP version to use.

  Default: version 2.

  `no`
    Reset to the default setting.
`[no] distance <1-255>`

  Set protocol distance.

  Default: 120.

  `no`
    Reset to the default setting.
`[no] timers [update SEC] [invalid SEC] [flush SEC]`

  Control RIP protocol timers.

  Defaults:

  - `update` 30 seconds.
  - `invalid` 180 seconds.
  - `flush` 120 seconds.
  `no`
    Reset to the default settings.
  `SEC`
    Time value in whole seconds.
`[no] passive-interface`

  Control if RIP should be passive on all interfaces by default.

  Use the network command, or the per interface “passive” command to activate RIP on an interface. The neighbor command can also be useful.

  Default: `no passive-interface`, i.e, RIP is disabled on all interfaces.

  `no`
    Reset to the default setting.
`[no] neighbor <IPADDR[,IPADDR,...]>`

  Explicitly define a RIP neighbor.

  This can be useful when the neighbor in question cannot handle IP multicast and thus cannot receive RIP routing information. When explicitly defining a RIP neighbor it will receive routing updates over IP unicast.

  `no`
    Remove configured RIP neighbors.
  `IPADDR`
    IP address in standard quad-dotted notation, e.g. 192.168.1.1
`[no] network <IFACE|NETWORK[,NETWORK,...]>`

  Define RIP enabled networks.

  `no`
    Remove all configured RIP networks.
  `IFACE`
    Enable RIP for a given interface, e.g. `vlan1`.
  `NETWORK`
    IP address in standard quad-dotted notation including netmask, e.g. 192.168.1.1/24.
`[no] redistribute <connected|static|ospf>`

  Redistribute external routing information.

  - Use “redistribute connected” to redistribute routes to directly attached networks, which have not been defined to belong to any RIP area in the `network` command.

  - Use `redistribute static` to redistribute static routes set with the `ip route` command.

  - Use `redistribute ospf` to redistribute OSPF routes.

  Redistribution of the default route is handled separately with the `distribute-default` command.

  Default: Disabled for all three alternatives.

  `no`
    Disable redistribution.
`[no] distribute-default`

  Inject default route, i.e., announce network 0.0.0.0/0.

  Default: Disabled.

  `no`
    Disable distribution of the default route.

### Interface Specific Settings

To configure RIP related settings for an interface is located under the `iface` context:

    example:/#> configure
    example:/config/#> iface vlan1
    example:/config/iface-vlan1/#> rip
    example:/config/iface-vlan1/rip/#>

#### Syntax

`[no] passive [auto]`

  Control passive-interface setting for RIP on this interface.

  Default: Auto. Follows `router rip` `passive-interface` setting.

  `no`
    Disable.
  `auto`
    Use same setting as system wide RIP setting.
`[no] split-horizon [poisoned-reverse]`

  Enable, or disable, split horizon on this interface.

  Split horizon is a method that helps preventing routing loops. The principle is that a router will not advertise a route back to the interface it was learned from.

  Default: Enabled.

  `no`
    Disable.
  `poisoned-reverse`
    Actively advertise routes as unreachable over the interface which they were learned.
`[no] send-version <1,2>`

  RIP version to send on this interface.

  Default: Auto. Follows `router rip` `version` setting.

  `no`
    Resets to the default setting.
`[no] receive-version <1,2>`

  RIP version to receive on this interface.

  Default: Auto. Follows `router rip` `version` setting.

  `no`
    Resets to the default setting.
`[no] auth <md5 KEYID | plain> [hash] <SECRET>`

  Configure authentication of RIP messages on this interface.

  Default: None.

  `no`
    Remove any configured authentication.
  `md5`

    Use md5 cryptographic authentication.

    The `SECRET` when using md5 are text strings of 4-32 characters.

    The `KEYID` is a key identifier (0-255) associated with MD5 keys.

  `plain`

    Use a clear-text password as authentication.

    The `SECRET` when using plain text are text strings of 4-16 characters.

## Status

The current status of a RIP configured router can be observed in the exec context in the following manner:

    example:/#> show rip
    Routing Protocol is "rip"
      Sending updates every 30 seconds with +/-50%, next due in 17 seconds
      Timeout after 180 seconds, garbage collect after 120 seconds
      Outgoing update filter list for all interface is not set
      Incoming update filter list for all interface is not set
      Default redistribution metric is 1
      Redistributing:
      Default version control: send version 2, receive version 2
        Interface        Send  Recv   Key-chain
        vlan1            2     2
      Routing for Networks:
        vlan1
      Routing Information Sources:
        Gateway          BadPackets BadRoutes  Distance Last Update
        10.0.2.1                 0         0       120   00:00:10
      Distance: (default is 120)

We can also see any potential routes that RIP have added using `show ip route` as such:

    example:/#> show ip route
    S - Static | C - Connected | K - Kernel route  | > - Selected route
    O - OSPF   | R - RIP       | [Distance/Metric] | * - FIB route

    R>* 10.0.1.0/24 [120/2] via 10.0.2.1, vlan1, 00:02:08
    C>* 10.0.2.0/24 is directly connected, vlan1

Any route denoted with an `R` is a route that have been learned by RIP.

« Previous Next »