Routing Information Protocol (RIP)

Document revision 1.1 (02-May-2003)
This document applies to MikroTik RouterOS v2.7

Table of Contents

Summary

MikroTik RouterOS implements RIP Version 1 (RFC1058) and Version 2 (RFC 2453). RIP lets routers in the same autonomous system exchange routing information. It always uses the best path (the path with te fewest number of hops (i.e. routers)) available.

Specifications

Packages required : routing
License required : Any
Home menu level : /routing rip
Protocols utilized : RIPv1 (RFC1058), RIPv2 (RFC2453)
Hardware usage: not significant

Related Documents

Software Package Installation and Upgrading
IP Addresses and Address Resolution Protocol (ARP)
Routes, Equal Cost Multipath Routing, Policy Routing
Prefix Lists

Description

Routing Information Protocol (RIP) is one protocol in a series of routing protocols based on Bellman-Ford (or distance vector) algorithm. This Interior Gateway Protocol (IGP) lets routers in the same autonomous system exchange routing information in the way of periodic RIP updates. Routers transmit their own RIP updates to neighboring networks and listen to the RIP updates from the routers on those neighboring networks to ensure their routing table reflects current state of the network and all the best paths are available. Best path is a path with the fewest hops (routers gateways).

The routes learned by RIP protocol are installed in the route list with the distance of 120.

RIP Routing Setup

Submenu level : /routing rip
[admin@MikroTik] routing rip> print
       redistribute-static: no
    redistribute-connected: no
         redistribute-ospf: no
          redistribute-bgp: no
             metric-static: 1
          metric-connected: 1
               metric-ospf: 1
                metric-bgp: 1
              update-timer: 30s
             timeout-timer: 3m
             garbage-timer: 2m
[admin@MikroTik] routing rip>

Proprety Description

redistribute-static (yes | no, default: no) - redistribution of static routes to neighbor routers
redistribute-connected (yes | no, default: no) - redistribution of connected routes to neighbor routers
redistribute-ospf (yes | no, default: no) - redistribution of routes learned by OSPF to neighbor routers
redistribute-bgp (yes | no, default: no) - redistribution of routes learned by BGP to neighbor routers
metric-static (integer, default: 1) - metric, the distance to the destination for static routes
metric-connected (integer, default: 1) - metric, the distance to the destination for connected routes
metric-ospf (integer, default: 1) - metric, the distance to the destination for OSPF routes
metric-bgp (integer, default: 1) - metric, the distance to the destination for BGP routes
update-timer (time, default: 30s) - time period for RIP update to start
timeout-timer (time, default: 3m)- time period after route is not valid more
garbage-timer (time, default: 2m)- time period after dropped out route is dropped from neighbor router table

Notes

The maximum metric of RIP route can be 15. Metric higher than 15 is considered 'infinity' and routes with such metric are considered unreachable. Thus RIP cannot be used on networks with more than 15 hops between any two routers, and using redistribute metrics larger that 1 further reduces this maximum hop count.

Example

To enable RIP protocol to redistribute the routes to the connected networks:
[admin@MikroTik] routing rip> set redistribute-connected=yes
[admin@MikroTik] routing rip> print
       redistribute-static: no
    redistribute-connected: yes
         redistribute-ospf: no
          redistribute-bgp: no
             metric-static: 1
          metric-connected: 1
               metric-ospf: 1
                metric-bgp: 1
              update-timer: 30s
             timeout-timer: 3m
             garbage-timer: 2m
[admin@MikroTik] routing rip>

RIP Interfaces

Submenu level : /routing rip interface

Description

To run RIP you don't have to configure interfaces. This command level is only for additional configuration of RIP specific interface parameters.

Prorerty Description

