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