blob: c1ddfd1bd78077d20c6f20f3b646b01b8b5e3654 [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.
paul76b89b42004-11-06 17:13:09 +00003@c @value{COPYRIGHT_STR}
4@c See file quagga.texi for copying conditions.
paul718e3742002-12-13 20:15:29 +00005@node RIP
paul718e3742002-12-13 20:15:29 +00006@chapter RIP
7
8RIP -- Routing Information Protocol is widely deployed interior gateway
9protocol. RIP was developed in the 1970s at Xerox Labs as part of the
10XNS routing protocol. RIP is a @dfn{distance-vector} protocol and is
11based on the @dfn{Bellman-Ford} algorithms. As a distance-vector
12protocol, RIP router send updates to its neighbors periodically, thus
13allowing the convergence to a known topology. In each update, the
14distance to any given network will be broadcasted to its neighboring
15router.
16
17@command{ripd} supports RIP version 2 as described in RFC2453 and RIP
18version 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
paul76b89b42004-11-06 17:13:09 +000034@node Starting and Stopping ripd
paul718e3742002-12-13 20:15:29 +000035@section Starting and Stopping ripd
36
37The 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
40search current directory.
41
paul152f4a82004-05-26 23:31:11 +000042RIP uses UDP port 520 to send and receive RIP packets. So the user must have
paul718e3742002-12-13 20:15:29 +000043the capability to bind the port, generally this means that the user must
44have superuser privileges. RIP protocol requires interface information
45maintained by @command{zebra} daemon. So running @command{zebra}
46is mandatory to run @command{ripd}. Thus minimum sequence for running
47RIP is like below:
48
49@example
50@group
51# zebra -d
52# ripd -d
53@end group
54@end example
55
56Please note that @command{zebra} must be invoked before @command{ripd}.
57
58To 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
63Reload configuration file @file{ripd.conf}. All configurations are
64reseted. All routes learned so far are cleared and removed from routing
65table.
66@item SIGUSR1
67Rotate @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
79When the program terminates, retain routes added by @command{ripd}.
80@end table
81
82@menu
83* RIP netmask::
84@end menu
85
paul76b89b42004-11-06 17:13:09 +000086@node RIP netmask
paul718e3742002-12-13 20:15:29 +000087@subsection RIP netmask
88
89The netmask features of @command{ripd} support both version 1 and version 2 of
90RIP. Version 1 of RIP originally contained no netmask information. In
91RIP version 1, network classes were originally used to determine the
92size of the netmask. Class A networks use 8 bits of mask, Class B
93networks use 16 bits of masks, while Class C networks use 24 bits of
94mask. Today, the most widely used method of a network mask is assigned
95to the packet on the basis of the interface that received the packet.
96Version 2 of RIP supports a variable length subnet mask (VLSM). By
97extending the subnet mask, the mask can be divided and reused. Each
98subnet can be used for different purposes such as large to middle size
paul7190f4e2003-08-12 12:40:20 +000099LANs and WAN links. Quagga @command{ripd} does not support the non-sequential
paul718e3742002-12-13 20:15:29 +0000100netmasks that are included in RIP Version 2.
101
102In a case of similar information with the same prefix and metric, the
103old information will be suppressed. Ripd does not currently support
104equal cost multipath routing.
105
106
paul76b89b42004-11-06 17:13:09 +0000107@node RIP Configuration
paul718e3742002-12-13 20:15:29 +0000108@section RIP Configuration
109
110@deffn Command {router rip} {}
111The @code{router rip} command is necessary to enable RIP. To disable
112RIP, use the @code{no router rip} command. RIP must be enabled before
113carrying out any of the RIP commands.
114@end deffn
115
paul971a4492003-06-20 01:18:07 +0000116@deffn Command {no router rip} {}
paul718e3742002-12-13 20:15:29 +0000117Disable RIP.
118@end deffn
119
120RIP can be configured to process either Version 1 or Version 2 packets,
121the default mode is Version 2. If no version is specified, then the RIP
122daemon will default to Version 2. If RIP is set to Version
1231, the setting "Version 1" will be displayed, but the setting "Version
1242" will not be displayed whether or not Version 2 is set explicitly as
paul971a4492003-06-20 01:18:07 +0000125the version of RIP being used. The version can be specified globally, and
126also on a per-interface basis (see below).
127
128@deffn {RIP Command} {version @var{version}} {}
129Set RIP process's version. @var{version} can be `1'' or `2''.
130@end deffn
paul718e3742002-12-13 20:15:29 +0000131
132@deffn {RIP Command} {network @var{network}} {}
133@deffnx {RIP Command} {no network @var{network}} {}
134Set the RIP enable interface by @var{network}. The interfaces which
135have addresses matching with @var{network} are enabled.
136
137This group of commands either enables or disables RIP interfaces between
138certain numbers of a specified network address. For example, if the
139network for 10.0.0.0/24 is RIP enabled, this would result in all the
140addresses from 10.0.0.0 to 10.0.0.255 being enabled for RIP. The @code{no
141network} 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}} {}
146Set a RIP enabled interface by @var{ifname}. Both the sending and
147receiving 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
149RIP 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}} {}
154Specify RIP neighbor. When a neighbor doesn't understand multicast,
155this command is used to specify neighbors. In some cases, not all
156routers will be able to understand multicasting, where packets are sent
157to a network or a group of addresses. In a situation where a neighbor
158cannot process multicast packets, it is necessary to establish a direct
159link between routers. The neighbor command allows the network
160administrator to specify a router as a RIP neighbor. The @code{no
161neighbor a.b.c.d} command will disable the RIP neighbor.
162@end deffn
163
164Below is very simple RIP configuration. Interface @code{eth0} and
165interface which address match to @code{10.0.0.0/8} are RIP enabled.
166
167@example
168@group
169!
170router rip
171 network 10.0.0.0/8
172 network eth0
173!
174@end group
175@end example
176
177Passive interface
178
paul971a4492003-06-20 01:18:07 +0000179@deffn {RIP command} {passive-interface (@var{IFNAME}|default)} {}
paul718e3742002-12-13 20:15:29 +0000180@deffnx {RIP command} {no passive-interface @var{IFNAME}} {}
181This command sets the specified interface to passive mode. On passive mode
182interface, all receiving packets are processed as normal and ripd does
183not send either multicast or unicast RIP packets except to RIP neighbors
paul971a4492003-06-20 01:18:07 +0000184specified with @code{neighbor} command. The interface may be specified
185as @var{default} to make ripd default to passive on all interfaces.
186
187The default is to be passive on all interfaces.
paul718e3742002-12-13 20:15:29 +0000188@end deffn
189
190RIP version handling
191
paul718e3742002-12-13 20:15:29 +0000192@deffn {Interface command} {ip rip send version @var{version}} {}
193@var{version} can be `1', `2', `1 2'. This configuration command
194overrides the router's rip version setting. The command will enable the
195selected interface to send packets with RIP Version 1, RIP Version 2, or
196both. In the case of '1 2', packets will be both broadcast and
197multicast.
paul971a4492003-06-20 01:18:07 +0000198
199The default is to send only version 2.
paul718e3742002-12-13 20:15:29 +0000200@end deffn
201
202@deffn {Interface command} {ip rip receive version @var{version}} {}
203Version setting for incoming RIP packets. This command will enable the
204selected interface to receive packets in RIP Version 1, RIP Version 2,
205or both.
paul971a4492003-06-20 01:18:07 +0000206
207The default is to receive both versions.
paul718e3742002-12-13 20:15:29 +0000208@end deffn
209
210RIP split-horizon
211
212@deffn {Interface command} {ip split-horizon} {}
213@deffnx {Interface command} {no ip split-horizon} {}
214Control split-horizon on the interface. Default is @code{ip
215split-horizon}. If you don't perform split-horizon on the interface,
216please specify @code{no ip split-horizon}.
217@end deffn
218
paul76b89b42004-11-06 17:13:09 +0000219@node How to Announce RIP route
paul718e3742002-12-13 20:15:29 +0000220@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
227kernel route entries into the RIP tables. @code{no redistribute kernel}
228disables 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
236static route entries into the RIP tables. @code{no redistribute static}
237disables 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} {}
244Redistribute connected routes into the RIP tables. @code{no
245redistribute connected} disables the connected routes in the RIP tables.
246This command redistribute connected of the interface which RIP disabled.
247The 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
255ospf route entries into the RIP tables. @code{no redistribute ospf}
256disables 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
264bgp route entries into the RIP tables. @code{no redistribute bgp}
265disables the routes.
266@end deffn
267
268If 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}} {}
paul7190f4e2003-08-12 12:40:20 +0000275This command is specific to Quagga. The @code{route} command makes a static
paul718e3742002-12-13 20:15:29 +0000276route only inside RIP. This command should be used only by advanced
277users who are particularly knowledgeable about the RIP protocol. In
paul7190f4e2003-08-12 12:40:20 +0000278most cases, we recommend creating a static route in Quagga and
paul718e3742002-12-13 20:15:29 +0000279redistributing it in RIP using @code{redistribute static}.
280@end deffn
281
paul76b89b42004-11-06 17:13:09 +0000282@node Filtering RIP Routes
paul718e3742002-12-13 20:15:29 +0000283@section Filtering RIP Routes
284
285RIP routes can be filtered by a distribute-list.
286
287@deffn Command {distribute-list @var{access_list} @var{direct} @var{ifname}} {}
288You can apply access lists to the interface with a @code{distribute-list}
289command. @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
291is applied to input packets.
292
293The @code{distribute-list} command can be used to filter the RIP path.
294@code{distribute-list} can apply access-lists to a chosen interface.
295First, one should specify the access-list. Next, the name of the
296access-list is used in the distribute-list command. For example, in the
297following configuration @samp{eth0} will permit only the paths that
298match the route 10.0.0.0/8
299
300@example
301@group
302!
303router rip
304 distribute-list private in eth0
305!
306access-list private permit 10 10.0.0.0/8
307access-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}} {}
316You can apply prefix lists to the interface with a
317@code{distribute-list} command. @var{prefix_list} is the prefix list
318name. 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
paul76b89b42004-11-06 17:13:09 +0000322@node RIP Metric Manipulation
paul718e3742002-12-13 20:15:29 +0000323@section RIP Metric Manipulation
324
325RIP metric is a value for distance for the network. Usually
326@command{ripd} increment the metric when the network information is
327received. 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>} {}
331This command modifies the default metric value for redistributed routes. The
332default value is 1. This command does not affect connected route
333even if it is redistributed by @command{redistribute connected}. To modify
334connected route's metric value, please use @command{redistribute
335connected metric} or @command{route-map}. @command{offset-list} also
336affects 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
paul76b89b42004-11-06 17:13:09 +0000343@node RIP distance
paul718e3742002-12-13 20:15:29 +0000344@section RIP distance
345
346Distance 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>} {}
350Set 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}} {}
355Set default RIP distance to specified value when the route's source IP
356address 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}} {}
361Set default RIP distance to specified value when the route's source IP
362address matches the specified prefix and the specified access-list.
363@end deffn
364
paul76b89b42004-11-06 17:13:09 +0000365@node RIP route-map
paul718e3742002-12-13 20:15:29 +0000366@section RIP route-map
367
368Usage of @command{ripd}'s route-map support.
369
370Optional argument route-map MAP_NAME can be added to each @code{redistribute}
371statement.
372
373@example
374redistribute static [route-map MAP_NAME]
375redistribute connected [route-map MAP_NAME]
376.....
377@end example
378
paul7190f4e2003-08-12 12:40:20 +0000379Cisco applies route-map _before_ routes will exported to rip route table.
380In current Quagga's test implementation, @command{ripd} applies route-map
381after routes are listed in the route table and before routes will be
382announced to an interface (something like output filter). I think it is not
383so clear, but it is draft and it may be changed at future.
paul718e3742002-12-13 20:15:29 +0000384
385Route-map statement (@pxref{Route Map}) is needed to use route-map
386functionality.
387
388@deffn {Route Map} {match interface @var{word}} {}
389This command match to incoming interface. Notation of this match is
390different from Cisco. Cisco uses a list of interfaces - NAME1 NAME2
391... NAMEN. Ripd allows only one name (maybe will change in the
392future). Next - Cisco means interface which includes next-hop of
393routes (it is somewhat similar to "ip next-hop" statement). Ripd
394means interface where this route will be sent. This difference is
395because "next-hop" of same routes which sends to different interfaces
396must 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}} {}
402Match if route destination is permitted by access-list.
403@end deffn
404
405@deffn {Route Map} {match ip next-hop A.B.C.D} {}
406Cisco uses here <access-list>, @command{ripd} IPv4 address. Match if
407route has this next-hop (meaning next-hop listed in the rip route
408table - "show ip rip")
409@end deffn
410
411@deffn {Route Map} {match metric <0-4294967295>} {}
412This command match to the metric value of RIP updates. For other
413protocol compatibility metric range is shown as <0-4294967295>. But
414for 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} {}
418This command set next hop value in RIPv2 protocol. This command does
419not affect RIPv1 because there is no next hop field in the packet.
420@end deffn
421
422@deffn {Route Map} {set metric <0-4294967295>} {}
423Set a metric for matched route when sending announcement. The metric
424value range is very large for compatibility with other protocols. For
425RIP, valid metric values are from 1 to 16.
426@end deffn
427
paul76b89b42004-11-06 17:13:09 +0000428@node RIP Authentication
paul718e3742002-12-13 20:15:29 +0000429@section RIP Authentication
430
431@deffn {Interface command} {ip rip authentication mode md5} {}
432@deffnx {Interface command} {no ip rip authentication mode md5} {}
433Set 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} {}
438Set 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}} {}
443RIP version 2 has simple text authentication. This command sets
444authentication 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}} {}
449Specifiy Keyed MD5 chain.
450@end deffn
451
452@example
453!
454key chain test
455 key 1
456 key-string test
457!
458interface eth1
459 ip rip authentication mode md5
460 ip rip authentication key-chain test
461!
462@end example
463
paul76b89b42004-11-06 17:13:09 +0000464@node RIP Timers
paul718e3742002-12-13 20:15:29 +0000465@section RIP Timers
466
467@deffn {RIP command} {timers basic @var{update} @var{timeout} @var{garbage}} {}
468
469RIP protocol has several timers. User can configure those timers' values
470by @code{timers basic} command.
471
472The default settings for the timers are as follows:
473
474@itemize @bullet
475@item
476The update timer is 30 seconds. Every update timer seconds, the RIP
477process is awakened to send an unsolicited Response message containing
478the complete routing table to all neighboring RIP routers.
479
480@item
481The timeout timer is 180 seconds. Upon expiration of the timeout, the
482route is no longer valid; however, it is retained in the routing table
483for a short time so that neighbors can be notified that the route has
484been dropped.
485
486@item
487The garbage collect timer is 120 seconds. Upon expiration of the
488garbage-collection timer, the route is finally removed from the routing
489table.
490
491@end itemize
492
493The @code{timers basic} command allows the the default values of the timers
494listed above to be changed.
495@end deffn
496
497@deffn {RIP command} {no timers basic} {}
498The @code{no timers basic} command will reset the timers to the default
499settings listed above.
500@end deffn
501
paul76b89b42004-11-06 17:13:09 +0000502@node Show RIP Information
paul718e3742002-12-13 20:15:29 +0000503@section Show RIP Information
504
505To display RIP routes.
506
507@deffn Command {show ip rip} {}
508Show RIP routes.
509@end deffn
510
511The command displays all RIP routes. For routes that are received
512through RIP, this command will display the time the packet was sent and
513the tag information. This command will also display this information
514for routes redistributed into RIP.
515
516@c Exmaple here.
517
518@deffn Command {show ip protocols} {}
519The command displays current RIP status. It includes RIP timer,
520filtering, version, RIP enabled interface and RIP peer inforation.
521@end deffn
522
523@example
524@group
525ripd> @b{show ip protocols}
526Routing 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
paul76b89b42004-11-06 17:13:09 +0000545@node RIP Debug Commands
paul718e3742002-12-13 20:15:29 +0000546@section RIP Debug Commands
547
548Debug for RIP protocol.
549
550@deffn Command {debug rip events} {}
551Debug rip events.
552@end deffn
553
554@code{debug rip} will show RIP events. Sending and receiving
555packets, timers, and changes in interfaces are events shown with @command{ripd}.
556
557@deffn Command {debug rip packet} {}
558Debug rip packet.
559@end deffn
560
561@code{debug rip packet} will display detailed information about the RIP
562packets. The origin and port number of the packet as well as a packet
563dump is shown.
564
565@deffn Command {debug rip zebra} {}
566Debug rip between zebra communication.
567@end deffn
568
paul6a22b1f2004-11-07 19:39:13 +0000569This command will show the communication between @command{ripd} and
570@command{zebra}. The main information will include addition and deletion of
571paths to the kernel and the sending and receiving of interface information.
paul718e3742002-12-13 20:15:29 +0000572
573@deffn Command {show debugging rip} {}
574Display @command{ripd}'s debugging option.
575@end deffn
576
577@code{show debugging rip} will show all information currently set for ripd
578debug.