1 .\" $FreeBSD: src/sbin/routed/routed.8,v 1.15.2.9 2002/02/17 08:37:54 schweikh Exp $
2 .\" $DragonFly: src/sbin/routed/routed.8,v 1.6 2008/05/09 20:31:04 swildner Exp $
4 .\" Copyright (c) 1983, 1991, 1993
5 .\" The Regents of the University of California. All rights reserved.
7 .\" Redistribution and use in source and binary forms, with or without
8 .\" modification, are permitted provided that the following conditions
10 .\" 1. Redistributions of source code must retain the above copyright
11 .\" notice, this list of conditions and the following disclaimer.
12 .\" 2. Redistributions in binary form must reproduce the above copyright
13 .\" notice, this list of conditions and the following disclaimer in the
14 .\" documentation and/or other materials provided with the distribution.
15 .\" 3. All advertising materials mentioning features or use of this software
16 .\" must display the following acknowledgement:
17 .\" This product includes software developed by the University of
18 .\" California, Berkeley and its contributors.
19 .\" 4. Neither the name of the University nor the names of its contributors
20 .\" may be used to endorse or promote products derived from this software
21 .\" without specific prior written permission.
23 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
24 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
25 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
26 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
27 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
28 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
29 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
30 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
31 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
32 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
35 .\" @(#)routed.8 8.2 (Berkeley) 12/11/93
37 .\" $FreeBSD: src/sbin/routed/routed.8,v 1.15.2.9 2002/02/17 08:37:54 schweikh Exp $
45 .Nd network RIP and router discovery routing daemon
52 .Ar net Ns Op /mask Ns Op ,metric
57 is a daemon invoked at boot time to manage the network
59 It uses Routing Information Protocol, RIPv1 (RFC 1058),
61 and Internet Router Discovery Protocol (RFC 1256)
62 to maintain the kernel routing table.
63 The RIPv1 protocol is based on the reference
73 for Routing Information Protocol packets.
74 It also sends and receives multicast Router Discovery ICMP messages.
75 If the host is a router,
77 periodically supplies copies
78 of its routing tables to any directly connected hosts and networks.
79 It also advertises or solicits default routes using Router Discovery
82 When started (or when a network interface is later turned on),
84 uses an AF_ROUTE address family facility to find those
85 directly connected interfaces configured into the
86 system and marked "up".
87 It adds necessary routes for the interfaces
88 to the kernel routing table.
89 Soon after being first started, and provided there is at least one
90 interface on which RIP has not been disabled,
92 deletes all pre-existing
93 non-static routes in kernel table.
94 Static routes in the kernel table are preserved and
95 included in RIP responses if they have a valid RIP metric
99 If more than one interface is present (not counting the loopback interface),
100 it is assumed that the host should forward packets among the
102 After transmitting a RIP
105 Router Discovery Advertisements or Solicitations on a new interface,
106 the daemon enters a loop, listening for
107 RIP request and response and Router Discovery packets from other hosts.
113 formulates a reply based on the information maintained in its
117 packet generated contains a list of known routes, each marked
118 with a "hop count" metric (a count of 16 or greater is
119 considered "infinite").
120 Advertised metrics reflect the metric associated with interface
123 so setting the metric on an interface
124 is an effective way to steer traffic.
126 Responses do not include routes with a first hop on the requesting
127 network to implement in part
129 Requests from query programs
132 are answered with the complete table.
134 The routing table maintained by the daemon
135 includes space for several gateways for each destination
136 to speed recovery from a failing router.
139 packets received are used to update the routing tables provided they are
140 from one of the several currently recognized gateways or
141 advertise a better metric than at least one of the existing
144 When an update is applied,
146 records the change in its own tables and updates the kernel routing table
147 if the best route to the destination changes.
148 The change in the kernel routing table is reflected in the next batch of
151 If the next response is not scheduled for a while, a
153 response containing only recently changed routes is sent.
155 In addition to processing incoming packets,
157 also periodically checks the routing table entries.
158 If an entry has not been updated for 3 minutes, the entry's metric
159 is set to infinity and marked for deletion.
160 Deletions are delayed until the route has been advertised with
161 an infinite metric to insure the invalidation
162 is propagated throughout the local internet.
166 Routes in the kernel table that are added or changed as a result
167 of ICMP Redirect messages are deleted after a while to minimize
169 When a TCP connection suffers a timeout,
172 which deletes all redirected routes
173 through the gateway involved, advances the age of all RIP routes through
174 the gateway to allow an alternate to be chosen, and advances of the
175 age of any relevant Router Discovery Protocol default routes.
177 Hosts acting as internetwork routers gratuitously supply their
178 routing tables every 30 seconds to all directly connected hosts
180 These RIP responses are sent to the broadcast address on nets that support
182 to the destination address on point-to-point links, and to the router's
183 own address on other networks.
184 If RIPv2 is enabled, multicast packets are sent on interfaces that
185 support multicasting.
187 If no response is received on a remote interface, if there are errors
188 while sending responses,
189 or if there are more errors than input or output (see
191 then the cable or some other part of the interface is assumed to be
192 disconnected or broken, and routes are adjusted appropriately.
195 .Em Internet Router Discovery Protocol
196 is handled similarly.
197 When the daemon is supplying RIP routes, it also listens for
198 Router Discovery Solicitations and sends Advertisements.
199 When it is quiet and listening to other RIP routers, it
200 sends Solicitations and listens for Advertisements.
202 a good Advertisement and it is not multi-homed,
203 it stops listening for broadcast or multicast RIP responses.
204 It tracks several advertising routers to speed recovery when the
205 currently chosen router dies.
206 If all discovered routers disappear,
207 the daemon resumes listening to RIP responses.
208 It continues listening to RIP while using Router Discovery
209 if multi-homed to ensure all interfaces are used.
211 The Router Discovery standard requires that advertisements
212 have a default "lifetime" of 30 minutes. That means should
213 something happen, a client can be without a good route for
214 30 minutes. It is a good idea to reduce the default to 45
216 .Fl P Cm rdisc_interval=45
217 on the command line or
218 .Cm rdisc_interval=45
223 While using Router Discovery (which happens by default when
224 the system has a single network interface and a Router Discover Advertisement
225 is received), there is a single default route and a variable number of
226 redirected host routes in the kernel table.
227 On a host with more than one network interface,
228 this default route will be via only one of the interfaces.
229 Thus, multi-homed hosts running with \f3\-q\f1 might need
235 facility described below to support "legacy" systems
236 that can handle neither RIPv2 nor Router Discovery.
238 By default, neither Router Discovery advertisements nor solicitations
239 are sent over point to point links (e.g. PPP).
240 The netmask associated with point-to-point links (such as SLIP
241 or PPP, with the IFF_POINTOPOINT flag) is used by
243 to infer the netmask used by the remote system when RIPv1 is used.
245 The following options are available:
246 .Bl -tag -width indent
250 to supply routing information.
251 This is the default if multiple network interfaces are present on which
252 RIP or Router Discovery have not been disabled, and if the kernel switch
255 is the opposite of the
258 This is the default when only one interface is present.
259 With this explicit option, the daemon is always in "quiet-mode" for RIP
260 and does not supply routing information to other computers.
262 do not run in the background.
263 This option is meant for interactive use.
265 used on internetwork routers to offer a route
266 to the "default" destination.
270 and is present mostly for historical reasons.
273 on the command line or
278 since a larger metric
279 will be used, reducing the spread of the potentially dangerous
281 This is typically used on a gateway to the Internet,
282 or on a gateway that uses another routing protocol whose routes
283 are not reported to other local routers.
284 Notice that because a metric of 1 is used, this feature is
285 dangerous. It is more commonly accidentally used to create chaos with a
286 routing loop than to solve problems.
288 cause host or point-to-point routes to not be advertised,
289 provided there is a network route going the same direction.
290 That is a limited kind of aggregation.
291 This option is useful on gateways to Ethernets that have other gateway
292 machines connected with point-to-point links such as SLIP.
294 cause the machine to advertise a host or point-to-point route to
295 its primary interface.
296 It is useful on multi-homed machines such as NFS servers.
297 This option should not be used except when the cost of
298 the host routes it generates is justified by the popularity of
300 It is effective only when the machine is supplying
301 routing information, because there is more than one interface.
306 option to the limited extent of advertising the host route.
308 do not ignore RIPv2 authentication if we do not care about RIPv2
310 This option is required for conformance with RFC 1723.
311 However, it makes no sense and breaks using RIP as a discovery protocol
312 to ignore all RIPv2 packets that carry authentication when this machine
313 does not care about authentication.
315 increase the debugging level, which causes more information to be logged
316 on the tracefile specified with
319 The debugging level can be increased or decreased
327 .It Fl T Ar tracefile
328 increases the debugging level to at least 1 and
329 causes debugging information to be appended to the trace file.
330 Note that because of security concerns, it is wisest to not run
332 routinely with tracing directed to a file.
334 display and logs the version of daemon.
335 .It Fl F Ar net[/mask][,metric]
336 minimize routes in transmissions via interfaces with addresses that match
338 and synthesizes a default route to this machine with the
340 The intent is to reduce RIP traffic on slow, point-to-point links
341 such as PPP links by replacing many large UDP packets of RIP information
342 with a single, small packet containing a "fake" default route.
345 is absent, a value of 14 is assumed to limit
346 the spread of the "fake" default route.
347 This is a dangerous feature that when used carelessly can cause routing
349 Notice also that more than one interface can match the specified network
354 is equivalent to adding the parameter
362 Any other argument supplied is interpreted as the name
363 of a file in which the actions of
369 appending the name of the trace file to the command.
372 also supports the notion of
380 is started, it reads the file
382 to find such distant gateways which may not be located using
383 only information from a routing socket, to discover if some
384 of the local gateways are
386 and to obtain other parameters.
387 Gateways specified in this manner should be marked passive
388 if they are not expected to exchange routing information,
389 while gateways marked active
390 should be willing to exchange RIP packets.
393 gateways are installed in the
394 kernel's routing tables once upon startup and are not included in
395 transmitted RIP responses.
397 Distant active gateways are treated like network interfaces.
398 RIP responses are sent
402 If no responses are received, the associated route is deleted from
403 the kernel table and RIP responses advertised via other interfaces.
404 If the distant gateway resumes sending RIP responses, the associated
407 Such gateways can be useful on media that do not support broadcasts
408 or multicasts but otherwise act like classic shared media like
409 Ethernets such as some ATM networks.
410 One can list all RIP routers reachable on the HIPPI or ATM network in
414 Note that it is usually desirable to use RIPv2 in such situations
415 to avoid generating lists of inferred host routes.
419 are also passive, but are not placed in the kernel
420 routing table nor are they included in routing updates.
421 The function of external entries is to indicate
422 that another routing process
423 will install such a route if necessary,
424 and that other routes to that destination should not be installed
427 Such entries are only required when both routers may learn of routes
428 to the same destination.
432 file is comprised of a series of lines, each in
433 one of the following two formats or consist of parameters described later.
434 Blank lines and lines starting with '#' are comments.
442 .Pf < Cm passive No \&|
453 .Pf < Cm passive No \&|
461 is the name of the destination network or host.
462 It may be a symbolic network name or an Internet address
463 specified in "dot" notation (see
465 (If it is a name, then it must either be defined in
471 must have been started before
475 is an optional number between 1 and 32 indicating the netmask associated
480 is the name or address of the gateway to which RIP responses should
484 is the hop count to the destination host or network.
488 .Cm net Ar nname/32 .
495 must be present to indicate whether the gateway should be treated as
499 (as described above),
500 or whether the gateway is
502 to the scope of the RIP protocol.
504 As can be seen when debugging is turned on with
506 such lines create pseudo-interfaces.
507 To set parameters for remote or external interfaces,
509 .Cm if=alias(Hname) ,
510 .Cm if=remote(Hname) ,
513 Lines that start with neither "net" nor "host" must consist of one
514 or more of the following parameter settings, separated by commas or
517 .It Cm if Ns \&= Ns Ar ifname
518 indicates that the other parameters on the line apply to the interface
521 .It Cm subnet Ns \&= Ns Ar nname[/mask][,metric]
522 advertises a route to network
526 and the supplied metric (default 1).
527 This is useful for filling "holes" in CIDR allocations.
528 This parameter must appear by itself on a line.
529 The network number must specify a full, 32-bit value, as in 192.0.2.0
532 Do not use this feature unless necessary. It is dangerous.
533 .It Cm ripv1_mask Ns \&= Ns Ar nname/mask1,mask2
534 specifies that netmask of the network of which
539 For example \f2ripv1_mask=192.0.2.16/28,27\f1 marks 192.0.2.16/28
540 as a subnet of 192.0.2.0/27 instead of 192.0.2.0/24.
541 It is better to turn on RIPv2 instead of using this facility, for example
542 with \f2ripv2_out\f1.
543 .It Cm passwd Ns \&= Ns Ar XXX[|KeyID[start|stop]]
544 specifies a RIPv2 cleartext password that will be included on
545 all RIPv2 responses sent, and checked on all RIPv2 responses received.
546 Any blanks, tab characters, commas, or '#', '|', or NULL characters in the
547 password must be escaped with a backslash (\\).
548 The common escape sequences \\n, \\r, \\t, \\b, and \\xxx have their
552 must be unique but is ignored for cleartext passwords.
557 are timestamps in the form year/month/day@hour:minute.
558 They specify when the password is valid.
559 The valid password with the most future is used on output packets, unless
560 all passwords have expired, in which case the password that expired most
561 recently is used, or unless no passwords are valid yet, in which case
562 no password is output.
563 Incoming packets can carry any password that is valid, will
564 be valid within 24 hours, or that was valid within 24 hours.
565 To protect the secrets, the passwd settings are valid only in the
567 file and only when that file is readable only by UID 0.
568 .It Cm md5_passwd Ns \&= Ns Ar XXX|KeyID[start|stop]
569 specifies a RIPv2 MD5 password.
572 is required, this keyword is similar to
575 turns off aggregation of subnets in RIPv1 and RIPv2 responses.
577 turns off aggregation of networks into supernets in RIPv2 responses.
579 marks the interface to not be advertised in updates sent via other
580 interfaces, and turns off all RIP and router discovery through the interface.
582 disables all RIP processing on the specified interface.
583 If no interfaces are allowed to process RIP packets,
585 acts purely as a router discovery daemon.
587 Note that turning off RIP without explicitly turning on router
588 discovery advertisements with
594 to act as a client router discovery daemon, not advertising.
596 causes RIPv2 packets to be broadcast instead of multicast.
598 causes RIPv1 received responses to be ignored.
600 causes RIPv2 received responses to be ignored.
602 turns on RIPv2 output and causes RIPv2 advertisements to be
603 multicast when possible.
611 disables the Internet Router Discovery Protocol.
613 disables the transmission of Router Discovery Solicitations.
615 specifies that Router Discovery solicitations should be sent,
616 even on point-to-point links,
617 which by default only listen to Router Discovery messages.
619 disables the transmission of Router Discovery Advertisements.
621 specifies that Router Discovery Advertisements should be sent,
622 even on point-to-point links,
623 which by default only listen to Router Discovery messages.
625 specifies that Router Discovery packets should be broadcast instead of
627 .It Cm rdisc_pref Ns \&= Ns Ar N
628 sets the preference in Router Discovery Advertisements to the optionally
631 The default preference is 0.
632 Default routes with smaller or more negative preferences are preferred by
634 .It Cm rdisc_interval Ns \&= Ns Ar N
635 sets the nominal interval with which Router Discovery Advertisements
636 are transmitted to N seconds and their lifetime to 3*N.
637 .It Cm fake_default Ns \&= Ns Ar metric
638 has an identical effect to
639 .Fl F Ar net[/mask][=metric]
640 with the network and mask coming from the specified interface.
644 When RIPv2 routes are multicast, so that RIPv1 listeners cannot
645 receive them, this feature causes a RIPv1 default route to be
646 broadcast to RIPv1 listeners.
649 the default route is broadcast with a metric of 14.
650 That serves as a "poor man's router discovery" protocol.
651 .It Cm trust_gateway Ns \&= Ns Ar rname[|net1/mask1|net2/mask2|...]
652 causes RIP packets from that router and other routers named in
655 keywords to be accepted, and packets from other routers to be ignored.
656 If networks are specified, then routes to other networks will be ignored
659 causes RIP to allow ICMP Redirect messages when the system is acting
660 as a router and forwarding packets.
661 Otherwise, ICMP Redirect messages are overridden.
664 .Bl -tag -width /etc/gateways -compact
673 .%T Internet Transport Protocols
675 .%Q Xerox System Integration Standard
683 It does not always detect unidirectional failures in network interfaces,
684 for example, when the output side fails.