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