RIP (Routing Information Protocol)
RIP (Routing Information Protocol)
Section titled âRIP (Routing Information Protocol)âTL;DR (Quick Start)
Section titled âTL;DR (Quick Start)âFor the impatient: basic RIP setup in RouterOS v7.
# Create RIP instance with redistribution/routing/rip/instance/add name=rip1 redistribute=connected,static
# Add interfaces to RIP/routing/rip/interface-template/add instance=rip1 interfaces=ether2,ether3Verify with:
/routing/rip/neighbor/printOverview
Section titled âOverviewâWhat this does: RIP (Routing Information Protocol) is a distance-vector routing protocol that automatically shares routing information between routers. It uses hop count as its metric, selecting routes with the fewest hops.
When to use this:
- Small networks (15 hops or fewer between any routers)
- Simple dynamic routing requirements
- Legacy environments requiring RIP compatibility
- Learning dynamic routing concepts
Prerequisites:
- IP addresses configured on participating interfaces
- Firewall allowing UDP port 520
- Multicast 224.0.0.9 reachable (or use static neighbors)
15 Hop Limit
RIP has a maximum metric of 15 hops. Routes requiring 16+ hops are considered unreachable. For larger networks, use OSPF instead.
Configuration Steps
Section titled âConfiguration StepsâStep 1: Create RIP Instance
Section titled âStep 1: Create RIP InstanceâCreate an instance with route redistribution:
/routing/rip/instance/add name=rip1 redistribute=connected,staticThe redistribute setting determines which routes RIP advertises:
connected: Directly connected networksstatic: Static routesospf: Routes from OSPFbgp: Routes from BGP
Step 2: Add Interface Template
Section titled âStep 2: Add Interface TemplateâDefine which interfaces participate in RIP:
/routing/rip/interface-template/add instance=rip1 interfaces=ether2,ether3You can use wildcards: interfaces=ether* or interfaces=bridge1,vlan*
Step 3: Verify Neighbors
Section titled âStep 3: Verify NeighborsâCheck that RIP neighbors are discovered:
/routing/rip/neighbor/printExpected output:
Columns: INSTANCE, ADDRESS, PACKETS-RX, PACKETS-TX, ENTRIES# INSTANCE ADDRESS PACKETS-RX PACKETS-TX ENTRIES0 rip1 192.168.1.2 125 130 12Step 4: Verify Routes
Section titled âStep 4: Verify RoutesâCheck that RIP routes are in the routing table:
/ip/route/print where routing-table=main protocol=ripCommon Scenarios
Section titled âCommon ScenariosâScenario: RIP with MD5 Authentication (v7.10+)
Section titled âScenario: RIP with MD5 Authentication (v7.10+)âSecure RIP with MD5 authentication:
Step 1: Create key chain
/routing/rip/keys/add chain=rip-auth key=secretkey123 key-id=1Step 2: Apply to interface template
/routing/rip/interface-template/add instance=rip1 interfaces=ether2 key-chain=rip-authBoth routers must have identical key configuration.
Scenario: Plain-Text Authentication
Section titled âScenario: Plain-Text AuthenticationâFor environments not requiring strong security:
/routing/rip/interface-template/add instance=rip1 interfaces=ether2 password=simplepassScenario: Passive Interface (Receive Only)
Section titled âScenario: Passive Interface (Receive Only)âReceive RIP routes without advertising:
/routing/rip/interface-template/add instance=rip1 interfaces=ether1 mode=passiveUse case: Receiving routes from an upstream ISP without advertising your networks.
Scenario: Advertise Default Route
Section titled âScenario: Advertise Default RouteâAdvertise a default route to RIP neighbors:
/routing/rip/instance/set rip1 originate-default=alwaysOptions:
never: Donât originate default (default)always: Always advertise defaultif-installed: Only if default route exists in routing table
Scenario: Filter Advertised Routes
Section titled âScenario: Filter Advertised RoutesâControl which routes are advertised:
Step 1: Create output filter
/routing/filter/rule/add chain=rip-out rule="if (dst in 192.168.0.0/16 && dst-len>=16 && dst-len<=24) { accept }"/routing/filter/rule/add chain=rip-out rule="reject"Step 2: Apply to instance
/routing/rip/instance/set rip1 out-filter-chain=rip-outDo not use protocol rip in filter rules when filtering redistributed connected/static routes. This only matches routes learned from other RIP speakers.
Scenario: Static Neighbor (Unicast)
Section titled âScenario: Static Neighbor (Unicast)âWhen multicast doesnât work (filtered switches, tunnels):
/routing/rip/static-neighbor/add instance=rip1 address=192.168.1.2Scenario: IPv6 RIPng
Section titled âScenario: IPv6 RIPngâConfigure RIP for IPv6:
/routing/rip/instance/add name=ripng afi=ipv6 redistribute=connected/routing/rip/interface-template/add instance=ripng interfaces=ether2Scenario: Adjust RIP Timers
Section titled âScenario: Adjust RIP TimersâCustomize update and timeout intervals:
/routing/rip/instance/set rip1 update-interval=15s route-timeout=90s route-gc-timeout=60sDefault timers:
update-interval: 30s (sends updates)route-timeout: 180s (marks route invalid)route-gc-timeout: 120s (removes invalid route)
Scenario: Enable Split-Horizon with Poison-Reverse
Section titled âScenario: Enable Split-Horizon with Poison-ReverseâFor better loop prevention:
/routing/rip/interface-template/set [find instance=rip1] split-horizon=yes poison-reverse=yes- Split-horizon: Donât advertise routes back to the learning interface
- Poison-reverse: Advertise learned routes back with metric 16 (unreachable)
Scenario: Adjust Interface Cost
Section titled âScenario: Adjust Interface CostâAdd metric to routes learned on an interface:
/routing/rip/interface-template/set [find interfaces=ether3] cost=5Routes learned via ether3 will have 5 added to their metric.
Verification
Section titled âVerificationâConfirm RIP is working correctly:
Check 1: Verify Instance
Section titled âCheck 1: Verify Instanceâ/routing/rip/instance/printExpected: Instance with redistribute settings.
Check 2: Verify Interface Templates
Section titled âCheck 2: Verify Interface Templatesâ/routing/rip/interface-template/printExpected: Templates with interfaces defined.
Check 3: View Active Interfaces
Section titled âCheck 3: View Active Interfacesâ/routing/rip/interface/printExpected: Interfaces running RIP.
Check 4: Check Neighbors
Section titled âCheck 4: Check Neighborsâ/routing/rip/neighbor/printExpected: Neighbor addresses with packet counts.
Check 5: View RIP Routes
Section titled âCheck 5: View RIP Routesâ/ip/route/print where protocol=ripExpected: Routes with rip protocol.
Check 6: Check for Errors
Section titled âCheck 6: Check for Errorsâ/routing/rip/neighbor/printLook at packets-bad and entries-bad columns for authentication issues.
Troubleshooting
Section titled âTroubleshootingâ| Symptom | Cause | Solution |
|---|---|---|
| No routes advertised | redistribute not set | Add redistribute=connected,static to instance |
| Routes received but inactive | Firmware bug or gateway unreachable | Reboot router; verify gateway connectivity |
| No neighbors discovered | Firewall blocking UDP 520 or multicast | Allow UDP 520; check multicast 224.0.0.9 |
| Routes exceed 15 hops | Network too large for RIP | Use OSPF instead; reduce network diameter |
| Output filter blocking routes | Using protocol rip in filter | Remove protocol matcher; filter by destination only |
| Authentication failures | Key mismatch | Verify identical key-chain on both routers |
| Passive mode not receiving | Interface not in template | Add interface to template with mode=passive |
| v7 neighbor not showing | Neighbors show only when exchanging routes | Wait for updates; check interface templates |
Debug: Enable RIP Logging
Section titled âDebug: Enable RIP Loggingâ/system/logging/add topics=rip,!raw action=memory/log/print where topics~"rip"Debug: Check Bad Packets
Section titled âDebug: Check Bad Packetsâ/routing/rip/neighbor/printIncreasing packets-bad indicates authentication or protocol issues.
Debug: Verify Multicast Reachability
Section titled âDebug: Verify Multicast Reachabilityâ/tool/ping 224.0.0.9 interface=ether2 count=3If multicast fails, use static neighbors.
Common Mistakes
- Forgetting
redistribute- v7 requires explicit redistribution; adding interfaces alone isnât enough - Using
protocol ripin filters - This only matches RIP-learned routes, not redistributed connected/static - Subnet mismatch - Both routers must have interfaces in the same subnet for RIP to work
- Missing interface-template - Without it, the interface doesnât join multicast group 224.0.0.9
- Network too large - RIP cannot handle networks with more than 15 hops; use OSPF
RIP Timers Explained
Section titled âRIP Timers Explainedâ| Timer | Default | Purpose |
|---|---|---|
update-interval | 30s | Send routing updates |
route-timeout | 180s | Mark route invalid if no updates |
route-gc-timeout | 120s | Remove invalid route from table |
Convergence time = route-timeout + route-gc-timeout = 5 minutes by default.
Related Topics
Section titled âRelated TopicsâRouting Alternatives
Section titled âRouting Alternativesâ- OSPF - preferred for larger networks
- BGP - external routing protocol
- Static Routes - can be redistributed into RIP
Route Management
Section titled âRoute Managementâ- Routing Filters - filter RIP routes
- Routing Tables - multiple routing tables
Infrastructure
Section titled âInfrastructureâ- Firewall Basics - allow UDP 520 for RIP
- IP Addresses - interface addressing
Reference
Section titled âReferenceâ- MikroTik RIP Documentation
- RFC 2453 - RIPv2
Key Commands Reference
Section titled âKey Commands Referenceâ| Command | Description |
|---|---|
/routing/rip/instance/add | Create RIP instance |
/routing/rip/instance/print | View instances |
/routing/rip/interface-template/add | Add interfaces to RIP |
/routing/rip/interface/print | View active interfaces |
/routing/rip/neighbor/print | View discovered neighbors |
/routing/rip/static-neighbor/add | Add unicast neighbor |
/routing/rip/keys/add | Create authentication key |
Instance Properties
Section titled âInstance Propertiesâ| Property | Type | Default | Description |
|---|---|---|---|
name | string | - | Instance identifier |
vrf | string | main | VRF for this instance |
afi | ipv4/ipv6 | ipv4 | Address family |
redistribute | list | - | Sources: connected, static, ospf, bgp |
originate-default | enum | never | Advertise default route |
update-interval | time | 30s | Route update interval |
route-timeout | time | 180s | Route invalidation timeout |
route-gc-timeout | time | 120s | Garbage collection timeout |
in-filter-chain | string | - | Input routing filter |
out-filter-chain | string | - | Output routing filter |
Interface Template Properties
Section titled âInterface Template Propertiesâ| Property | Type | Default | Description |
|---|---|---|---|
instance | string | - | Associated RIP instance |
interfaces | string | - | Interface patterns |
cost | integer | 1 | Metric added to routes (1-15) |
split-horizon | yes/no | yes | Enable split-horizon |
poison-reverse | yes/no | no | Enable poison-reverse |
mode | enum | - | passive = receive only |
key-chain | string | - | MD5 authentication key chain |
password | string | - | Plain-text authentication |
Authentication Keys Properties
Section titled âAuthentication Keys Propertiesâ| Property | Type | Default | Description |
|---|---|---|---|
chain | string | - | Key chain name |
key | string | - | MD5 secret (max 16 chars) |
key-id | integer | - | Key identifier (0-255) |
valid-from | datetime | - | Key activation time |
valid-till | datetime | - | Key expiration time |
Protocol Limitations
Section titled âProtocol Limitationsâ| Limitation | Value |
|---|---|
| Maximum hop count | 15 |
| Unreachable metric | 16 (infinity) |
| RIPv1 support | Not supported |
| Route summarization | Not supported |
| Default update interval | 30 seconds |
| Typical convergence | 3-5 minutes |