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