interface (name, default: all) - interface on which rus RIP
  • all sets the defaults, that will be used for all the interfaces not having specific settings
    send (v1 | v1-2 | v2, default: v2) - distributed RIP protocol versions
    receive (v1 | v1-2 | v2, default: v2) - RIP protocol versions the router can receive
    authentication (none | simple | md5, default: none) - authentication method for RIP messages:
  • none - no authentication
  • simple - clear text authentication
  • md5 - Keyed Message Digest 5 (MD5) authentication
    authentication-key (string, default: "") - authentication key for RIP messages
    prefix-list-in (name, default: "") - name of the filtering prefix list for receiving routes
    prefix-list-out (name, default: "") - name of the filtering prefix list for advertising routes

    Notes

    Security issue: it is recommended not to use RIP version 1 when it is possible.

    Example

    To add an entry that specifies that sending routes to the ether1 interface, prefix list plout should be applied:
    [admin@MikroTik] routing rip> interface add interface=ether1 \
    \... prefix-list-out=plout
    [admin@MikroTik] routing rip> interface print
    Flags: I - inactive
      0   interface=ether1 receive=v2 send=v2 authentication=none
          authentication-key="" prefix-list-in=plout prefix-list-out=none
    
    
    [admin@MikroTik] routing rip>
    

    RIP Networks

    Submenu level : /routing rip network

    Description

    To start the RIP protocol, you have to define the networks on which RIP runs.

    Proprety Description

    address (IP address/mask, dafault: 0.0.0.0/0) - the network on which RIP is running. It allows defining one or multiple interfaces RIP to be run on. Only directly connected networks of the router may be specified
    network (IP address, default: 0.0.0.0) - specifies the network mask of the address (if it is not specified in the address argument)

    Notes

    For P2P links here you should set exactly the same as the network address is (that is remote point IP address). In this case, the correct netmask bits should be 32

    Example

    To enable RIP protocol on 10.10.1.0/24 network:
    [admin@MikroTik] routing rip network> add address=10.10.1.0/24
    [admin@MikroTik] routing rip network> print
      # ADDRESS
      0 10.10.1.0/24
    [admin@MikroTik] routing rip>
    

    RIP Neighbors

    Description

    The submenu is used to define a neighboring router with which to exchange routing information. Normally there is no need to add the neighbors, if the multicasting is working properly within the network. If there are problems with exchanging the routing information, the neighbors can be added to the list. It will force to exchange the routing information with the neighbor.

    Proprety Description

    address (IP address, dafault: 0.0.0.0) - the neighbour's address

    Example

    To force RIP protocol to exchange routing information with the 10.0.0.1 router:
    [admin@MikroTik] routing rip> neighbor add address=10.0.0.1
    [admin@MikroTik] routing rip> neighbor print
    Flags: I - inactive
      #   ADDRESS
      0   10.0.0.1
    [admin@MikroTik] routing rip>
    

    RIP Routes

    Submenu level : /routing rip route

    Property Description

    Statistics:

    dst-address (IP address/mask) - destination network address and netmask
    gateway (IP address) - last gateway to destination address
    metric (integer) - distance vector length to the network
    from (IP address) - from which router this route was received

    Notes

    This list shows the routes learned by all dynamic routing protocols (RIP, OSPF, BGP)

    Example

    To view the routes:
    [admin@MikroTik] routing rip route> print
    Flags: S - static, R - rip, O - ospf, C - connect, B - bgp
      0 O dst-address=0.0.0.0/32 gateway=10.7.1.254 metric=1 from=0.0.0.0
    
    ...
    
     33 R dst-address=159.148.10.104/29 gateway=10.6.1.1 metric=2 from=10.6.1.1
    
     34 R dst-address=159.148.10.112/28 gateway=10.6.1.1 metric=2 from=10.6.1.1
    
    [admin@MikroTik] routing rip route>
    

    RIP Examples

    Let us consider an example of routing information exchange between MikroTik router, a Cisco router, and the ISP (also mikrotik) routers:

    RIP Example

    The Configuration of the MikroTik Router

    The configuration of the MikroTik router is as follows:

    [admin@MikroTik] > interface print
    Flags: X - disabled, D - dynamic, R - running
      #    NAME                 TYPE             MTU
      0  R ether1               ether            1500
      1  R ether2               ether            1500
    [admin@MikroTik] > ip address print
    Flags: X - disabled, I - invalid, D - dynamic
      #   ADDRESS            NETWORK         BROADCAST       INTERFACE
      0   10.0.0.174/24      10.0.0.174      10.0.0.255      ether1
      1   192.168.0.1/24     192.168.0.0     192.168.0.255   ether2
    [admin@MikroTik] > ip route print
    Flags: X - disabled, I - invalid, D - dynamic, J - rejected,
    C - connect, S - static, R - rip, O - ospf, B - bgp
        #    DST-ADDRESS        G GATEWAY         DISTANCE INTERFACE
        0 DC 192.168.0.0/24     r 0.0.0.0         0        ether2
        1 DC 10.0.0.0/24        r 0.0.0.0         0        ether1
    [admin@MikroTik] >
    

    Note, that no default route has been configured. The route will be obtained using the RIP. The necessary configuration of the RIP general settings is as follows:

    [admin@MikroTik] routing rip> set redistribute-connected=yes
    [admin@MikroTik] routing rip> print
           redistribute-static: no
        redistribute-connected: yes
             redistribute-ospf: no
              redistribute-bgp: no
                 metric-static: 1
              metric-connected: 1
                   metric-ospf: 1
                    metric-bgp: 1
                  update-timer: 30s
                 timeout-timer: 3m
                 garbage-timer: 2m
    
    [admin@MikroTik] routing rip>
    

    The minimum required configuration of RIP interface is just enabling the network associated with the ether1 interface:

    [admin@MikroTik] routing rip network> add address=10.0.0.0/2
    [admin@MikroTik] routing rip network> print
      # ADDRESS
      0 10.0.0.0/24
    
    [admin@MikroTik] routing rip network>
    

    Note, that there is no need to run RIP on the ether2, as no propagation of RIP information is required into the Remote network in this example. The routes obtained by RIP can be viewed in the /routing rip route menu:

    [admin@MikroTik] routing rip> route print
    Flags: S - static, R - rip, O - ospf, C - connect, B - bgp
      0 R dst-address=0.0.0.0/0 gateway=10.0.0.26 metric=2 from=10.0.0.26
    
      1 C dst-address=10.0.0.0/24 gateway=0.0.0.0 metric=1 from=0.0.0.0
    
      2 C dst-address=192.168.0.0/24 gateway=0.0.0.0 metric=1 from=0.0.0.0
    
      3 R dst-address=192.168.1.0/24 gateway=10.0.0.26 metric=1 from=10.0.0.26
    
      4 R dst-address=192.168.3.0/24 gateway=10.0.0.26 metric=1 from=10.0.0.26
    
    [admin@MikroTik] routing rip>
    

    The regular routing table is:

    [MikroTik] routing rip> /ip route print
    Flags: X - disabled, I - invalid, D - dynamic, J - rejected,
    C - connect, S - static, R - rip, O - ospf, B - bgp
        #    DST-ADDRESS        G GATEWAY         DISTANCE INTERFACE
        0  R 0.0.0.0/0          r 10.0.0.26       120      ether1
        1  R 192.168.3.0/24     r 10.0.0.26       120      ether1
        2  R 192.168.1.0/24     r 10.0.0.26       120      ether1
        3 DC 192.168.0.0/24     r 0.0.0.0         0        ether2
        4 DC 10.0.0.0/24        r 0.0.0.0         0        ether1
    [admin@MikroTik] routing rip>
    

    As we can see, the MikroTik router has learned RIP routes from the Cisco router.

    The Configuration of the Cisco Router

    Cisco#show running-config
    ...
    interface Ethernet0
     ip address 10.0.0.26 255.255.255.0
     no ip directed-broadcast
    !
    interface Serial1
     ip address 192.168.1.1 255.255.255.252
     ip directed-broadcast
    !
    router rip
     version 2
     redistribute connected
     redistribute static
     network 10.0.0.0
     network 192.168.1.0
    !
    ip classless
    !
    ...
    

    The routing table of the Cisco router is:

    Cisco#show ip route
    Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP
           D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
           N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
           E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP
           i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, * - candidate default
           U - per-user static route, o - ODR
    
    Gateway of last resort is 192.168.1.2 to network 0.0.0.0
    
         10.0.0.0/24 is subnetted, 1 subnets
    C       10.0.0.0 is directly connected, Ethernet0
    R    192.168.0.0/24 [120/1] via 10.0.0.174, 00:00:19, Ethernet0
         192.168.1.0/30 is subnetted, 1 subnets
    C       192.168.1.0 is directly connected, Serial1
    R    192.168.3.0/24 [120/1] via 192.168.1.2, 00:00:05, Serial1
    R*   0.0.0.0/0 [120/1] via 192.168.1.2, 00:00:05, Serial1
    Cisco#
    

    As we can see, the Cisco router has learned RIP routes both from the MikroTik router (192.168.0.0/24), and from the ISP router (0.0.0.0/0 and 192.168.3.0/24).

    Additional Resources

    Links for RIP documentation:


    © Copyright 1999-2003, MikroTik