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