]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - sbin/routed/routed.8
zfs: merge openzfs/zfs@e13538856
[FreeBSD/FreeBSD.git] / sbin / routed / routed.8
1 .\"   $Revision: 2.26 $
2 .\"
3 .\" Copyright (c) 1983, 1991, 1993
4 .\"     The Regents of the University of California.  All rights reserved.
5 .\"
6 .\" Redistribution and use in source and binary forms, with or without
7 .\" modification, are permitted provided that the following conditions
8 .\" are met:
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. Neither the name of the University nor the names of its contributors
15 .\"    may be used to endorse or promote products derived from this software
16 .\"    without specific prior written permission.
17 .\"
18 .\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
19 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
20 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
21 .\" ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
22 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
23 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
24 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
25 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
26 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
27 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 .\" SUCH DAMAGE.
29 .\"
30 .\"     @(#)routed.8    8.2 (Berkeley) 12/11/93
31 .\"
32 .Dd June 27, 2022
33 .Dt ROUTED 8
34 .Os
35 .Sh NAME
36 .Nm routed ,
37 .Nm rdisc
38 .Nd network RIP and router discovery routing daemon
39 .Sh SYNOPSIS
40 .Nm
41 .Op Fl isqdghmpAtv
42 .Op Fl T Ar tracefile
43 .Oo
44 .Fl F
45 .Ar net Ns Op /mask Ns Op ,metric
46 .Oc
47 .Op Fl P Ar parms
48 .Sh DESCRIPTION
49 The
50 .Nm
51 utility is a daemon invoked at boot time to manage the network
52 routing tables.
53 It uses Routing Information Protocol, RIPv1 (RFC\ 1058),
54 RIPv2 (RFC\ 1723),
55 and Internet Router Discovery Protocol (RFC 1256)
56 to maintain the kernel routing table.
57 The RIPv1 protocol is based on the reference
58 .Bx 4.3
59 daemon.
60 .Pp
61 It listens on the
62 .Xr udp 4
63 socket for the
64 .Xr route 8
65 service (see
66 .Xr services 5 )
67 for Routing Information Protocol packets.
68 It also sends and receives multicast Router Discovery ICMP messages.
69 If the host is a router,
70 .Nm
71 periodically supplies copies
72 of its routing tables to any directly connected hosts and networks.
73 It also advertises or solicits default routes using Router Discovery
74 ICMP messages.
75 .Pp
76 When started (or when a network interface is later turned on),
77 .Nm
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,
85 .Nm
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 -hopcount
90 (see
91 .Xr route 8 ) .
92 .Pp
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
95 connected networks.
96 After transmitting a RIP
97 .Em request
98 and
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 Discovery packets from other hosts.
102 .Pp
103 When a
104 .Em request
105 packet is received,
106 .Nm
107 formulates a reply based on the information maintained in its
108 internal tables.
109 The
110 .Em response
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 The advertised metric for a route reflects the metrics associated
115 with interfaces
116 (see
117 .Xr ifconfig 8 )
118 though which it is received and sent,
119 so setting the metric on an interface
120 is an effective way to steer traffic.
121 See also
122 .Cm adj_inmetric
123 and
124 .Cm adj_outmetric
125 parameters below.
126 .Pp
127 Responses do not include routes with a first hop on the requesting
128 network to implement in part
129 .Em split-horizon .
130 Requests from query programs
131 such as
132 .Xr rtquery 8
133 are answered with the complete table.
134 .Pp
135 The routing table maintained by the daemon
136 includes space for several gateways for each destination
137 to speed recovery from a failing router.
138 RIP
139 .Em response
140 packets received are used to update the routing tables provided they are
141 from one of the several currently recognized gateways or
142 advertise a better metric than at least one of the existing
143 gateways.
144 .Pp
145 When an update is applied,
146 .Nm
147 records the change in its own tables and updates the kernel routing table
148 if the best route to the destination changes.
149 The change in the kernel routing table is reflected in the next batch of
150 .Em response
151 packets sent.
152 If the next response is not scheduled for a while, a
153 .Em flash update
154 response containing only recently changed routes is sent.
155 .Pp
156 In addition to processing incoming packets,
157 .Nm
158 also periodically checks the routing table entries.
159 If an entry has not been updated for 3 minutes, the entry's metric
160 is set to infinity and marked for deletion.
161 Deletions are delayed until the route has been advertised with
162 an infinite metric to ensure the invalidation
163 is propagated throughout the local internet.
164 This is a form of
165 .Em poison reverse .
166 .Pp
167 Routes in the kernel table that are added or changed as a result
168 of ICMP Redirect messages are deleted after a while to minimize
169 .Em black-holes .
170 When a TCP connection suffers a timeout,
171 the kernel tells
172 .Nm ,
173 which deletes all redirected routes
174 through the gateway involved, advances the age of all RIP routes through
175 the gateway to allow an alternate to be chosen, and advances of the
176 age of any relevant Router Discovery Protocol default routes.
177 .Pp
178 Hosts acting as internetwork routers gratuitously supply their
179 routing tables every 30 seconds to all directly connected hosts
180 and networks.
181 These RIP responses are sent to the broadcast address on nets that support
182 broadcasting,
183 to the destination address on point-to-point links, and to the router's
184 own address on other networks.
185 If RIPv2 is enabled, multicast packets are sent on interfaces that
186 support multicasting.
187 .Pp
188 If no response is received on a remote interface, if there are errors
189 while sending responses,
190 or if there are more errors than input or output (see
191 .Xr netstat 1 ) ,
192 then the cable or some other part of the interface is assumed to be
193 disconnected or broken, and routes are adjusted appropriately.
194 .Pp
195 The
196 .Em Internet Router Discovery Protocol
197 is handled similarly.
198 When the daemon is supplying RIP routes, it also listens for
199 Router Discovery Solicitations and sends Advertisements.
200 When it is quiet and listening to other RIP routers, it
201 sends Solicitations and listens for Advertisements.
202 If it receives
203 a good Advertisement and it is not multi-homed,
204 it stops listening for broadcast or multicast RIP responses.
205 It tracks several advertising routers to speed recovery when the
206 currently chosen router dies.
207 If all discovered routers disappear,
208 the daemon resumes listening to RIP responses.
209 It continues listening to RIP while using Router Discovery
210 if multi-homed to ensure all interfaces are used.
211 .Pp
212 The Router Discovery standard requires that advertisements
213 have a default "lifetime" of 30 minutes.
214 That means should
215 something happen, a client can be without a good route for
216 30 minutes.
217 It is a good idea to reduce the default to 45
218 seconds using
219 .Fl P Cm rdisc_interval=45
220 on the command line or
221 .Cm rdisc_interval=45
222 in the
223 .Pa /etc/gateways
224 file.
225 .Pp
226 While using Router Discovery (which happens by default when
227 the system has a single network interface and a Router Discover Advertisement
228 is received), there is a single default route and a variable number of
229 redirected host routes in the kernel table.
230 On a host with more than one network interface,
231 this default route will be via only one of the interfaces.
232 Thus, multi-homed hosts running with
233 .Fl q
234 might need
235 .Cm no_rdisc
236 described below.
237 .Pp
238 See the
239 .Cm pm_rdisc
240 facility described below to support "legacy" systems
241 that can handle neither RIPv2 nor Router Discovery.
242 .Pp
243 By default, neither Router Discovery advertisements nor solicitations
244 are sent over point to point links (e.g.\& PPP).
245 The netmask associated with point-to-point links (such as SLIP
246 or PPP, with the IFF_POINTOPOINT flag) is used by
247 .Nm
248 to infer the netmask used by the remote system when RIPv1 is used.
249 .Pp
250 The following options are available:
251 .Bl -tag -width indent
252 .It Fl i
253 allow
254 .Nm
255 to accept a RIP request from non-router node.
256 When specified once,
257 .Nm
258 replies to a route information query from neighbor nodes.
259 When specified twice,
260 it replies to a query from remote nodes in addition.
261 .Xr rtquery 8
262 utility can be used to send a request.
263 .Pp
264 This feature is disabled by default because of a risk of reflection attack
265 though it is useful for debugging purpose.
266 .It Fl s
267 force
268 .Nm
269 to supply routing information.
270 This is the default if multiple network interfaces are present on which
271 RIP or Router Discovery have not been disabled, and if the kernel switch
272 ipforwarding=1.
273 .It Fl q
274 is the opposite of the
275 .Fl s
276 option.
277 This is the default when only one interface is present.
278 With this explicit option, the daemon is always in "quiet-mode" for RIP
279 and does not supply routing information to other computers.
280 .It Fl d
281 do not run in the background.
282 This option is meant for interactive use.
283 .It Fl g
284 used on internetwork routers to offer a route
285 to the "default" destination.
286 It is equivalent to
287 .Fl F
288 .Cm 0/0,1
289 and is present mostly for historical reasons.
290 A better choice is
291 .Fl P Cm pm_rdisc
292 on the command line or
293 .Cm pm_rdisc
294 in the
295 .Pa /etc/gateways
296 file,
297 since a larger metric
298 will be used, reducing the spread of the potentially dangerous
299 default route.
300 This is typically used on a gateway to the Internet,
301 or on a gateway that uses another routing protocol whose routes
302 are not reported to other local routers.
303 Notice that because a metric of 1 is used, this feature is
304 dangerous.
305 It is more commonly accidentally used to create chaos with a
306 routing loop than to solve problems.
307 .It Fl h
308 cause host or point-to-point routes to not be advertised,
309 provided there is a network route going the same direction.
310 That is a limited kind of aggregation.
311 This option is useful on gateways to Ethernets that have other gateway
312 machines connected with point-to-point links such as SLIP.
313 .It Fl m
314 cause the machine to advertise a host or point-to-point route to
315 its primary interface.
316 It is useful on multi-homed machines such as NFS servers.
317 This option should not be used except when the cost of
318 the host routes it generates is justified by the popularity of
319 the server.
320 It is effective only when the machine is supplying
321 routing information, because there is more than one interface.
322 The
323 .Fl m
324 option overrides the
325 .Fl q
326 option to the limited extent of advertising the host route.
327 .It Fl A
328 do not ignore RIPv2 authentication if we do not care about RIPv2
329 authentication.
330 This option is required for conformance with RFC 1723.
331 However, it makes no sense and breaks using RIP as a discovery protocol
332 to ignore all RIPv2 packets that carry authentication when this machine
333 does not care about authentication.
334 .It Fl t
335 increase the debugging level, which causes more information to be logged
336 on the tracefile specified with
337 .Fl T
338 or standard out.
339 The debugging level can be increased or decreased
340 with the
341 .Em SIGUSR1
342 or
343 .Em SIGUSR2
344 signals or with the
345 .Xr rtquery 8
346 command.
347 .It Fl T Ar tracefile
348 increases the debugging level to at least 1 and
349 causes debugging information to be appended to the trace file.
350 Note that because of security concerns, it is wisest to not run
351 .Nm
352 routinely with tracing directed to a file.
353 .It Fl v
354 display and logs the version of daemon.
355 .It Fl F Ar net[/mask][,metric]
356 minimize routes in transmissions via interfaces with addresses that match
357 .Em net/mask ,
358 and synthesizes a default route to this machine with the
359 .Em metric .
360 The intent is to reduce RIP traffic on slow, point-to-point links
361 such as PPP links by replacing many large UDP packets of RIP information
362 with a single, small packet containing a "fake" default route.
363 If
364 .Em metric
365 is absent, a value of 14 is assumed to limit
366 the spread of the "fake" default route.
367 This is a dangerous feature that when used carelessly can cause routing
368 loops.
369 Notice also that more than one interface can match the specified network
370 number and mask.
371 See also
372 .Fl g .
373 .It Fl P Ar parms
374 is equivalent to adding the parameter
375 line
376 .Em parms
377 to the
378 .Pa /etc/gateways
379 file.
380 .El
381 .Pp
382 Any other argument supplied is interpreted as the name
383 of a file in which the actions of
384 .Nm
385 should be logged.
386 It is better to use
387 .Fl T
388 instead of
389 appending the name of the trace file to the command.
390 .Pp
391 The
392 .Nm
393 utility also supports the notion of
394 "distant"
395 .Em passive
396 or
397 .Em active
398 gateways.
399 When
400 .Nm
401 is started, it reads the file
402 .Pa /etc/gateways
403 to find such distant gateways which may not be located using
404 only information from a routing socket, to discover if some
405 of the local gateways are
406 .Em passive ,
407 and to obtain other parameters.
408 Gateways specified in this manner should be marked passive
409 if they are not expected to exchange routing information,
410 while gateways marked active
411 should be willing to exchange RIP packets.
412 Routes through
413 .Em passive
414 gateways are installed in the
415 kernel's routing tables once upon startup and are not included in
416 transmitted RIP responses.
417 .Pp
418 Distant active gateways are treated like network interfaces.
419 RIP responses are sent
420 to the distant
421 .Em active
422 gateway.
423 If no responses are received, the associated route is deleted from
424 the kernel table and RIP responses advertised via other interfaces.
425 If the distant gateway resumes sending RIP responses, the associated
426 route is restored.
427 .Pp
428 Such gateways can be useful on media that do not support broadcasts
429 or multicasts but otherwise act like classic shared media like
430 Ethernets such as some ATM networks.
431 One can list all RIP routers reachable on the HIPPI or ATM network in
432 .Pa /etc/gateways
433 with a series of
434 "host" lines.
435 Note that it is usually desirable to use RIPv2 in such situations
436 to avoid generating lists of inferred host routes.
437 .Pp
438 Gateways marked
439 .Em external
440 are also passive, but are not placed in the kernel
441 routing table nor are they included in routing updates.
442 The function of external entries is to indicate
443 that another routing process
444 will install such a route if necessary,
445 and that other routes to that destination should not be installed
446 by
447 .Nm .
448 Such entries are only required when both routers may learn of routes
449 to the same destination.
450 .Pp
451 The
452 .Pa /etc/gateways
453 file is comprised of a series of lines, each in
454 one of the following two formats or consist of parameters described later.
455 Blank lines and lines starting with '#' are comments.
456 .Bd -ragged
457 .Cm net
458 .Ar Nname[/mask]
459 .Cm gateway
460 .Ar Gname
461 .Cm metric
462 .Ar value
463 .Pf < Cm passive No \&|
464 .Cm active No \&|
465 .Cm extern Ns >
466 .Ed
467 .Bd -ragged
468 .Cm host
469 .Ar Hname
470 .Cm gateway
471 .Ar Gname
472 .Cm metric
473 .Ar value
474 .Pf < Cm passive No \&|
475 .Cm active No \&|
476 .Cm extern Ns >
477 .Ed
478 .Pp
479 .Ar Nname
480 or
481 .Ar Hname
482 is the name of the destination network or host.
483 It may be a symbolic network name or an Internet address
484 specified in "dot" notation (see
485 .Xr inet 3 ) .
486 (If it is a name, then it must either be defined in
487 .Pa /etc/networks
488 or
489 .Pa /etc/hosts ,
490 or a method in
491 .Xr nsswitch.conf 5
492 must be able to resolve it.)
493 .Pp
494 .Ar Mask
495 is an optional number between 1 and 32 indicating the netmask associated
496 with
497 .Ar Nname .
498 .Pp
499 .Ar Gname
500 is the name or address of the gateway to which RIP responses should
501 be forwarded.
502 .Pp
503 .Ar Value
504 is the hop count to the destination host or network.
505 .Pp
506 .Cm Host Ar hname
507 is equivalent to
508 .Cm net Ar nname/32 .
509 .Pp
510 One of the keywords
511 .Cm passive ,
512 .Cm active
513 or
514 .Cm external
515 must be present to indicate whether the gateway should be treated as
516 .Cm passive
517 or
518 .Cm active
519 (as described above),
520 or whether the gateway is
521 .Cm external
522 to the scope of the RIP protocol.
523 .Pp
524 As can be seen when debugging is turned on with
525 .Fl t ,
526 such lines create pseudo-interfaces.
527 To set parameters for remote or external interfaces,
528 a line starting with
529 .Cm if=alias(Hname) ,
530 .Cm if=remote(Hname) ,
531 etc.\& should be used.
532 .Ss Parameters
533 Lines that start with neither "net" nor "host" must consist of one
534 or more of the following parameter settings, separated by commas or
535 blanks:
536 .Bl -tag -width indent
537 .It Cm if Ns = Ns Ar ifname
538 indicates that the other parameters on the line apply to the interface
539 name
540 .Ar ifname .
541 .It Cm subnet Ns = Ns Ar nname Ns Oo / Ns Ar mask Oc Ns Op , Ns Ar metric
542 advertises a route to network
543 .Ar nname
544 with mask
545 .Ar mask
546 and the supplied metric (default 1).
547 This is useful for filling "holes" in CIDR allocations.
548 This parameter must appear by itself on a line.
549 The network number must specify a full, 32-bit value, as in 192.0.2.0
550 instead of 192.0.2.
551 .Pp
552 Do not use this feature unless necessary.
553 It is dangerous.
554 .It Cm ripv1_mask Ns = Ns Ar nname Ns / Ns Ar mask1 , Ns Ar mask2
555 specifies that netmask of the network of which
556 .Ar nname Ns / Ns Ar mask1
557 is
558 a subnet should be
559 .Ar mask2 .
560 For example,
561 .Dq Li ripv1_mask=192.0.2.16/28,27
562 marks 192.0.2.16/28
563 as a subnet of 192.0.2.0/27 instead of 192.0.2.0/24.
564 It is better to turn on RIPv2 instead of using this facility, for example
565 with
566 .Cm ripv2_out .
567 .It Cm passwd Ns = Ns Ar XXX[|KeyID[start|stop]]
568 specifies a RIPv2 cleartext password that will be included on
569 all RIPv2 responses sent, and checked on all RIPv2 responses received.
570 Any blanks, tab characters, commas, or '#', '|', or NULL characters in the
571 password must be escaped with a backslash (\\).
572 The common escape sequences \\n, \\r, \\t, \\b, and \\xxx have their
573 usual meanings.
574 The
575 .Cm KeyID
576 must be unique but is ignored for cleartext passwords.
577 If present,
578 .Cm start
579 and
580 .Cm stop
581 are timestamps in the form year/month/day@hour:minute.
582 They specify when the password is valid.
583 The valid password with the most future is used on output packets, unless
584 all passwords have expired, in which case the password that expired most
585 recently is used, or unless no passwords are valid yet, in which case
586 no password is output.
587 Incoming packets can carry any password that is valid, will
588 be valid within the next 24 hours, or that was valid within the preceding
589 24 hours.
590 To protect the secrets, the passwd settings are valid only in the
591 .Pa /etc/gateways
592 file and only when that file is readable only by UID 0.
593 .It Cm md5_passwd Ns \&= Ns Ar XXX|KeyID[start|stop]
594 specifies a RIPv2 MD5 password.
595 Except that a
596 .Cm KeyID
597 is required, this keyword is similar to
598 .Cm passwd .
599 .It Cm no_ag
600 turns off aggregation of subnets in RIPv1 and RIPv2 responses.
601 .It Cm no_super_ag
602 turns off aggregation of networks into supernets in RIPv2 responses.
603 .It Cm passive
604 marks the interface to not be advertised in updates sent via other
605 interfaces, and turns off all RIP and router discovery through the interface.
606 .It Cm no_rip
607 disables all RIP processing on the specified interface.
608 If no interfaces are allowed to process RIP packets,
609 .Nm
610 acts purely as a router discovery daemon.
611 .Pp
612 Note that turning off RIP without explicitly turning on router
613 discovery advertisements with
614 .Cm rdisc_adv
615 or
616 .Fl s
617 causes
618 .Nm
619 to act as a client router discovery daemon, not advertising.
620 .It Cm no_rip_mcast
621 causes RIPv2 packets to be broadcast instead of multicast.
622 .It Cm no_rip_out
623 causes no RIP updates to be sent.
624 .It Cm no_ripv1_in
625 causes RIPv1 received responses to be ignored.
626 .It Cm no_ripv2_in
627 causes RIPv2 received responses to be ignored.
628 .It Cm ripv2_out
629 turns on RIPv2 output and causes RIPv2 advertisements to be
630 multicast when possible.
631 .It Cm ripv2
632 is equivalent to
633 .Cm no_ripv1_in
634 and
635 .Cm no_ripv1_out .
636 This enables RIPv2.
637 .It Cm no_rdisc
638 disables the Internet Router Discovery Protocol.
639 .It Cm no_solicit
640 disables the transmission of Router Discovery Solicitations.
641 .It Cm send_solicit
642 specifies that Router Discovery solicitations should be sent,
643 even on point-to-point links,
644 which by default only listen to Router Discovery messages.
645 .It Cm no_rdisc_adv
646 disables the transmission of Router Discovery Advertisements.
647 .It Cm rdisc_adv
648 specifies that Router Discovery Advertisements should be sent,
649 even on point-to-point links,
650 which by default only listen to Router Discovery messages.
651 .It Cm bcast_rdisc
652 specifies that Router Discovery packets should be broadcast instead of
653 multicast.
654 .It Cm rdisc_pref Ns \&= Ns Ar N
655 sets the preference in Router Discovery Advertisements to the optionally
656 signed integer
657 .Ar N .
658 The default preference is 0.
659 Default routes with smaller or more negative preferences are preferred by
660 clients.
661 .It Cm rdisc_interval Ns \&= Ns Ar N
662 sets the nominal interval with which Router Discovery Advertisements
663 are transmitted to N seconds and their lifetime to 3*N.
664 .It Cm fake_default Ns \&= Ns Ar metric
665 has an identical effect to
666 .Fl F Ar net[/mask][=metric]
667 with the network and mask coming from the specified interface.
668 .It Cm pm_rdisc
669 is similar to
670 .Cm fake_default .
671 When RIPv2 routes are multicast, so that RIPv1 listeners cannot
672 receive them, this feature causes a RIPv1 default route to be
673 broadcast to RIPv1 listeners.
674 Unless modified with
675 .Cm fake_default ,
676 the default route is broadcast with a metric of 14.
677 That serves as a "poor man's router discovery" protocol.
678 .It Cm adj_inmetric Ns \&= Ns Ar delta
679 adjusts the hop count or metric of received RIP routes by
680 .Ar delta .
681 The metric of every received RIP route is increased by the sum
682 of two values associated with the interface.
683 One is the adj_inmetric value and the other is the interface
684 metric set with
685 .Xr ifconfig 8 .
686 .It Cm adj_outmetric Ns \&= Ns Ar delta
687 adjusts the hop count or metric of advertised RIP routes by
688 .Ar delta .
689 The metric of every received RIP route is increased by the metric
690 associated with the interface by which it was received, or by 1 if
691 the interface does not have a non-zero metric.
692 The metric of the received route is then increased by the
693 adj_outmetric associated with the interface.
694 Every advertised route is increased by a total of four
695 values,
696 the metric set for the interface by which it was received with
697 .Xr ifconfig 8 ,
698 the
699 .Cm adj_inmetric Ar delta
700 of the receiving interface,
701 the metric set for the interface by which it is transmitted with
702 .Xr ifconfig 8 ,
703 and the
704 .Cm adj_outmetric Ar delta
705 of the transmitting interface.
706 .It Cm trust_gateway Ns \&= Ns Ar rname[|net1/mask1|net2/mask2|...]
707 causes RIP packets from router
708 .Ar rname
709 and other routers named in other
710 .Cm trust_gateway
711 keywords to be accepted, and packets from other routers to be ignored.
712 If networks are specified, then routes to other networks will be ignored
713 from that router.
714 .It Cm redirect_ok
715 allows the kernel to listen ICMP Redirect messages when the system is acting
716 as a router and forwarding packets.
717 Otherwise, ICMP Redirect messages are overridden and deleted when the
718 system is acting as a router.
719 .El
720 .Sh FILES
721 .Bl -tag -width /etc/gateways -compact
722 .It Pa /etc/gateways
723 for distant gateways
724 .El
725 .Sh SEE ALSO
726 .Xr icmp 4 ,
727 .Xr udp 4 ,
728 .Xr rtquery 8
729 .Rs
730 .%T Internet Transport Protocols
731 .%R XSIS 028112
732 .%Q Xerox System Integration Standard
733 .Re
734 .Sh HISTORY
735 The
736 .Nm
737 utility appeared in
738 .Bx 4.2 .
739 .\"  LocalWords:  loopback ICMP rtquery ifconfig multicasting Solicitations RIPv
740 .\"  LocalWords:  netstat rdisc
741 .Sh BUGS
742 It does not always detect unidirectional failures in network interfaces,
743 for example, when the output side fails.