1 .\" $OpenBSD: routed.8,v 1.8 1997/01/28 07:16:41 deraadt Exp $
3 .\" Copyright (c) 1983, 1991, 1993
4 .\" The Regents of the University of California. All rights reserved.
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
9 .\" 1. Redistributions of source code must retain the above copyright
10 .\" notice, this list of conditions and the following disclaimer.
11 .\" 2. Redistributions in binary form must reproduce the above copyright
12 .\" notice, this list of conditions and the following disclaimer in the
13 .\" documentation and/or other materials provided with the distribution.
14 .\" 3. All advertising materials mentioning features or use of this software
15 .\" must display the following acknowledgement:
16 .\" This product includes software developed by the University of
17 .\" California, Berkeley and its contributors.
18 .\" 4. Neither the name of the University nor the names of its contributors
19 .\" may be used to endorse or promote products derived from this software
20 .\" without specific prior written permission.
22 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
23 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
26 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
34 .\" @(#)routed.8 8.2 (Berkeley) 12/11/93
41 .Nd network RIP and router discovery routing daemon
48 .Ar net Ns Op /mask Ns Op ,metric
53 is a daemon invoked at boot time to manage the network
55 It uses Routing Information Protocol, RIPv1 (RFC\ 1058),
57 and Internet Router Discovery Protocol (RFC 1256)
58 to maintain the kernel routing table.
59 The RIPv1 protocol is based on the reference 4.3BSD daemon.
67 for Routing Information Protocol packets.
68 It also sends and receives multicast Router Discovery ICMP messages.
69 If the host is a router,
71 periodically supplies copies
72 of its routing tables to any directly connected hosts and networks.
73 It also advertise or solicits default routes using Router Discovery
76 When started (or when a network interface is later turned on),
78 uses an AF_ROUTE address family facility to find those
79 directly connected interfaces configured into the
80 system and marked "up".
81 It adds necessary routes for the interfaces
82 to the kernel routing table.
83 Soon after being first started, and provided there is at least one
84 interface on which RIP has not been disabled,
86 deletes all pre-existing
87 non-static routes in kernel table.
88 Static routes in the kernel table are preserved and
89 included in RIP responses if they have a valid RIP metric
93 If more than one interface is present (not counting the loopback interface),
94 it is assumed that the host should forward packets among the
96 After transmitting a RIP
99 Router Discovery Advertisements or Solicitations on a new interface,
100 the daemon enters a loop, listening for
101 RIP request and response and Router Discover packets from other hosts.
107 formulates a reply based on the information maintained in its
111 packet generated contains a list of known routes, each marked
112 with a "hop count" metric (a count of 16 or greater is
113 considered "infinite").
114 Advertised metrics reflect the metric associated with interface
117 so setting the metric on an interface
118 is an effective way to steer traffic.
120 Responses do not contain routes with a first hop on the requesting
121 network to implement in part
124 The routing table maintained by the daemon
125 includes space for several gateways for each destination
126 to speed recovery from a failing router.
129 packets received are used to update the routing tables provided they are
130 from one of the several currently recognized gateways or
131 advertise a better metric than at least one of the existing
134 When an update is applied,
136 records the change in its own tables and updates the kernel routing table
137 if the best route to the destination changes.
138 The change in the kernel routing table is reflected in the next batch of
141 If the next response is not scheduled for a while, a
143 response containing only recently changed routes is sent.
145 In addition to processing incoming packets,
147 also periodically checks the routing table entries.
148 If an entry has not been updated for 3 minutes, the entry's metric
149 is set to infinity and marked for deletion.
150 Deletions are delayed until the route has been advertised with
151 an infinite metric to insure the invalidation
152 is propagated throughout the local internet.
156 Routes in the kernel table that are added or changed as a result
157 of ICMP Redirect messages are deleted after a while to minimize
159 When a TCP connection suffers a timeout,
162 which deletes all redirected routes
163 through the gateway involved, advances the age of all RIP routes through
164 the gateway to allow an alternate to be chosen, and advances of the
165 age of any relevant Router Discovery Protocol default routes.
167 Hosts acting as internetwork routers gratuitously supply their
168 routing tables every 30 seconds to all directly connected hosts
170 These RIP responses are sent to the broadcast address on nets that support
172 to the destination address on point-to-point links, and to the router's
173 own address on other networks.
174 If RIPv2 is enabled, multicast packets are sent on interfaces that
175 support multicasting.
177 If no response is received on a remote interface, if there are errors
178 while sending responses,
179 or if there are more errors than input or output (see
181 then the cable or some other part of the interface is assumed to be
182 disconnected or broken, and routes are adjusted appropriately.
185 .Em Internet Router Discovery Protocol
186 is handled similarly.
187 When the daemon is supplying RIP routes, it also listens for
188 Router Discovery Solicitations and sends Advertisements.
189 When it is quiet and only listening to other RIP routers, it
190 sends Solicitations and listens for Advertisements.
192 a good Advertisement, it stops listening for broadcast or multicast
194 It tracks several advertising routers to speed recovery when the
195 currently chosen router dies.
196 If all discovered routers disappear,
197 the daemon resumes listening to RIP responses.
199 While using Router Discovery (which happens by default when
200 the system has a single network interface and a Router Discover Advertisement
201 is received), there is a single default route and a variable number of
202 redirected host routes in the kernel table.
204 The Router Discover standard requires that advertisements
205 have a default "lifetime" of 30 minutes. That means should
206 something happen, a client can be without a good route for
207 30 minutes. It is a good idea to reduce the default to 45
209 .Fl P Cm rdisc_interval=45
210 on the command line or
211 .Cm rdisc_interval=45
218 facility described below to support "legacy" systems
219 that can handle neither RIPv2 nor Router Discovery.
221 By default, neither Router Discovery advertisements nor solicitations
222 are sent over point to point links (e.g. PPP).
230 to supply routing information.
231 This is the default if multiple network interfaces are present on which
232 RIP or Router Discovery have not been disabled, and if the kernel switch
235 is the opposite of the
239 Do not run in the background.
240 This option is meant for interactive use.
242 This flag is used on internetwork routers to offer a route
243 to the "default" destination.
247 and is present mostly for historical reasons.
250 on the command line or
254 since a larger metric
255 will be used, reducing the spread of the potentially dangerous
257 This is typically used on a gateway to the Internet,
258 or on a gateway that uses another routing protocol whose routes
259 are not reported to other local routers.
260 Notice that because a metric of 1 is used, this feature is
261 dangerous. It is more commonly accidently used to create chaos with routing
262 loop than to solve problems.
264 This causes host or point-to-point routes to not be advertised,
265 provided there is a network route going the same direction.
266 That is a limited kind of aggregation.
267 This option is useful on gateways to ethernets that have other gateway
268 machines connected with point-to-point links such as SLIP.
270 This causes the machine to advertise a host or point-to-point route to
271 its primary interface.
272 It is useful on multi-homed machines such as NFS servers.
273 This option should not be used except when the cost of
274 the host routes it generates is justified by the popularity of
276 It is effective only when the machine is supplying
277 routing information, because there is more than one interface.
282 option to the limited extent of advertising the host route.
284 do not ignore RIPv2 authentication if we do not care about RIPv2
286 This option is required for conformance with RFC 1723.
287 However, it makes no sense and breaks using RIP as a discovery protocol
288 to ignore all RIPv2 packets that carry authentication when this machine
289 does not care about authentication.
290 .It Fl T Ar tracefile
291 increases the debugging level to at least 1 and
292 causes debugging information to be appended to the trace file.
293 Note that because of security concerns, it is wisest to not run
295 routinely with tracing directed to a file.
297 increases the debugging level, which causes more information to be logged
298 on the tracefile specified with
301 The debugging level can be increased or decreased
307 .It Fl F Ar net[/mask][,metric]
308 minimize routes in transmissions via interfaces with addresses that match
310 and synthesizes a default route to this machine with the
312 The intent is to reduce RIP traffic on slow, point-to-point links
313 such as PPP links by replacing many large UDP packets of RIP information
314 with a single, small packet containing a "fake" default route.
317 is absent, a value of 14 is assumed to limit
318 the spread of the "fake" default route.
319 This is a dangerous feature that when used carelessly can cause routing
321 Notice also that more than one interface can match the specified network
326 is equivalent to adding the parameter
334 Any other argument supplied is interpreted as the name
335 of a file in which the actions of
341 appending the name of the trace file to the command.
344 also supports the notion of
352 is started, it reads the file
354 to find such distant gateways which may not be located using
355 only information from a routing socket, to discover if some
356 of the local gateways are
358 and to obtain other parameters.
359 Gateways specified in this manner should be marked passive
360 if they are not expected to exchange routing information,
361 while gateways marked active
362 should be willing to exchange RIP packets.
365 gateways are installed in the
366 kernel's routing tables once upon startup and are not included in
367 transmitted RIP responses.
369 Distant active gateways are treated like network interfaces.
370 RIP responses are sent
374 If no responses are received, the associated route is deleted from
375 the kernel table and RIP responses advertised via other interfaces.
376 If the distant gateway resumes sending RIP responses, the associated
379 Such gateways can be useful on media that do not support broadcasts
380 or multicasts but otherwise act like classic shared media like
381 Ethernets such as some ATM networks.
382 One can list all RIP routers reachable on the ATM network in
389 are also passive, but are not placed in the kernel
390 routing table nor are they included in routing updates.
391 The function of external entries is to indicate
392 that another routing process
393 will install such a route if necessary,
394 and that alternate routes to that destination should not be installed
397 Such entries are only required when both routers may learn of routes
398 to the same destination.
402 file is comprised of a series of lines, each in
403 one of the following formats or consist of parameters described below:
412 .Pf < Cm passive No \&|
423 .Pf < Cm passive No \&|
431 is the name of the destination network or host.
432 It may be a symbolic network name or an Internet address
433 specified in "dot" notation (see
435 (If it is a name, then it must either be defined in
441 must have been started before
445 is an optional number between 1 and 32 indicating the netmask associated
450 is the name or address of the gateway to which RIP responses should
454 is the hop count to the destination host or network.
457 .Ar " net nname/32 ".
464 must be present to indicate whether the gateway should be treated as
468 (as described above),
469 or whether the gateway is
471 to the scope of the RIP protocol.
473 Lines that start with neither "net" nor "host" must consist of one
474 or more of the following parameter settings, separated by commas or
477 .It Cm if Ns \&= Ns Ar ifname
478 indicates that the other parameters on the line apply to the interface
481 .It Cm subnet Ns \&= Ns Ar nname[/mask][,metric]
482 advertises a route to network
486 and the supplied metric (default 1).
487 This is useful for filling "holes" in CIDR allocations.
488 This parameter must appear by itself on a line.
490 Do not use this feature unless necessary. It is dangerous.
491 .It Cm passwd Ns \&= Ns Ar XXX
492 specifies a RIPv2 password that will be included on all RIPv2
493 responses sent and checked on all RIPv2 responses received.
494 The password must not contain any blanks, tab characters, commas
497 turns off aggregation of subnets in RIPv1 and RIPv2 responses.
499 turns off aggregation of networks into supernets in RIPv2 responses.
502 .Cm no_rip Cm no_rdisc .
504 disables all RIP processing on the specified interface.
505 If no interfaces are allowed to process RIP packets,
507 acts purely as a router discovery daemon.
510 .Cm no_ripv1_in no_ripv2_in no_ripv1_out no_ripv2_out .
512 Note that turning off RIP without explicitly turning on router
513 discovery advertisements with
519 to act as a client router discovery daemon, not advertising.
521 causes RIPv1 received responses to be ignored.
523 causes RIPv2 received responses to be ignored.
525 turns off RIPv1 output and causes RIPv2 advertisements to be
526 multicast when possible.
528 disables the Internet Router Discovery Protocol.
530 disables the transmission of Router Discovery Solicitations.
532 specifies that Router Discovery solicitations should be sent,
533 even on point-to-point links,
534 which by default only listen to Router Discovery messages.
536 disables the transmission of Router Discovery Advertisements
538 specifies that Router Discovery advertisements should be sent,
539 even on point-to-point links,
540 which by default only listen to Router Discovery messages
542 specifies that Router Discovery packets should be broadcast instead of
544 .It Cm rdisc_pref Ns \&= Ns Ar N
545 sets the preference in Router Discovery Advertisements to the integer
547 .It Cm rdisc_interval Ns \&= Ns Ar N
548 sets the nominal interval with which Router Discovery Advertisements
549 are transmitted to N seconds and their lifetime to 3*N.
550 .It Cm fake_default Ns \&= Ns Ar metric
551 has an identical effect to
552 .Fl F Ar net[/mask][,metric]
553 with the network and mask coming from the specified interface.
557 When RIPv2 routes are multicast, so that RIPv1 listeners cannot
558 receive them, this feature causes a RIPv1 default route to be
559 broadcast to RIPv1 listeners.
562 the default route is broadcast with a metric of 14.
563 That serves as a "poor man's router discovery" protocol.
566 Note that the netmask associated with point-to-point links (such as SLIP
567 or PPP, with the IFF_POINTOPOINT flag) is used by
569 to infer the netmask used by the remote system when RIPv1 is used.
572 .Bl -tag -width /etc/gateways -compact
580 .%T Internet Transport Protocols
582 .%Q Xerox System Integration Standard
585 It does not always detect unidirectional failures in network interfaces
586 (e.g., when the output side fails).