blob: d598ca66bff8c167b3480dac54e803647a79da57 [file] [log] [blame]
paul718e3742002-12-13 20:15:29 +00001@c -*-texinfo-*-
2@c This is part of the GNU Zebra Manual.
3@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
44RIP uses UDP port 521 to send and receive RIP packets. So the user must have
45the 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
102LANs and WAN links. Zebra @command{ripd} does not support the non-sequential
103netmasks 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
120@deffn Command {no rouer rip} {}
121Disable 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
129the version of RIP being used.
130
131@deffn {RIP Command} {network @var{network}} {}
132@deffnx {RIP Command} {no network @var{network}} {}
133Set the RIP enable interface by @var{network}. The interfaces which
134have addresses matching with @var{network} are enabled.
135
136This group of commands either enables or disables RIP interfaces between
137certain numbers of a specified network address. For example, if the
138network for 10.0.0.0/24 is RIP enabled, this would result in all the
139addresses from 10.0.0.0 to 10.0.0.255 being enabled for RIP. The @code{no
140network} command will disable RIP for the specified network.
141@end deffn
142
143@deffn {RIP Command} {network @var{ifname}} {}
144@deffnx {RIP Command} {no network @var{ifname}} {}
145Set a RIP enabled interface by @var{ifname}. Both the sending and
146receiving of RIP packets will be enabled on the port specified in the
147@code{network ifname} command. The @code{no network ifname} command will disable
148RIP on the specified interface.
149@end deffn
150
151@deffn {RIP Command} {neighbor @var{a.b.c.d}} {}
152@deffnx {RIP Command} {no neighbor @var{a.b.c.d}} {}
153Specify RIP neighbor. When a neighbor doesn't understand multicast,
154this command is used to specify neighbors. In some cases, not all
155routers will be able to understand multicasting, where packets are sent
156to a network or a group of addresses. In a situation where a neighbor
157cannot process multicast packets, it is necessary to establish a direct
158link between routers. The neighbor command allows the network
159administrator to specify a router as a RIP neighbor. The @code{no
160neighbor a.b.c.d} command will disable the RIP neighbor.
161@end deffn
162
163Below is very simple RIP configuration. Interface @code{eth0} and
164interface which address match to @code{10.0.0.0/8} are RIP enabled.
165
166@example
167@group
168!
169router rip
170 network 10.0.0.0/8
171 network eth0
172!
173@end group
174@end example
175
176Passive interface
177
178@deffn {RIP command} {passive-interface @var{IFNAME}} {}
179@deffnx {RIP command} {no passive-interface @var{IFNAME}} {}
180This command sets the specified interface to passive mode. On passive mode
181interface, all receiving packets are processed as normal and ripd does
182not send either multicast or unicast RIP packets except to RIP neighbors
183specified with @code{neighbor} command.
184@end deffn
185
186RIP version handling
187
188@deffn {RIP Command} {version @var{version}} {}
189Set RIP process's version. @var{version} can be ``1'' or ``2''.
190@end deffn
191
192@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.
198@end deffn
199
200@deffn {Interface command} {ip rip receive version @var{version}} {}
201Version setting for incoming RIP packets. This command will enable the
202selected interface to receive packets in RIP Version 1, RIP Version 2,
203or both.
204@end deffn
205
206RIP split-horizon
207
208@deffn {Interface command} {ip split-horizon} {}
209@deffnx {Interface command} {no ip split-horizon} {}
210Control split-horizon on the interface. Default is @code{ip
211split-horizon}. If you don't perform split-horizon on the interface,
212please specify @code{no ip split-horizon}.
213@end deffn
214
215@node How to Announce RIP route, Filtering RIP Routes, RIP Configuration, RIP
216@comment node-name, next, previous, up
217@section How to Announce RIP route
218
219@deffn {RIP command} {redistribute kernel} {}
220@deffnx {RIP command} {redistribute kernel metric <0-16>} {}
221@deffnx {RIP command} {redistribute kernel route-map @var{route-map}} {}
222@deffnx {RIP command} {no redistribute kernel} {}
223@code{redistribute kernel} redistributes routing information from
224kernel route entries into the RIP tables. @code{no redistribute kernel}
225disables the routes.
226@end deffn
227
228@deffn {RIP command} {redistribute static} {}
229@deffnx {RIP command} {redistribute static metric <0-16>} {}
230@deffnx {RIP command} {redistribute static route-map @var{route-map}} {}
231@deffnx {RIP command} {no redistribute static} {}
232@code{redistribute static} redistributes routing information from
233static route entries into the RIP tables. @code{no redistribute static}
234disables the routes.
235@end deffn
236
237@deffn {RIP command} {redistribute connected} {}
238@deffnx {RIP command} {redistribute connected metric <0-16>} {}
239@deffnx {RIP command} {redistribute connected route-map @var{route-map}} {}
240@deffnx {RIP command} {no redistribute connected} {}
241Redistribute connected routes into the RIP tables. @code{no
242redistribute connected} disables the connected routes in the RIP tables.
243This command redistribute connected of the interface which RIP disabled.
244The connected route on RIP enabled interface is announced by default.
245@end deffn
246
247@deffn {RIP command} {redistribute ospf} {}
248@deffnx {RIP command} {redistribute ospf metric <0-16>} {}
249@deffnx {RIP command} {redistribute ospf route-map @var{route-map}} {}
250@deffnx {RIP command} {no redistribute ospf} {}
251@code{redistribute ospf} redistributes routing information from
252ospf route entries into the RIP tables. @code{no redistribute ospf}
253disables the routes.
254@end deffn
255
256@deffn {RIP command} {redistribute bgp} {}
257@deffnx {RIP command} {redistribute bgp metric <0-16>} {}
258@deffnx {RIP command} {redistribute bgp route-map @var{route-map}} {}
259@deffnx {RIP command} {no redistribute bgp} {}
260@code{redistribute bgp} redistributes routing information from
261bgp route entries into the RIP tables. @code{no redistribute bgp}
262disables the routes.
263@end deffn
264
265If you want to specify RIP only static routes:
266
267@deffn {RIP command} {default-information originate} {}
268@end deffn
269
270@deffn {RIP command} {route @var{a.b.c.d/m}} {}
271@deffnx {RIP command} {no route @var{a.b.c.d/m}} {}
272This command is specific to Zebra. The @code{route} command makes a static
273route only inside RIP. This command should be used only by advanced
274users who are particularly knowledgeable about the RIP protocol. In
275most cases, we recommend creating a static route in Zebra and
276redistributing it in RIP using @code{redistribute static}.
277@end deffn
278
279
280@node Filtering RIP Routes, RIP Metric Manipulation, How to Announce RIP route, RIP
281@comment node-name, next, previous, up
282@section Filtering RIP Routes
283
284RIP routes can be filtered by a distribute-list.
285
286@deffn Command {distribute-list @var{access_list} @var{direct} @var{ifname}} {}
287You can apply access lists to the interface with a @code{distribute-list}
288command. @var{access_list} is the access list name. @var{direct} is
289@samp{in} or @samp{out}. If @var{direct} is @samp{in} the access list
290is applied to input packets.
291
292The @code{distribute-list} command can be used to filter the RIP path.
293@code{distribute-list} can apply access-lists to a chosen interface.
294First, one should specify the access-list. Next, the name of the
295access-list is used in the distribute-list command. For example, in the
296following configuration @samp{eth0} will permit only the paths that
297match the route 10.0.0.0/8
298
299@example
300@group
301!
302router rip
303 distribute-list private in eth0
304!
305access-list private permit 10 10.0.0.0/8
306access-list private deny any
307!
308@end group
309@end example
310@end deffn
311
312@code{distribute-list} can be applied to both incoming and outgoing data.
313
314@deffn Command {distribute-list prefix @var{prefix_list} (in|out) @var{ifname}} {}
315You can apply prefix lists to the interface with a
316@code{distribute-list} command. @var{prefix_list} is the prefix list
317name. Next is the direction of @samp{in} or @samp{out}. If
318@var{direct} is @samp{in} the access list is applied to input packets.
319@end deffn
320
321@node RIP Metric Manipulation, RIP distance, Filtering RIP Routes, RIP
322@comment node-name, next, previous, up
323@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
343@node RIP distance, RIP route-map, RIP Metric Manipulation, RIP
344@comment node-name, next, previous, up
345@section RIP distance
346
347Distance value is used in zebra daemon. Default RIP distance is 120.
348
349@deffn {RIP command} {distance <1-255>} {}
350@deffnx {RIP command} {no distance <1-255>} {}
351Set default RIP distance to specified value.
352@end deffn
353
354@deffn {RIP command} {distance <1-255> @var{A.B.C.D/M}} {}
355@deffnx {RIP command} {no distance <1-255> @var{A.B.C.D/M}} {}
356Set default RIP distance to specified value when the route's source IP
357address matches the specified prefix.
358@end deffn
359
360@deffn {RIP command} {distance <1-255> @var{A.B.C.D/M} @var{access-list}} {}
361@deffnx {RIP command} {no distance <1-255> @var{A.B.C.D/M} @var{access-list}} {}
362Set default RIP distance to specified value when the route's source IP
363address matches the specified prefix and the specified access-list.
364@end deffn
365
366@node RIP route-map, RIP Authentication, RIP distance, RIP
367@comment node-name, next, previous, up
368@section RIP route-map
369
370Usage of @command{ripd}'s route-map support.
371
372Optional argument route-map MAP_NAME can be added to each @code{redistribute}
373statement.
374
375@example
376redistribute static [route-map MAP_NAME]
377redistribute connected [route-map MAP_NAME]
378.....
379@end example
380
381Cisco applies route-map _before_ routes will exported to rip route
382table. In current Zebra's test implementation, @command{ripd} applies route-map
383after routes are listed in the route table and before routes will be announced
384to an interface (something like output filter). I think it is not so clear,
385but it is draft and it may be changed at future.
386
387Route-map statement (@pxref{Route Map}) is needed to use route-map
388functionality.
389
390@deffn {Route Map} {match interface @var{word}} {}
391This command match to incoming interface. Notation of this match is
392different from Cisco. Cisco uses a list of interfaces - NAME1 NAME2
393... NAMEN. Ripd allows only one name (maybe will change in the
394future). Next - Cisco means interface which includes next-hop of
395routes (it is somewhat similar to "ip next-hop" statement). Ripd
396means interface where this route will be sent. This difference is
397because "next-hop" of same routes which sends to different interfaces
398must be different. Maybe it'd be better to made new matches - say
399"match interface-out NAME" or something like that.
400@end deffn
401
402@deffn {Route Map} {match ip address @var{word}} {}
403@deffnx {Route Map} {match ip address prefix-list @var{word}} {}
404Match if route destination is permitted by access-list.
405@end deffn
406
407@deffn {Route Map} {match ip next-hop A.B.C.D} {}
408Cisco uses here <access-list>, @command{ripd} IPv4 address. Match if
409route has this next-hop (meaning next-hop listed in the rip route
410table - "show ip rip")
411@end deffn
412
413@deffn {Route Map} {match metric <0-4294967295>} {}
414This command match to the metric value of RIP updates. For other
415protocol compatibility metric range is shown as <0-4294967295>. But
416for RIP protocol only the value range <0-16> make sense.
417@end deffn
418
419@deffn {Route Map} {set ip next-hop A.B.C.D} {}
420This command set next hop value in RIPv2 protocol. This command does
421not affect RIPv1 because there is no next hop field in the packet.
422@end deffn
423
424@deffn {Route Map} {set metric <0-4294967295>} {}
425Set a metric for matched route when sending announcement. The metric
426value range is very large for compatibility with other protocols. For
427RIP, valid metric values are from 1 to 16.
428@end deffn
429
430@node RIP Authentication, RIP Timers, RIP route-map, RIP
431@comment node-name, next, previous, up
432@section RIP Authentication
433
434@deffn {Interface command} {ip rip authentication mode md5} {}
435@deffnx {Interface command} {no ip rip authentication mode md5} {}
436Set the interface with RIPv2 MD5 authentication.
437@end deffn
438
439@deffn {Interface command} {ip rip authentication mode text} {}
440@deffnx {Interface command} {no ip rip authentication mode text} {}
441Set the interface with RIPv2 simple password authentication.
442@end deffn
443
444@deffn {Interface command} {ip rip authentication string @var{string}} {}
445@deffnx {Interface command} {no ip rip authentication string @var{string}} {}
446RIP version 2 has simple text authentication. This command sets
447authentication string. The string must be shorter than 16 characters.
448@end deffn
449
450@deffn {Interface command} {ip rip authentication key-chain @var{key-chain}} {}
451@deffnx {Interface command} {no ip rip authentication key-chain @var{key-chain}} {}
452Specifiy Keyed MD5 chain.
453@end deffn
454
455@example
456!
457key chain test
458 key 1
459 key-string test
460!
461interface eth1
462 ip rip authentication mode md5
463 ip rip authentication key-chain test
464!
465@end example
466
467@node RIP Timers, Show RIP Information, RIP Authentication, RIP
468@comment node-name, next, previous, up
469@section RIP Timers
470
471@deffn {RIP command} {timers basic @var{update} @var{timeout} @var{garbage}} {}
472
473RIP protocol has several timers. User can configure those timers' values
474by @code{timers basic} command.
475
476The default settings for the timers are as follows:
477
478@itemize @bullet
479@item
480The update timer is 30 seconds. Every update timer seconds, the RIP
481process is awakened to send an unsolicited Response message containing
482the complete routing table to all neighboring RIP routers.
483
484@item
485The timeout timer is 180 seconds. Upon expiration of the timeout, the
486route is no longer valid; however, it is retained in the routing table
487for a short time so that neighbors can be notified that the route has
488been dropped.
489
490@item
491The garbage collect timer is 120 seconds. Upon expiration of the
492garbage-collection timer, the route is finally removed from the routing
493table.
494
495@end itemize
496
497The @code{timers basic} command allows the the default values of the timers
498listed above to be changed.
499@end deffn
500
501@deffn {RIP command} {no timers basic} {}
502The @code{no timers basic} command will reset the timers to the default
503settings listed above.
504@end deffn
505
506@node Show RIP Information, RIP Debug Commands, RIP Timers, RIP
507@comment node-name, next, previous, up
508@section Show RIP Information
509
510To display RIP routes.
511
512@deffn Command {show ip rip} {}
513Show RIP routes.
514@end deffn
515
516The command displays all RIP routes. For routes that are received
517through RIP, this command will display the time the packet was sent and
518the tag information. This command will also display this information
519for routes redistributed into RIP.
520
521@c Exmaple here.
522
523@deffn Command {show ip protocols} {}
524The command displays current RIP status. It includes RIP timer,
525filtering, version, RIP enabled interface and RIP peer inforation.
526@end deffn
527
528@example
529@group
530ripd> @b{show ip protocols}
531Routing Protocol is "rip"
532 Sending updates every 30 seconds with +/-50%, next due in 35 seconds
533 Timeout after 180 seconds, garbage collect after 120 seconds
534 Outgoing update filter list for all interface is not set
535 Incoming update filter list for all interface is not set
536 Default redistribution metric is 1
537 Redistributing: kernel connected
538 Default version control: send version 2, receive version 2
539 Interface Send Recv
540 Routing for Networks:
541 eth0
542 eth1
543 1.1.1.1
544 203.181.89.241
545 Routing Information Sources:
546 Gateway BadPackets BadRoutes Distance Last Update
547@end group
548@end example
549
550@node RIP Debug Commands, , Show RIP Information, RIP
551@comment node-name, next, previous, up
552@section RIP Debug Commands
553
554Debug for RIP protocol.
555
556@deffn Command {debug rip events} {}
557Debug rip events.
558@end deffn
559
560@code{debug rip} will show RIP events. Sending and receiving
561packets, timers, and changes in interfaces are events shown with @command{ripd}.
562
563@deffn Command {debug rip packet} {}
564Debug rip packet.
565@end deffn
566
567@code{debug rip packet} will display detailed information about the RIP
568packets. The origin and port number of the packet as well as a packet
569dump is shown.
570
571@deffn Command {debug rip zebra} {}
572Debug rip between zebra communication.
573@end deffn
574
575This command will show the communication between @command{ripd} and @command{zebra}. The
576main information will include addition and deletion of paths to the
577kernel and the sending and receiving of interface information.
578
579@deffn Command {show debugging rip} {}
580Display @command{ripd}'s debugging option.
581@end deffn
582
583@code{show debugging rip} will show all information currently set for ripd
584debug.