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