4.4BSD snapshot (revision 8.1); add 1993 to copyright
[unix-history] / usr / src / sbin / routed / routed.8
CommitLineData
b2d6cd51
KB
1.\" Copyright (c) 1983, 1991, 1993
2.\" The Regents of the University of California. All rights reserved.
b0afce1a 3.\"
d8c821c1 4.\" %sccs.include.redist.man%
b0afce1a 5.\"
b2d6cd51 6.\" @(#)routed.8 8.1 (Berkeley) %G%
ec338fb6 7.\"
70567b1c
CL
8.Dd
9.Dt ROUTED 8
10.Os BSD 4.2
11.Sh NAME
12.Nm routed
13.Nd network routing daemon
14.Sh SYNOPSIS
15.Nm routed
16.Op Fl d
17.Op Fl g
18.Op Fl q
19.Op Fl s
20.Op Fl t
21.Op Ar logfile
22.Sh DESCRIPTION
23.Nm Routed
b0afce1a
KM
24is invoked at boot time to manage the network routing tables.
25The routing daemon uses a variant of the Xerox NS Routing
26Information Protocol in maintaining up to date kernel routing
27table entries.
dfc5a452
MK
28It used a generalized protocol capable of use with multiple
29address types, but is currently used only for Internet routing
30within a cluster of networks.
70567b1c 31.Pp
b0afce1a 32In normal operation
70567b1c 33.Nm routed
dfc5a452 34listens on the
70567b1c 35.Xr udp 4
dfc5a452 36socket for the
70567b1c 37.Xr route 8
dfc5a452 38service (see
70567b1c 39.Xr services 5 )
b0afce1a
KM
40for routing information packets. If the host is an
41internetwork router, it periodically supplies copies
42of its routing tables to any directly connected hosts
43and networks.
70567b1c 44.Pp
b0afce1a 45When
70567b1c
CL
46.Nm routed
47is started, it uses the
48.Dv SIOCGIFCONF
49.Xr ioctl 2
b0afce1a
KM
50to find those
51directly connected interfaces configured into the
52system and marked ``up'' (the software loopback interface
53is ignored). If multiple interfaces
dfc5a452 54are present, it is assumed that the host will forward packets
b0afce1a 55between networks.
70567b1c 56.Nm Routed
b0afce1a 57then transmits a
70567b1c 58.Em request
b0afce1a
KM
59packet on each interface (using a broadcast packet if
60the interface supports it) and enters a loop, listening
61for
70567b1c 62.Em request
b0afce1a 63and
70567b1c 64.Em response
b0afce1a 65packets from other hosts.
70567b1c 66.Pp
b0afce1a 67When a
70567b1c 68.Em request
b0afce1a 69packet is received,
70567b1c 70.Nm routed
b0afce1a
KM
71formulates a reply based on the information maintained in its
72internal tables. The
70567b1c 73.Em response
b0afce1a
KM
74packet generated contains a list of known routes, each marked
75with a ``hop count'' metric (a count of 16, or greater, is
76considered ``infinite''). The metric associated with each
77route returned provides a metric
70567b1c
CL
78.Em relative to the sender .
79.Pp
80.Em Response
b0afce1a 81packets received by
70567b1c 82.Nm routed
b0afce1a
KM
83are used to update the routing tables if one of the following
84conditions is satisfied:
70567b1c
CL
85.Bl -enum
86.It
b0afce1a
KM
87No routing table entry exists for the destination network
88or host, and the metric indicates the destination is ``reachable''
89(i.e. the hop count is not infinite).
70567b1c 90.It
b0afce1a
KM
91The source host of the packet is the same as the router in the
92existing routing table entry. That is, updated information is
93being received from the very internetwork router through which
94packets for the destination are being routed.
70567b1c 95.It
b0afce1a
KM
96The existing entry in the routing table has not been updated for
97some time (defined to be 90 seconds) and the route is at least
98as cost effective as the current route.
70567b1c 99.It
b0afce1a
KM
100The new route describes a shorter route to the destination than
101the one currently stored in the routing tables; the metric of
102the new route is compared against the one stored in the table
103to decide this.
70567b1c
CL
104.El
105.Pp
b0afce1a 106When an update is applied,
70567b1c 107.Nm routed
dfc5a452
MK
108records the change in its internal tables and updates the kernel
109routing table.
110The change is reflected in the next
70567b1c 111.Em response
dfc5a452 112packet sent.
70567b1c 113.Pp
b0afce1a 114In addition to processing incoming packets,
70567b1c 115.Nm routed
b0afce1a
KM
116also periodically checks the routing table entries.
117If an entry has not been updated for 3 minutes, the entry's metric
118is set to infinity and marked for deletion. Deletions are delayed
119an additional 60 seconds to insure the invalidation is propagated
dfc5a452 120throughout the local internet.
70567b1c 121.Pp
b0afce1a
KM
122Hosts acting as internetwork routers gratuitously supply their
123routing tables every 30 seconds to all directly connected hosts
124and networks.
dfc5a452
MK
125The response is sent to the broadcast address on nets capable of that function,
126to the destination address on point-to-point links, and to the router's
127own address on other networks.
128The normal routing tables are bypassed when sending gratuitous responses.
129The reception of responses on each network is used to determine that the
130network and interface are functioning correctly.
131If no response is received on an interface, another route may be chosen
132to route around the interface, or the route may be dropped if no alternative
133is available.
70567b1c
CL
134.Pp
135Options supported by
136.Nm routed :
137.Bl -tag -width Ds
138.It Fl d
dfc5a452
MK
139Enable additional debugging information to be logged,
140such as bad packets received.
70567b1c 141.It Fl g
dfc5a452
MK
142This flag is used on internetwork routers to offer a route
143to the ``default'' destination.
144This is typically used on a gateway to the Internet,
145or on a gateway that uses another routing protocol whose routes
146are not reported to other local routers.
70567b1c 147.It Fl s
dfc5a452 148Supplying this
b0afce1a 149option forces
70567b1c 150.Nm routed
b0afce1a
KM
151to supply routing information whether it is acting as an internetwork
152router or not.
dfc5a452
MK
153This is the default if multiple network interfaces are present,
154or if a point-to-point link is in use.
70567b1c 155.It Fl q
dfc5a452
MK
156This
157is the opposite of the
70567b1c 158.Fl s
dfc5a452 159option.
70567b1c 160.It Fl t
dfc5a452 161If the
70567b1c 162.Fl t
b0afce1a
KM
163option is specified, all packets sent or received are
164printed on the standard output. In addition,
70567b1c 165.Nm routed
b0afce1a
KM
166will not divorce itself from the controlling terminal
167so that interrupts from the keyboard will kill the process.
70567b1c
CL
168.El
169.Pp
b0afce1a
KM
170Any other argument supplied is interpreted as the name
171of file in which
70567b1c 172.Nm routed Ns \'s
b0afce1a 173actions should be logged. This log contains information
dfc5a452
MK
174about any changes to the routing tables and, if not tracing all packets,
175a history of recent messages sent and received which are related to
b0afce1a 176the changed route.
70567b1c 177.Pp
b0afce1a 178In addition to the facilities described above,
70567b1c 179.Nm routed
b0afce1a 180supports the notion of ``distant''
70567b1c 181.Em passive
b0afce1a 182and
70567b1c 183.Em active
b0afce1a 184gateways. When
70567b1c 185.Nm routed
b0afce1a 186is started up, it reads the file
70567b1c 187.Pa /etc/gateways
dfc5a452 188to find gateways which may not be located using
70567b1c
CL
189only information from the
190.Dv SIOGIFCONF
191.Xr ioctl 2 .
b0afce1a
KM
192Gateways specified in this manner should be marked passive
193if they are not expected to exchange routing information,
194while gateways marked active
195should be willing to exchange routing information (i.e.
196they should have a
70567b1c 197.Nm routed
b0afce1a 198process running on the machine).
438b45db
MK
199Routes through passive gateways are installed in the
200kernel's routing tables once upon startup.
201Such routes are not included in
b0afce1a
KM
202any routing information transmitted.
203Active gateways are treated equally to network
204interfaces. Routing information is distributed
205to the gateway and if no routing information is
206received for a period of the time, the associated
207route is deleted.
438b45db 208Gateways marked
70567b1c 209.Em external
438b45db 210are also passive, but are not placed in the kernel
dfc5a452
MK
211routing table nor are they included in routing updates.
212The function of external entries is to inform
70567b1c 213.Nm routed
dfc5a452
MK
214that another routing process
215will install such a route, and that alternate routes to that destination
216should not be installed.
217Such entries are only required when both routers may learn of routes
218to the same destination.
70567b1c 219.Pp
b0afce1a 220The
70567b1c 221.Pa /etc/gateways
b0afce1a
KM
222is comprised of a series of lines, each in
223the following format:
70567b1c
CL
224.Bd -ragged
225.Pf < Cm net No \&|
226.Cm host Ns >
227.Ar name1
228.Cm gateway
229.Ar name2
230.Cm metric
231.Ar value
232.Pf < Cm passive No \&|
233.Cm active No \&|
234.Cm external Ns >
235.Ed
236.Pp
b0afce1a 237The
70567b1c 238.Cm net
b0afce1a 239or
70567b1c 240.Cm host
b0afce1a 241keyword indicates if the route is to a network or specific host.
70567b1c
CL
242.Pp
243.Ar Name1
b0afce1a
KM
244is the name of the destination network or host. This may be a
245symbolic name located in
70567b1c 246.Pa /etc/networks
b0afce1a 247or
70567b1c 248.Pa /etc/hosts
dfc5a452 249(or, if started after
70567b1c 250.Xr named 8 ,
dfc5a452 251known to the name server),
b0afce1a 252or an Internet address specified in ``dot'' notation; see
70567b1c
CL
253.Xr inet 3 .
254.Pp
255.Ar Name2
b0afce1a
KM
256is the name or address of the gateway to which messages should
257be forwarded.
70567b1c
CL
258.Pp
259.Ar Value
b0afce1a
KM
260is a metric indicating the hop count to the destination host
261or network.
70567b1c 262.Pp
dfc5a452 263One of the keywords
70567b1c
CL
264.Cm passive ,
265.Cm active
dfc5a452 266or
70567b1c 267.Cm external
b0afce1a 268indicates if the gateway should be treated as
70567b1c 269.Em passive
b0afce1a 270or
70567b1c 271.Em active
dfc5a452 272(as described above),
438b45db 273or whether the gateway is
70567b1c 274.Em external
438b45db 275to the scope of the
70567b1c 276.Nm routed
dfc5a452 277protocol.
70567b1c 278.Pp
dfc5a452 279Internetwork routers that are directly attached to the Arpanet or Milnet
70567b1c
CL
280should use the Exterior Gateway Protocol
281.Pq Tn EGP
282to gather routing information
dfc5a452 283rather then using a static routing table of passive gateways.
70567b1c
CL
284.Tn EGP
285is required in order to provide routes for local networks to the rest
dfc5a452
MK
286of the Internet system.
287Sites needing assistance with such configurations
288should contact the Computer Systems Research Group at Berkeley.
70567b1c
CL
289.Sh FILES
290.Bl -tag -width /etc/gateways -compact
291.It Pa /etc/gateways
292for distant gateways
293.El
294.Sh SEE ALSO
295.Xr udp 4 ,
296.Xr icmp 4 ,
297.Xr XNSrouted 8 ,
298.Xr htable 8
299.Rs
300.%T Internet Transport Protocols
301.%R XSIS 028112
302.%Q Xerox System Integration Standard
303.Re
304.Sh BUGS
b0afce1a 305The kernel's routing tables may not correspond to those of
70567b1c 306.Nm routed
dfc5a452 307when redirects change or add routes.
70567b1c 308.Nm Routed
438b45db 309should note any redirects received by reading
70567b1c
CL
310the
311.Tn ICMP
312packets received via a raw socket.
313.Pp
314.Nm Routed
dfc5a452 315should incorporate other routing protocols,
70567b1c
CL
316such as Xerox
317.Tn \&NS
318.Pq Xr XNSrouted 8
319and
320.Tn EGP .
dfc5a452
MK
321Using separate processes for each requires configuration options
322to avoid redundant or competing routes.
70567b1c
CL
323.Pp
324.Nm Routed
325should listen to intelligent interfaces, such as an
326.Tn IMP ,
438b45db 327to gather more information.
dfc5a452
MK
328It does not always detect unidirectional failures in network interfaces
329(e.g., when the output side fails).
70567b1c
CL
330.Sh HISTORY
331The
332.Nm
333command appeared in
334.Bx 4.2 .