]> git.proxmox.com Git - mirror_frr.git/blob - doc/user/ripd.rst
Merge pull request #11668 from rampxxxx/bfd_rtt_in_echo_pkt
[mirror_frr.git] / doc / user / ripd.rst
1 .. _rip:
2
3 ***
4 RIP
5 ***
6
7 RIP -- Routing Information Protocol is widely deployed interior gateway
8 protocol. RIP was developed in the 1970s at Xerox Labs as part of the
9 XNS routing protocol. RIP is a :term:`distance-vector` protocol and is
10 based on the :term:`Bellman-Ford` algorithms. As a distance-vector
11 protocol, RIP router send updates to its neighbors periodically, thus
12 allowing the convergence to a known topology. In each update, the
13 distance to any given network will be broadcast to its neighboring
14 router.
15
16 *ripd* supports RIP version 2 as described in RFC2453 and RIP
17 version 1 as described in RFC1058.
18
19 .. _starting-and-stopping-ripd:
20
21 Starting and Stopping ripd
22 ==========================
23
24 The default configuration file name of *ripd*'s is :file:`ripd.conf`. When
25 invocation *ripd* searches directory |INSTALL_PREFIX_ETC|. If :file:`ripd.conf`
26 is not there next search current directory.
27
28 RIP uses UDP port 520 to send and receive RIP packets. So the user must have
29 the capability to bind the port, generally this means that the user must have
30 superuser privileges. RIP protocol requires interface information maintained by
31 *zebra* daemon. So running *zebra* is mandatory to run *ripd*. Thus minimum
32 sequence for running RIP is like below:
33
34 ::
35
36 # zebra -d
37 # ripd -d
38
39
40 Please note that *zebra* must be invoked before *ripd*.
41
42 To stop *ripd*. Please use::
43 kill `cat /var/run/ripd.pid`
44
45 Certain signals have special meanings to *ripd*.
46
47 +-------------+------------------------------------------------------+
48 | Signal | Action |
49 +=============+======================================================+
50 | ``SIGHUP`` | Reload configuration file :file:`ripd.conf`. |
51 | | All configurations are reset. All routes learned |
52 | | so far are cleared and removed from routing table. |
53 +-------------+------------------------------------------------------+
54 | ``SIGUSR1`` | Rotate the *ripd* logfile. |
55 +-------------+------------------------------------------------------+
56 | ``SIGINT`` | |
57 | ``SIGTERM`` | Sweep all installed routes and gracefully terminate. |
58 +-------------+------------------------------------------------------+
59
60 *ripd* invocation options. Common options that can be specified
61 (:ref:`common-invocation-options`).
62
63
64 .. _rip-netmask:
65
66 RIP netmask
67 -----------
68
69 The netmask features of *ripd* support both version 1 and version 2 of RIP.
70 Version 1 of RIP originally contained no netmask information. In RIP version 1,
71 network classes were originally used to determine the size of the netmask.
72 Class A networks use 8 bits of mask, Class B networks use 16 bits of masks,
73 while Class C networks use 24 bits of mask. Today, the most widely used method
74 of a network mask is assigned to the packet on the basis of the interface that
75 received the packet. Version 2 of RIP supports a variable length subnet mask
76 (VLSM). By extending the subnet mask, the mask can be divided and reused. Each
77 subnet can be used for different purposes such as large to middle size LANs and
78 WAN links. FRR *ripd* does not support the non-sequential netmasks that are
79 included in RIP Version 2.
80
81 In a case of similar information with the same prefix and metric, the old
82 information will be suppressed. Ripd does not currently support equal cost
83 multipath routing.
84
85 .. _rip-configuration:
86
87 RIP Configuration
88 =================
89
90 .. clicmd:: router rip
91
92 The `router rip` command is necessary to enable RIP. To disable RIP, use the
93 `no router rip` command. RIP must be enabled before carrying out any of the
94 RIP commands.
95
96
97 Disable RIP.
98
99 .. clicmd:: network NETWORK
100
101
102 Set the RIP enable interface by NETWORK. The interfaces which have addresses
103 matching with NETWORK are enabled.
104
105 This group of commands either enables or disables RIP interfaces between
106 certain numbers of a specified network address. For example, if the network
107 for 10.0.0.0/24 is RIP enabled, this would result in all the addresses from
108 10.0.0.0 to 10.0.0.255 being enabled for RIP. The `no network` command will
109 disable RIP for the specified network.
110
111 .. clicmd:: network IFNAME
112
113
114 Set a RIP enabled interface by IFNAME. Both the sending and
115 receiving of RIP packets will be enabled on the port specified in the
116 `network ifname` command. The `no network ifname` command will disable
117 RIP on the specified interface.
118
119 .. clicmd:: neighbor A.B.C.D
120
121
122 Specify a RIP neighbor to send updates to. This is required when a neighbor
123 is connected via a network that does not support multicast, or when it is
124 desired to statically define a neighbor. RIP updates will be sent via unicast
125 to each neighbour. Neighbour updates are in addition to any multicast updates
126 sent when an interface is not in passive mode (see the `passive-interface`
127 command). RIP will continue to process updates received from both the
128 neighbor and any received via multicast. The `no neighbor a.b.c.d` command
129 will disable the RIP neighbor.
130
131 Below is very simple RIP configuration. Interface `eth0` and interface which
132 address match to `10.0.0.0/8` are RIP enabled.
133
134 .. code-block:: frr
135
136 !
137 router rip
138 network 10.0.0.0/8
139 network eth0
140 !
141
142
143 .. clicmd:: passive-interface (IFNAME|default)
144
145
146 This command sets the specified interface to passive mode. On passive mode
147 interface, all receiving packets are processed as normal and ripd does not
148 send either multicast or unicast RIP packets except to RIP neighbors
149 specified with `neighbor` command. The interface may be specified as
150 `default` to make ripd default to passive on all interfaces.
151
152 The default is to be passive on all interfaces.
153
154 .. clicmd:: ip split-horizon
155
156
157 Control split-horizon on the interface. Default is `ip split-horizon`. If
158 you don't perform split-horizon on the interface, please specify `no ip
159 split-horizon`.
160
161 .. _rip-version-control:
162
163 RIP Version Control
164 ===================
165
166 RIP can be configured to send either Version 1 or Version 2 packets. The
167 default is to send RIPv2 while accepting both RIPv1 and RIPv2 (and replying
168 with packets of the appropriate version for REQUESTS / triggered updates). The
169 version to receive and send can be specified globally, and further overridden on
170 a per-interface basis if needs be for send and receive separately (see below).
171
172 It is important to note that RIPv1 cannot be authenticated. Further, if RIPv1
173 is enabled then RIP will reply to REQUEST packets, sending the state of its RIP
174 routing table to any remote routers that ask on demand. For a more detailed
175 discussion on the security implications of RIPv1 see :ref:`rip-authentication`.
176
177 .. clicmd:: version VERSION
178
179 Set RIP version to accept for reads and send. ``VERSION`` can be either 1 or
180 1.
181
182 Disabling RIPv1 by specifying version 2 is STRONGLY encouraged,
183 :ref:`rip-authentication`. This may become the default in a future release.
184
185 Default: Send Version 2, and accept either version.
186
187 .. clicmd:: ip rip send version VERSION
188
189 VERSION can be ``1``, ``2``, or ``1 2``.
190
191 This interface command overrides the global rip version setting, and selects
192 which version of RIP to send packets with, for this interface specifically.
193 Choice of RIP Version 1, RIP Version 2, or both versions. In the latter
194 case, where ``1 2`` is specified, packets will be both broadcast and
195 multicast.
196
197 Default: Send packets according to the global version (version 2)
198
199 .. clicmd:: ip rip receive version VERSION
200
201 VERSION can be ``1``, ``2``, or ``1 2``.
202
203 This interface command overrides the global rip version setting, and selects
204 which versions of RIP packets will be accepted on this interface. Choice of
205 RIP Version 1, RIP Version 2, or both.
206
207 Default: Accept packets according to the global setting (both 1 and 2).
208
209
210 .. _how-to-announce-rip-route:
211
212 How to Announce RIP route
213 =========================
214
215 .. clicmd:: redistribute <babel|bgp|connected|eigrp|isis|kernel|openfabric|ospf|sharp|static|table> [metric (0-16)] [route-map WORD]
216
217 Redistribute routes from other sources into RIP.
218
219 If you want to specify RIP only static routes:
220
221 .. clicmd:: default-information originate
222
223 .. clicmd:: route A.B.C.D/M
224
225
226 This command is specific to FRR. The `route` command makes a static route
227 only inside RIP. This command should be used only by advanced users who are
228 particularly knowledgeable about the RIP protocol. In most cases, we
229 recommend creating a static route in FRR and redistributing it in RIP using
230 `redistribute static`.
231
232 .. _filtering-rip-routes:
233
234 Filtering RIP Routes
235 ====================
236
237 RIP routes can be filtered by a distribute-list.
238
239 .. clicmd:: distribute-list [prefix] LIST <in|out> IFNAME
240
241 You can apply access lists to the interface with a `distribute-list` command.
242 If prefix is specified LIST is a prefix-list. If prefix is not specified
243 then LIST is the access list name. `in` specifies packets being received,
244 and `out` specifies outgoing packets. Finally if an interface is specified
245 it will be applied against a specific interface.
246
247 The `distribute-list` command can be used to filter the RIP path.
248 `distribute-list` can apply access-lists to a chosen interface. First, one
249 should specify the access-list. Next, the name of the access-list is used in
250 the distribute-list command. For example, in the following configuration
251 ``eth0`` will permit only the paths that match the route 10.0.0.0/8
252
253 .. code-block:: frr
254
255 !
256 router rip
257 distribute-list private in eth0
258 !
259 access-list private permit 10 10.0.0.0/8
260 access-list private deny any
261 !
262
263
264 `distribute-list` can be applied to both incoming and outgoing data.
265
266 .. _rip-metric-manipulation:
267
268 RIP Metric Manipulation
269 =======================
270
271 RIP metric is a value for distance for the network. Usually
272 *ripd* increment the metric when the network information is
273 received. Redistributed routes' metric is set to 1.
274
275 .. clicmd:: default-metric (1-16)
276
277
278 This command modifies the default metric value for redistributed routes.
279 The default value is 1. This command does not affect connected route even if
280 it is redistributed by *redistribute connected*. To modify connected route's
281 metric value, please use ``redistribute connected metric`` or *route-map*.
282 *offset-list* also affects connected routes.
283
284 .. clicmd:: offset-list ACCESS-LIST (in|out)
285
286 .. clicmd:: offset-list ACCESS-LIST (in|out) IFNAME
287
288
289 .. _rip-distance:
290
291 RIP distance
292 ============
293
294 Distance value is used in zebra daemon. Default RIP distance is 120.
295
296 .. clicmd:: distance (1-255)
297
298
299 Set default RIP distance to specified value.
300
301 .. clicmd:: distance (1-255) A.B.C.D/M
302
303
304 Set default RIP distance to specified value when the route's source IP
305 address matches the specified prefix.
306
307 .. clicmd:: distance (1-255) A.B.C.D/M ACCESS-LIST
308
309
310 Set default RIP distance to specified value when the route's source IP
311 address matches the specified prefix and the specified access-list.
312
313 .. _rip-route-map:
314
315 RIP route-map
316 =============
317
318 Usage of *ripd*'s route-map support.
319
320 Optional argument route-map MAP_NAME can be added to each `redistribute`
321 statement.
322
323 .. code-block:: frr
324
325 redistribute static [route-map MAP_NAME]
326 redistribute connected [route-map MAP_NAME]
327 .....
328
329
330 Cisco applies route-map _before_ routes will exported to rip route table. In
331 current FRR's test implementation, *ripd* applies route-map after routes are
332 listed in the route table and before routes will be announced to an interface
333 (something like output filter). I think it is not so clear, but it is draft and
334 it may be changed at future.
335
336 Route-map statement (:ref:`route-map`) is needed to use route-map
337 functionality.
338
339 .. clicmd:: match interface WORD
340
341 This command match to incoming interface. Notation of this match is
342 different from Cisco. Cisco uses a list of interfaces - NAME1 NAME2 ...
343 NAMEN. Ripd allows only one name (maybe will change in the future). Next -
344 Cisco means interface which includes next-hop of routes (it is somewhat
345 similar to "ip next-hop" statement). Ripd means interface where this route
346 will be sent. This difference is because "next-hop" of same routes which
347 sends to different interfaces must be different. Maybe it'd be better to
348 made new matches - say "match interface-out NAME" or something like that.
349
350 .. clicmd:: match ip address WORD
351
352 .. clicmd:: match ip address prefix-list WORD
353
354 Match if route destination is permitted by access-list.
355
356 .. clicmd:: match ip next-hop WORD
357
358 .. clicmd:: match ip next-hop prefix-list WORD
359
360 Match if route next-hop (meaning next-hop listed in the rip route-table as
361 displayed by "show ip rip") is permitted by access-list.
362
363 .. clicmd:: match metric (0-4294967295)
364
365 This command match to the metric value of RIP updates. For other protocol
366 compatibility metric range is shown as (0-4294967295). But for RIP protocol
367 only the value range (0-16) make sense.
368
369 .. clicmd:: set ip next-hop A.B.C.D
370
371 This command set next hop value in RIPv2 protocol. This command does not
372 affect RIPv1 because there is no next hop field in the packet.
373
374 .. clicmd:: set metric (0-4294967295)
375
376 Set a metric for matched route when sending announcement. The metric value
377 range is very large for compatibility with other protocols. For RIP, valid
378 metric values are from 1 to 16.
379
380 .. _rip-authentication:
381
382 RIP Authentication
383 ==================
384
385 RIPv2 allows packets to be authenticated via either an insecure plain
386 text password, included with the packet, or via a more secure MD5 based
387 :abbr:`HMAC (keyed-Hashing for Message AuthentiCation)`,
388 RIPv1 can not be authenticated at all, thus when authentication is
389 configured `ripd` will discard routing updates received via RIPv1
390 packets.
391
392 However, unless RIPv1 reception is disabled entirely,
393 :ref:`rip-version-control`, RIPv1 REQUEST packets which are received,
394 which query the router for routing information, will still be honoured
395 by `ripd`, and `ripd` WILL reply to such packets. This allows
396 `ripd` to honour such REQUESTs (which sometimes is used by old
397 equipment and very simple devices to bootstrap their default route),
398 while still providing security for route updates which are received.
399
400 In short: Enabling authentication prevents routes being updated by
401 unauthenticated remote routers, but still can allow routes (I.e. the
402 entire RIP routing table) to be queried remotely, potentially by anyone
403 on the internet, via RIPv1.
404
405 To prevent such unauthenticated querying of routes disable RIPv1,
406 :ref:`rip-version-control`.
407
408 .. clicmd:: ip rip authentication mode md5
409
410
411 Set the interface with RIPv2 MD5 authentication.
412
413 .. clicmd:: ip rip authentication mode text
414
415
416 Set the interface with RIPv2 simple password authentication.
417
418 .. clicmd:: ip rip authentication string STRING
419
420
421 RIP version 2 has simple text authentication. This command sets
422 authentication string. The string must be shorter than 16 characters.
423
424 .. clicmd:: ip rip authentication key-chain KEY-CHAIN
425
426
427 Specify Keyed MD5 chain.
428
429 .. code-block:: frr
430
431 !
432 key chain test
433 key 1
434 key-string test
435 !
436 interface eth1
437 ip rip authentication mode md5
438 ip rip authentication key-chain test
439 !
440
441
442 .. _rip-timers:
443
444 RIP Timers
445 ==========
446
447 .. clicmd:: timers basic UPDATE TIMEOUT GARBAGE
448
449
450 RIP protocol has several timers. User can configure those timers' values
451 by `timers basic` command.
452
453 The default settings for the timers are as follows:
454
455 - The update timer is 30 seconds. Every update timer seconds, the RIP
456 process is awakened to send an unsolicited Response message containing
457 the complete routing table to all neighboring RIP routers.
458 - The timeout timer is 180 seconds. Upon expiration of the timeout, the
459 route is no longer valid; however, it is retained in the routing table
460 for a short time so that neighbors can be notified that the route has
461 been dropped.
462 - The garbage collect timer is 120 seconds. Upon expiration of the
463 garbage-collection timer, the route is finally removed from the routing
464 table.
465
466 The ``timers basic`` command allows the the default values of the timers
467 listed above to be changed.
468
469
470 .. _show-rip-information:
471
472 Show RIP Information
473 ====================
474
475 To display RIP routes.
476
477 .. clicmd:: show ip rip
478
479 Show RIP routes.
480
481 The command displays all RIP routes. For routes that are received
482 through RIP, this command will display the time the packet was sent and
483 the tag information. This command will also display this information
484 for routes redistributed into RIP.
485
486 .. clicmd:: show ip rip status
487
488 The command displays current RIP status. It includes RIP timer,
489 filtering, version, RIP enabled interface and RIP peer information.
490
491 ::
492
493 ripd> **show ip rip status**
494 Routing Protocol is "rip"
495 Sending updates every 30 seconds with +/-50%, next due in 35 seconds
496 Timeout after 180 seconds, garbage collect after 120 seconds
497 Outgoing update filter list for all interface is not set
498 Incoming update filter list for all interface is not set
499 Default redistribution metric is 1
500 Redistributing: kernel connected
501 Default version control: send version 2, receive version 2
502 Interface Send Recv
503 Routing for Networks:
504 eth0
505 eth1
506 1.1.1.1
507 203.181.89.241
508 Routing Information Sources:
509 Gateway BadPackets BadRoutes Distance Last Update
510
511
512 RIP Debug Commands
513 ==================
514
515 Debug for RIP protocol.
516
517 .. clicmd:: debug rip events
518
519 Shows RIP events. Sending and receiving packets, timers, and changes in
520 interfaces are events shown with *ripd*.
521
522 .. clicmd:: debug rip packet
523
524 Shows display detailed information about the RIP packets. The origin and
525 port number of the packet as well as a packet dump is shown.
526
527 .. clicmd:: debug rip zebra
528
529 This command will show the communication between *ripd* and *zebra*. The
530 main information will include addition and deletion of paths to the kernel
531 and the sending and receiving of interface information.
532
533 .. clicmd:: show debugging rip
534
535 Shows all information currently set for ripd debug.
536
537
538 Sample configuration
539 ====================
540
541 .. code-block:: frr
542
543
544 debug rip events
545 debug rip packet
546
547 router rip
548 network 11.0.0.0/8
549 network eth0
550 route 10.0.0.0/8
551 distribute-list private-only in eth0
552
553 access-list private-only permit 10.0.0.0/8
554 access-list private-only deny any