summaryrefslogtreecommitdiff
path: root/docs/configuration/protocols/rip.md
blob: bd2bb65ff9c2c6a9a408bbf4ae1ac81b8b6161a0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
---
myst:
  html_meta:
    description: |
      RIP is a distance-vector routing protocol based on the Bellman-Ford
      algorithm. It determines the best route based on hop count and
      periodically advertises the routing table to neighbors.
    keywords: rip, ripv1, ripv2, distance-vector, bellman-ford,
      redistribute
---

(rip)=

# RIP

Developed in the 1970s at Xerox Labs, RIP is a distance-vector routing
protocol based on the Bellman-Ford algorithm.

RIP determines the best route based on hop count (number of routers
traversed). RIP-enabled routers periodically advertise their entire routing
table to neighbors, along with the metric (hop count) for each destination.

Supported versions:

- RIPv1: As described in
  [RFC 1058](https://datatracker.ietf.org/doc/html/rfc1058)
- RIPv2: As described in
  [RFC 2453](https://datatracker.ietf.org/doc/html/rfc2453)

## General configuration

```{cfgcmd} set protocols rip network \<A.B.C.D/M\>

**Enable RIP on all interfaces whose IP addresses fall within the specified
network.**
```

Example:

```none
set protocols rip network 192.0.2.0/24
```

```{cfgcmd} set protocols rip interface \<interface\>

**Enable RIP on the specified interface.**

Once applied, the interface sends and receives RIP packets.
```

Example:

```none
set protocols rip interface eth0
```

```{cfgcmd} set protocols rip neighbor \<A.B.C.D\>

**Configure a RIP neighbor using its IP address.**

Use this command when a neighbor cannot process multicast RIP updates. Once
configured, the local router sends updates directly to the specified
neighbor as unicast packets.
```

Example:

```none
set protocols rip neighbor 192.0.2.2
```

```{cfgcmd} set protocols rip passive-interface \<interface\>

**Enable passive mode for the specified interface.**

This prevents the router from sending outgoing RIP updates on the
interface, except to explicitly configured neighbors. Incoming RIP updates
are still accepted and processed.
```

Example:

```none
set protocols rip passive-interface eth0
```

```{cfgcmd} set protocols rip passive-interface default

**Enable passive mode for all interfaces.**

This prevents the router from sending outgoing RIP updates on all
interfaces, except to explicitly configured neighbors. The router still
receives and processes incoming RIP updates normally.
```

Example:

```none
set protocols rip passive-interface default
```

## Optional configuration

```{cfgcmd} set protocols rip default-distance \<1-255\>

**Configure the administrative distance for all RIP-learned routes.**

The administrative distance determines how RIP-learned routes are
prioritized against routes learned from other sources (such as BGP, OSPF,
or static routes) when multiple paths to the same destination exist.
```

```{note}
Routes assigned a distance of 255 are disabled and will not be installed
in the kernel forwarding table.
```

Example:

```none
set protocols rip default-distance 100
```

```{cfgcmd} set protocols rip network-distance \<A.B.C.D/M\> distance \<1-255\>

**Configure an administrative distance for RIP routes whose source IP
address falls within the specified network.**
```

Example:

```none
set protocols rip network-distance 192.0.2.0/24 distance 80
```

```{cfgcmd} set protocols rip network-distance \<A.B.C.D/M\> access-list \<name\>

**Restrict administrative distance assignments to RIP routes whose source
IP address matches the specified network and the route itself matches the
specified access-list.**
```

Example:

```none
set protocols rip network-distance 192.0.2.0/24 distance 80
set protocols rip network-distance 192.0.2.0/24 access-list 10
```

```{cfgcmd} set protocols rip default-information originate

**Generate and advertise a default route (`0.0.0.0/0`) to all RIP
neighbors.**
```

Example:

```none
set protocols rip default-information originate
```

```{cfgcmd} set protocols rip distribute-list access-list \<in|out\> \<0-4294967295\>

**Apply an access-list to filter RIP routes in the inbound or outbound
direction.**

- `in`: Filters routes received from RIP neighbors.
- `out`: Filters routes advertised to RIP neighbors.
```

Example:

```none
set protocols rip distribute-list access-list in 20
```

```{cfgcmd} set protocols rip distribute-list interface \<interface\> access-list \<in|out\> \<0-4294967295\>

**Apply an access-list to filter RIP routes in the inbound or outbound
direction on the specified interface.**

- `in`: Filters routes received from RIP neighbors on this interface.
- `out`: Filters routes advertised to RIP neighbors on this interface.
```

Example:

```none
set protocols rip distribute-list interface eth0 access-list in 20
```

```{cfgcmd} set protocols rip distribute-list prefix-list \<in|out\> \<name\>

**Apply a prefix-list to filter RIP routes in the inbound or outbound
direction.**

- `in`: Filters routes received from RIP neighbors.
- `out`: Filters routes advertised to RIP neighbors.
```

Example:

```none
set protocols rip distribute-list prefix-list in INBOUND-FILTER
```

```{cfgcmd} set protocols rip distribute-list interface \<interface\> prefix-list \<in|out\> \<name\>

**Apply a prefix-list to filter RIP routes on the specified interface in
the inbound or outbound direction.**

- `in`: Filters routes received from RIP neighbors on this interface.
- `out`: Filters routes advertised to RIP neighbors on this interface.
```

Example:

```none
set protocols rip distribute-list interface eth0 prefix-list in RIP-IN
```

```{cfgcmd} set protocols rip route \<A.B.C.D/M\>

**Add a static route to the RIP routing process.**

The route is created only inside RIP.

This command is specific to FRR and VyOS and should only be used by
advanced users with a strong understanding of the RIP protocol.

For most deployments, the recommended approach is to create a standard
static route and redistribute it into RIP using
`set protocols rip redistribute static`.
```

Example:

```none
set protocols rip route 192.0.2.0/24
```

```{cfgcmd} set protocols rip timers update \<5-2147483647\>

**Configure the RIP update timer, in seconds.**

The update timer defines how often the router sends unsolicited Response
messages to its RIP neighbors. Each Response contains the complete RIP
routing table.

The default value is 30 seconds.
```

Example:

```none
set protocols rip timers update 60
```

```{cfgcmd} set protocols rip timers timeout \<5-2147483647\>

**Configure the RIP route timeout, in seconds.**

If a route is not refreshed by an incoming update within this interval, it
becomes invalid. The router temporarily retains the invalid route in the
RIP routing table so that neighbors learn the route has been dropped.

The default value is 180 seconds.
```

Example:

```none
set protocols rip timers timeout 300
```

```{cfgcmd} set protocols rip timers garbage-collection \<5-2147483647\>

**Configure the RIP garbage-collection timer, in seconds.**

This timer starts when a route becomes invalid. When the timer expires,
the route is removed from the routing table.

The default value is 120 seconds.
```

Example:

```none
set protocols rip timers garbage-collection 60
```

## Redistribution configuration

```{cfgcmd} set protocols rip redistribute \<babel|bgp|connected|isis|kernel|nhrp|ospf|static\>

**Redistribute routes from the specified source into RIP.**

Routes learned from the chosen source are imported into the RIP routing
table and advertised to RIP neighbors as if they had been learned through
RIP itself.

The supported sources are:

- `babel`: Routes learned via Babel.
- `bgp`: Routes learned via BGP.
- `connected`: Directly connected routes.
- `isis`: Routes learned via IS-IS.
- `kernel`: Routes installed in the kernel routing table.
- `nhrp`: Routes learned via NHRP.
- `ospf`: Routes learned via OSPF.
- `static`: Routes configured statically.
```

Example:

```none
set protocols rip redistribute static
```

```{cfgcmd} set protocols rip redistribute \<babel|bgp|connected|isis|kernel|nhrp|ospf|static\> metric \<1-16\>

**Configure the metric for routes redistributed from the specified
source.**
```

Example:

```none
set protocols rip redistribute static metric 5
```

```{cfgcmd} set protocols rip redistribute \<babel|bgp|connected|isis|kernel|nhrp|ospf|static\> route-map \<name\>

**Apply a route-map to filter routes redistributed from the specified
source.**
```

Example:

```none
set protocols rip redistribute static route-map RIP-REDISTRIBUTE
```

```{cfgcmd} set protocols rip default-metric \<1-16\>

**Configure the default metric (hop count) applied to redistributed
routes.**

The default value is 1.
```

```{note}
This command does not affect connected routes redistributed via
`set protocols rip redistribute connected`. To configure the metric for
connected routes, use `set protocols rip redistribute connected metric`
explicitly.
```

Example:

```none
set protocols rip default-metric 5
```

## Interfaces configuration

```{cfgcmd} set protocols rip interface \<interface\> authentication plaintext-password \<text\>

**Enable simple password authentication for RIPv2 on the specified
interface and set a password.**

The password must not exceed 16 characters.
```

Example:

```none
set protocols rip interface eth0 authentication plaintext-password vyos-secret
```

```{cfgcmd} set protocols rip interface \<interface\> authentication md5 \<id\> password \<text\>

**Enable {abbr}`MD5 (Message-Digest Algorithm 5)` authentication for RIPv2
on the specified interface and set the MD5 key.**

The MD5 key must not exceed 16 characters.
```

Example:

```none
set protocols rip interface eth0 authentication md5 1 password vyos-secret
```

```{cfgcmd} set protocols rip interface \<interface\> split-horizon disable

**Disable split-horizon on the specified interface.**

By default, VyOS does not advertise RIP routes back through the interface
on which they were learned (split horizon). This command turns off that
default.
```

Example:

```none
set protocols rip interface eth0 split-horizon disable
```

```{cfgcmd} set protocols rip interface \<interface\> split-horizon poison-reverse

**Enable split horizon with poison reverse on the specified interface.**

If enabled, the router advertises the learned routes as unreachable on the
interface where they were learned.
```

Example:

```none
set protocols rip interface eth0 split-horizon poison-reverse
```

## Operational mode commands

```{opcmd} show ip rip

**Show all RIP routes.**
```

```none
vyos@vyos-1:~$ show ip rip
Codes: K - kernel route, C - connected, L - local, S - static,
       R - RIP, O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, F - PBR,
       f - OpenFabric, t - Table-Direct
Sub-codes:
      (n) - normal, (s) - static, (d) - default, (r) - redistribute,
      (i) - interface

Network            Next Hop         Metric From            Tag Time
C(i) 192.0.2.0/24       0.0.0.0               1 self              0
C(i) 198.51.100.0/24    0.0.0.0               1 self              0
R(n) 203.0.113.0/24     192.0.2.2             2 192.0.2.2         0 02:53
```

```{opcmd} show ip rip status

**Show the current RIP status.**
```

```none
Routing Protocol is "rip"
  Sending updates every 30 seconds with +/-50%, next due in 11 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 any version
    Interface        Send  Recv   Key-chain
    eth0             2     1 2
    eth2             2     1 2
  Routing for Networks:
    192.0.2.0/24
    eth0
  Routing Information Sources:
    Gateway          BadPackets BadRoutes  Distance Last Update
    192.0.2.2               0         0       120   00:00:11
  Distance: (default is 120)
```

## Example

The following example demonstrates a basic RIP configuration between two
routers, where directly connected networks are redistributed into RIP.

**Node 1:**

```none
set interfaces ethernet eth0 address '198.51.100.1/24'
set interfaces loopback lo address '192.0.2.1/32'
set protocols rip network 198.51.100.0/24
set protocols rip redistribute connected
```

**Node 2:**

```none
set interfaces ethernet eth0 address '198.51.100.2/24'
set interfaces loopback lo address '192.0.2.2/32'
set protocols rip network 198.51.100.0/24
set protocols rip redistribute connected
```