📄 routed.8
字号:
.\" Copyright (c) 1983, 1991, 1993.\" The Regents of the University of California. All rights reserved..\".\" Redistribution and use in source and binary forms, with or without.\" modification, are permitted provided that the following conditions.\" are met:.\" 1. Redistributions of source code must retain the above copyright.\" notice, this list of conditions and the following disclaimer..\" 2. Redistributions in binary form must reproduce the above copyright.\" notice, this list of conditions and the following disclaimer in the.\" documentation and/or other materials provided with the distribution..\" 3. All advertising materials mentioning features or use of this software.\" must display the following acknowledgement:.\" This product includes software developed by the University of.\" California, Berkeley and its contributors..\" 4. Neither the name of the University nor the names of its contributors.\" may be used to endorse or promote products derived from this software.\" without specific prior written permission..\".\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION).\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF.\" SUCH DAMAGE..\".\" @(#)routed.8 8.2 (Berkeley) 12/11/93.\".Dd December 11, 1993.Dt ROUTED 8.Os BSD 4.2.Sh NAME.Nm routed.Nd network routing daemon.Sh SYNOPSIS.Nm routed.Op Fl d.Op Fl g.Op Fl q.Op Fl s.Op Fl t.Op Ar logfile.Sh DESCRIPTION.Nm Routedis invoked at boot time to manage the network routing tables.The routing daemon uses a variant of the Xerox NS RoutingInformation Protocol in maintaining up to date kernel routingtable entries.It used a generalized protocol capable of use with multipleaddress types, but is currently used only for Internet routingwithin a cluster of networks..PpIn normal operation.Nm routedlistens on the.Xr udp 4socket for the.Xr route 8service (see.Xr services 5 )for routing information packets. If the host is aninternetwork router, it periodically supplies copiesof its routing tables to any directly connected hostsand networks..PpWhen.Nm routedis started, it uses the.Dv SIOCGIFCONF.Xr ioctl 2to find thosedirectly connected interfaces configured into thesystem and marked ``up'' (the software loopback interfaceis ignored). If multiple interfacesare present, it is assumed that the host will forward packetsbetween networks..Nm Routedthen transmits a .Em requestpacket on each interface (using a broadcast packet ifthe interface supports it) and enters a loop, listeningfor.Em requestand.Em responsepackets from other hosts..PpWhen a.Em requestpacket is received, .Nm routedformulates a reply based on the information maintained in itsinternal tables. The.Em responsepacket generated contains a list of known routes, each markedwith a ``hop count'' metric (a count of 16, or greater, isconsidered ``infinite''). The metric associated with eachroute returned provides a metric.Em relative to the sender ..Pp.Em Responsepackets received by.Nm routedare used to update the routing tables if one of the followingconditions is satisfied:.Bl -enum.ItNo routing table entry exists for the destination networkor host, and the metric indicates the destination is ``reachable''(i.e. the hop count is not infinite)..ItThe source host of the packet is the same as the router in theexisting routing table entry. That is, updated information isbeing received from the very internetwork router through whichpackets for the destination are being routed..ItThe existing entry in the routing table has not been updated forsome time (defined to be 90 seconds) and the route is at leastas cost effective as the current route..ItThe new route describes a shorter route to the destination thanthe one currently stored in the routing tables; the metric ofthe new route is compared against the one stored in the tableto decide this..El.PpWhen an update is applied,.Nm routedrecords the change in its internal tables and updates the kernelrouting table.The change is reflected in the next.Em responsepacket sent..PpIn addition to processing incoming packets,.Nm routedalso periodically checks the routing table entries.If an entry has not been updated for 3 minutes, the entry's metricis set to infinity and marked for deletion. Deletions are delayedan additional 60 seconds to insure the invalidation is propagatedthroughout the local internet..PpHosts acting as internetwork routers gratuitously supply theirrouting tables every 30 seconds to all directly connected hostsand networks.The response is sent to the broadcast address on nets capable of that function,to the destination address on point-to-point links, and to the router'sown address on other networks.The normal routing tables are bypassed when sending gratuitous responses.The reception of responses on each network is used to determine that thenetwork and interface are functioning correctly.If no response is received on an interface, another route may be chosento route around the interface, or the route may be dropped if no alternativeis available..PpOptions supported by.Nm routed :.Bl -tag -width Ds.It Fl dEnable additional debugging information to be logged,such as bad packets received..It Fl gThis flag is used on internetwork routers to offer a routeto the ``default'' destination.This is typically used on a gateway to the Internet,or on a gateway that uses another routing protocol whose routesare not reported to other local routers..It Fl sSupplying thisoption forces .Nm routedto supply routing information whether it is acting as an internetworkrouter or not.This is the default if multiple network interfaces are present,or if a point-to-point link is in use..It Fl qThisis the opposite of the.Fl soption..It Fl tIf the.Fl toption is specified, all packets sent or received areprinted on the standard output. In addition,.Nm routedwill not divorce itself from the controlling terminalso that interrupts from the keyboard will kill the process..El.PpAny other argument supplied is interpreted as the nameof file in which .Nm routed Ns \'sactions should be logged. This log contains informationabout any changes to the routing tables and, if not tracing all packets,a history of recent messages sent and received which are related tothe changed route..PpIn addition to the facilities described above, .Nm routedsupports the notion of ``distant''.Em passiveand .Em activegateways. When .Nm routedis started up, it reads the file.Pa /etc/gatewaysto find gateways which may not be located usingonly information from the.Dv SIOGIFCONF.Xr ioctl 2 .Gateways specified in this manner should be marked passiveif they are not expected to exchange routing information,while gateways marked activeshould be willing to exchange routing information (i.e.they should have a.Nm routedprocess running on the machine).Routes through passive gateways are installed in thekernel's routing tables once upon startup.Such routes are not included inany routing information transmitted.Active gateways are treated equally to networkinterfaces. Routing information is distributedto the gateway and if no routing information isreceived for a period of time, the associatedroute is deleted.Gateways marked.Em externalare also passive, but are not placed in the kernelrouting table nor are they included in routing updates.The function of external entries is to inform.Nm routedthat another routing processwill install such a route, and that alternate routes to that destinationshould not be installed.Such entries are only required when both routers may learn of routesto the same destination..PpThe .Pa /etc/gatewaysis comprised of a series of lines, each inthe following format:.Bd -ragged.Pf < Cm net No \&|.Cm host Ns >.Ar name1.Cm gateway.Ar name2.Cm metric.Ar value.Pf < Cm passive No \&|.Cm active No \&|.Cm external Ns >.Ed.PpThe .Cm netor.Cm hostkeyword indicates if the route is to a network or specific host..Pp.Ar Name1is the name of the destination network or host. This may be asymbolic name located in.Pa /etc/networksor.Pa /etc/hosts(or, if started after.Xr named 8 ,known to the name server), or an Internet address specified in ``dot'' notation; see.Xr inet 3 ..Pp.Ar Name2is the name or address of the gateway to which messages shouldbe forwarded..Pp.Ar Valueis a metric indicating the hop count to the destination hostor network..PpOne of the keywords.Cm passive ,.Cm activeor.Cm externalindicates if the gateway should be treated as .Em passiveor.Em active(as described above),or whether the gateway is.Em externalto the scope of the.Nm routedprotocol..PpInternetwork routers that are directly attached to the Arpanet or Milnetshould use the Exterior Gateway Protocol.Pq Tn EGPto gather routing informationrather then using a static routing table of passive gateways..Tn EGPis required in order to provide routes for local networks to the restof the Internet system..Sh FILES.Bl -tag -width /etc/gateways -compact.It Pa /etc/gatewaysfor distant gateways.El.Sh SEE ALSO.Xr udp 4 ,.Xr icmp 4 ,.Xr XNSrouted 8 ,.Xr htable 8.Rs.%T Internet Transport Protocols.%R XSIS 028112.%Q Xerox System Integration Standard.Re.Sh BUGSThe kernel's routing tables may not correspond to those of.Nm routedwhen redirects change or add routes..Nm Routedshould note any redirects received by readingthe.Tn ICMPpackets received via a raw socket..Pp.Nm Routedshould incorporate other routing protocols,such as Xerox.Tn \&NS.Pq Xr XNSrouted 8and.Tn EGP .Using separate processes for each requires configuration optionsto avoid redundant or competing routes..Pp.Nm Routedshould listen to intelligent interfaces, such as an.Tn IMP ,to gather more information.It does not always detect unidirectional failures in network interfaces(e.g., when the output side fails)..Sh HISTORYThe.Nmcommand appeared in.Bx 4.2 .
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -