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