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