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 | .\" @(#)route.8 6.11 (Berkeley) 3/16/91 | |
33 | .\" | |
34 | .Dd March 16, 1991 | |
35 | .Dt ROUTE 8 | |
36 | .Os BSD 4.2 | |
37 | .Sh NAME | |
38 | .Nm route | |
39 | .Nd manually manipulate the routing tables (Interim) | |
40 | .Sh SYNOPSIS | |
41 | .Nm route | |
42 | .Op Fl n | |
43 | .Op Fl q | |
44 | .Op Fl v | |
45 | .Ar command | |
46 | .Oo | |
47 | .Op Ar modifiers | |
48 | .Ar args | |
49 | .Oc | |
50 | .Sh DESCRIPTION | |
51 | .Nm Route | |
52 | is a program used to manually manipulate the network | |
53 | routing tables. It normally is not needed, as the | |
54 | system routing table management daemon, | |
55 | .Xr routed 8 , | |
56 | should tend to this task. | |
57 | .Pp | |
58 | Options supported by | |
59 | .Nm route : | |
60 | .Pp | |
61 | .Bl -tag -width Ds | |
62 | .It Fl n | |
63 | Prevent attempts to print host and network names symbolically | |
64 | when reporting actions. | |
65 | .It Fl v | |
66 | (verbose) Print additional details. | |
67 | .It Fl q | |
68 | Suppress all output. | |
69 | .El | |
70 | .Pp | |
71 | Commands accepted by | |
72 | .Nm route : | |
73 | .Pp | |
74 | .Bl -tag -width Fl -compact | |
75 | .It Cm add | |
76 | Add a route. | |
77 | .It Cm flush | |
78 | Remove all routes. | |
79 | .It Cm delete | |
80 | Delete a specific route. | |
81 | .It Cm change | |
82 | Change aspects of a route (such as its gateway). | |
83 | .It Cm get | |
84 | Lookup and display the route for a destination. | |
85 | .It Cm monitor | |
86 | Continuously report any changes to the routing information base, | |
87 | routing lookup misses, or suspected network partionings. | |
88 | .El | |
89 | .Pp | |
90 | The monitor command has the syntax | |
91 | .Pp | |
92 | .Bd -filled -offset indent -compact | |
93 | .Nm route Op Fl n | |
94 | .Cm monitor | |
95 | .Ed | |
96 | .Pp | |
97 | The flush command has the syntax | |
98 | .Pp | |
99 | .Bd -filled -offset indent -compact | |
100 | .Nm route Op Fl n | |
101 | .Cm flush | |
102 | .Op Ar family | |
103 | .Ed | |
104 | .Pp | |
105 | Where the address family may be specified by any of the | |
106 | .Fl osi , | |
107 | .Fl xns , | |
108 | or | |
109 | .Fl inet | |
110 | keywords. | |
111 | .Pp | |
112 | The other commands have the following syntax: | |
113 | .Pp | |
114 | .Bd -filled -offset indent -compact | |
115 | .Nm route Op Fl n | |
116 | .Ar command | |
117 | .Op Fl net No \&| Fl host | |
118 | .Ar destination gateway | |
119 | .Ed | |
120 | .Pp | |
121 | where | |
122 | .Ar destination | |
123 | is the destination host or network, | |
124 | .Ar gateway | |
125 | is the next-hop gateway to which packets should be addressed. | |
126 | Routes to a particular host are distinguished from those to | |
127 | a network by interpreting the Internet address associated with | |
128 | .Ar destination . | |
129 | The optional keywords | |
130 | .Fl net | |
131 | and | |
132 | .Fl host | |
133 | force the destination to be interpreted as a network or a host, respectively. | |
134 | Otherwise, if the | |
135 | .Ar destination | |
136 | has a ``local address part'' of | |
137 | INADDR_ANY , | |
138 | or if the | |
139 | .Ar destination | |
140 | is the symbolic name of a network, then the route is | |
141 | assumed to be to a network; otherwise, it is presumed to be a | |
142 | route to a host. | |
143 | .Pp | |
144 | For example, | |
145 | .Li 128.32 | |
146 | is interpreted as | |
147 | .Fl host Li 128.0.0.32 ; | |
148 | .Li 128.32.130 | |
149 | is interpreted as | |
150 | .Fl host Li 128.32.0.130 ; | |
151 | .Fl net Li 128.32 | |
152 | is interpreted as | |
153 | .Li 128.32.0.0; | |
154 | and | |
155 | .Fl net Li 128.32.130 | |
156 | is interpreted as | |
157 | .Li 128.32.130.0 . | |
158 | .Pp | |
159 | If the route is via an interface rather than | |
160 | via a gateway, the | |
161 | .Fl interface | |
162 | modifier should be specified; | |
163 | the gateway given is the address of this host on the common network, | |
164 | indicating the interface to be used for transmission. | |
165 | .Pp | |
166 | The optional modifiers | |
167 | .Fl xns , | |
168 | and | |
169 | .Fl osi | |
170 | specify that all subsequent addresses are in the | |
171 | .Tn XNS | |
172 | or | |
173 | .Tn OSI | |
174 | address families, | |
175 | and the names must be numeric specifications rather than | |
176 | symbolic names. | |
177 | .Pp | |
178 | The optional | |
179 | .Fl netmask | |
180 | qualifier is intended | |
181 | to achieve the effect of an | |
182 | .Tn OSI | |
183 | .Tn ESIS | |
184 | redirect with the netmask option. | |
185 | One specifies an additional ensuing address parameter | |
186 | (to be interpreted as a network mask). | |
187 | The implicit network mask generated in the inet case | |
188 | can be overridden by making sure this option follows the destination parameter. | |
189 | .Pp | |
190 | The optional modifiers | |
191 | .Fl rtt , | |
192 | .Fl rttvar , | |
193 | .Fl sendpipe , | |
194 | .Fl recvpipe , | |
195 | .Fl mtu , | |
196 | .Fl hopcount , | |
197 | .Fl expire , | |
198 | and | |
199 | .Fl ssthresh | |
200 | provide initial values to metrics maintained in the routing entry. | |
201 | These may be individually locked by preceding each such modifier to | |
202 | be locked by | |
203 | the | |
204 | .Fl lock | |
205 | meta-modifier, or one can | |
206 | specify that all ensuing metrics may be locked by the | |
207 | .Fl lockrest | |
208 | meta-modifier. | |
209 | .Pp | |
210 | In a | |
211 | .Cm change | |
212 | or | |
213 | .Cm add | |
214 | command where the destination and gateway are not sufficient to specify | |
215 | the route (as in the | |
216 | .Tn ISO | |
217 | case where several interfaces may have the | |
218 | same address), the | |
219 | .Fl ifp | |
220 | or | |
221 | .Fl ifa | |
222 | modifiers may be used to determine the interface or interface address. | |
223 | .Pp | |
224 | All symbolic names specified for a | |
225 | .Ar destination | |
226 | or | |
227 | .Ar gateway | |
228 | are looked up first as a host name using | |
229 | .Xr gethostbyname 3 . | |
230 | If this lookup fails, | |
231 | .Xr getnetbyname 3 | |
232 | is then used to interpret the name as that of a network. | |
233 | .Pp | |
234 | .Nm Route | |
235 | uses a routing socket and the new message types | |
236 | RTM_ADD, | |
237 | RTM_DELETE, | |
238 | RTM_GET, | |
239 | and | |
240 | RTM_CHANGE. | |
241 | As such, only the super-user may modify | |
242 | the routing tables. | |
243 | .Pp | |
244 | If the | |
245 | .Cm flush | |
246 | command is specified, | |
247 | .Nm route | |
248 | will ``flush'' the routing tables of all gateway entries. | |
249 | One can choose to flush only those routes whose destinations | |
250 | are of a given address family, by specifying an optional keyword | |
251 | describing which address family. | |
252 | .Sh DIAGNOSTICS | |
253 | .Bl -tag -width Ds | |
254 | .It Sy "add [host \&| network ] %s: gateway %s flags %x" | |
255 | The specified route is being added to the tables. The | |
256 | values printed are from the routing table entry supplied | |
257 | in the | |
258 | .Xr ioctl 2 | |
259 | call. | |
260 | If the gateway address used was not the primary address of the gateway | |
261 | (the first one returned by | |
262 | .Xr gethostbyname 3 ) , | |
263 | the gateway address is printed numerically as well as symbolically. | |
264 | .It Sy "delete [ host &| network ] %s: gateway %s flags %x" | |
265 | As above, but when deleting an entry. | |
266 | .It Sy "%s %s done" | |
267 | When the | |
268 | .Cm flush | |
269 | command is specified, each routing table entry deleted | |
270 | is indicated with a message of this form. | |
271 | .It Sy "Network is unreachable" | |
272 | An attempt to add a route failed because the gateway listed was not | |
273 | on a directly-connected network. | |
274 | The next-hop gateway must be given. | |
275 | .It Sy "not in table" | |
276 | A delete operation was attempted for an entry which | |
277 | wasn't present in the tables. | |
278 | .It Sy "routing table overflow" | |
279 | An add operation was attempted, but the system was | |
280 | low on resources and was unable to allocate memory | |
281 | to create the new entry. | |
282 | .El | |
283 | .Sh SEE ALSO | |
284 | .Xr netintro 4 , | |
285 | .Xr route 4 , | |
286 | .Xr esis 4 , | |
287 | .Xr routed 8 , | |
288 | .Xr XNSrouted 8 | |
289 | .Sh HISTORY | |
290 | The | |
291 | .Nm | |
292 | command appeared in | |
293 | .Bx 4.2 . | |
294 | .Sh BUGS | |
295 | The first paragraph may have slightly exaggerated | |
296 | .Xr routed Ns 's | |
297 | abilities. |