Commit | Line | Data |
---|---|---|
2944ec97 KB |
1 | .\" Copyright (c) 1983 The Regents of the University of California. |
2 | .\" All rights reserved. | |
0e56e94a | 3 | .\" |
2944ec97 KB |
4 | .\" Redistribution and use in source and binary forms are permitted |
5 | .\" provided that the above copyright notice and this paragraph are | |
6 | .\" duplicated in all such forms and that any documentation, | |
7 | .\" advertising materials, and other materials related to such | |
8 | .\" distribution and use acknowledge that the software was developed | |
9 | .\" by the University of California, Berkeley. The name of the | |
10 | .\" University may not be used to endorse or promote products derived | |
11 | .\" from this software without specific prior written permission. | |
12 | .\" THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR | |
13 | .\" IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED | |
14 | .\" WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. | |
0e56e94a | 15 | .\" |
1d339c5b | 16 | .\" @(#)route.8 6.7 (Berkeley) %G% |
2944ec97 KB |
17 | .\" |
18 | .TH ROUTE 8 "" | |
0e56e94a KM |
19 | .UC 5 |
20 | .SH NAME | |
7d5f817b | 21 | route \- manually manipulate the routing tables (Interim) |
0e56e94a KM |
22 | .SH SYNOPSIS |
23 | .B /etc/route | |
24 | [ | |
dfc5a452 MK |
25 | .B \-n |
26 | ] [ | |
7d5f817b KS |
27 | .B \-q |
28 | ] [ | |
31bd2db6 | 29 | .B \-v |
31bd2db6 KS |
30 | ] |
31 | .I command | |
32 | [ [ | |
33 | .I modifiers | |
34 | ] | |
35 | .I args | |
0e56e94a KM |
36 | ] |
37 | .SH DESCRIPTION | |
38 | .I Route | |
39 | is a program used to manually manipulate the network | |
40 | routing tables. It normally is not needed, as the | |
41 | system routing table management daemon, | |
42 | .IR routed (8C), | |
43 | should tend to this task. | |
44 | .PP | |
45 | .I Route | |
31bd2db6 | 46 | accepts five commands: |
0e56e94a | 47 | .IR add , |
7d5f817b | 48 | to add a route, |
31bd2db6 KS |
49 | .IR flush , |
50 | to remove all routes, | |
0e56e94a | 51 | .IR delete , |
31bd2db6 KS |
52 | to delete a specific route, |
53 | .IR change , | |
54 | to changes aspects of a route (such as its gateway), | |
55 | and | |
7d5f817b KS |
56 | .IR monitor , |
57 | to report any changes to the routing information base, | |
58 | routing lookup misses, or suspected network partionings. | |
59 | .PP | |
60 | The monitor command has the syntax | |
61 | .ti +0.25i | |
31bd2db6 | 62 | .B route |
7d5f817b | 63 | [ |
1b698439 KS |
64 | .B -n |
65 | ] | |
66 | .B monitor | |
67 | .PP | |
68 | The flush command has the syntax | |
69 | .ti +0.25i | |
70 | .B route | |
71 | [ | |
72 | .B -n | |
7d5f817b | 73 | ] |
1b698439 KS |
74 | [ |
75 | .B -n | |
76 | ] | |
77 | .B flush | |
78 | [ | |
79 | .I family | |
80 | ] | |
81 | .PP | |
82 | where the address family may be specified by any of the | |
83 | .BR -osi , | |
84 | .BR -xns , | |
85 | or | |
86 | .B -inet | |
87 | keywords. | |
0e56e94a | 88 | .PP |
7d5f817b | 89 | The other commands have the following syntax: |
0e56e94a | 90 | .PP |
dfc5a452 | 91 | .ti +0.25i |
31bd2db6 | 92 | .B route |
7d5f817b | 93 | [ |
31bd2db6 | 94 | .I -n |
7d5f817b | 95 | ] |
0e56e94a | 96 | .I command |
0e56e94a | 97 | [ |
31bd2db6 | 98 | .B -net |
dfc5a452 | 99 | | |
31bd2db6 | 100 | .B -host |
dfc5a452 MK |
101 | ] |
102 | .I destination gateway | |
0e56e94a KM |
103 | .PP |
104 | where | |
105 | .I destination | |
dfc5a452 | 106 | is the destination host or network, |
0e56e94a | 107 | .I gateway |
7d5f817b | 108 | is the next-hop gateway to which packets should be addressed. |
0e56e94a KM |
109 | Routes to a particular host are distinguished from those to |
110 | a network by interpreting the Internet address associated with | |
111 | .IR destination . | |
dfc5a452 | 112 | The optional keywords |
31bd2db6 | 113 | .B -net |
dfc5a452 | 114 | and |
31bd2db6 | 115 | .B -host |
dfc5a452 MK |
116 | force the destination to be interpreted as a network or a host, respectively. |
117 | Otherwise, if the | |
118 | .I destination | |
119 | has a ``local address part'' of INADDR_ANY, | |
120 | or if the | |
0e56e94a | 121 | .I destination |
dfc5a452 | 122 | is the symbolic name of a network, then the route is |
0e56e94a | 123 | assumed to be to a network; otherwise, it is presumed to be a |
1b698439 KS |
124 | route to a host. |
125 | .PP | |
126 | For example, | |
127 | 128.32 is interpreted as | |
128 | .I -host | |
129 | 128.0.0.32, | |
130 | 128.32.130 is interpreted as | |
131 | .I -host | |
132 | 128.32.0.130; | |
133 | .I -net 128.32 | |
134 | is interpreted as | |
135 | 128.32.0.0, | |
136 | and | |
137 | .I -net 128.32.130 | |
138 | is interpreted as | |
139 | 128.32.130.0. | |
140 | .PP | |
141 | If the route is via an interface rather than | |
0e56e94a | 142 | via a gateway, the |
31bd2db6 KS |
143 | .I -interface |
144 | modifier should be specified; | |
7d5f817b KS |
145 | the gateway given is the address of this host on the common network, |
146 | indicating the interface to be used for transmission. | |
147 | .PP | |
31bd2db6 KS |
148 | The optional modifiers |
149 | .I -xns, | |
7d5f817b | 150 | and |
31bd2db6 KS |
151 | .I -osi |
152 | specify that all subsequent addresses are in the XNS or OSI address families, | |
7d5f817b KS |
153 | and the names must be numeric specifications rather than |
154 | symbolic names. | |
1d339c5b KS |
155 | .PP |
156 | The optional | |
1b698439 | 157 | .I -netmask |
1d339c5b KS |
158 | qualifier is intended |
159 | to acheieve the effect of an OSI ESIS redirect with the netmask option. | |
160 | One specifies an additional ensuing address parameter | |
161 | (to be interpreted as a network mask). | |
1b698439 KS |
162 | One can override the implicit network mask generated in the inet case |
163 | by making sure this option follows the destination parameter. | |
164 | .PP | |
165 | The optional modifiers | |
166 | .IR -rtt , | |
167 | .IR -rttvar , | |
168 | .IR -sendpipe , | |
169 | .IR -recvpipe , | |
170 | .IR -mtu , | |
171 | .IR -hopcount , | |
172 | .IR -expire , | |
173 | and | |
174 | .I -ssthresh | |
175 | provide initial values to metrics maintained in the routing entry. | |
176 | These may be individually locked by preceding each such modifier to | |
177 | be locked by | |
178 | the | |
179 | .I -lock | |
180 | meta-modifier, or one can | |
181 | specify that all ensuing metrics may be locked by the | |
182 | .I -lockrest | |
183 | meta-modifier. | |
7d5f817b KS |
184 | .PP |
185 | All symbolic names specified for a | |
0e56e94a KM |
186 | .I destination |
187 | or | |
188 | .I gateway | |
dfc5a452 MK |
189 | are looked up first as a host name using |
190 | .IR gethostbyname (3N). | |
191 | If this lookup fails, | |
192 | .IR getnetbyname (3N) | |
193 | is then used to interpret the name as that of a network. | |
0e56e94a KM |
194 | .PP |
195 | .I Route | |
7d5f817b | 196 | uses a routing socket and the new message types |
1b698439 | 197 | RTM_ADD, RTM_DELETE, and RTM_CHANGE. |
7d5f817b | 198 | As such, only the super-user may modify |
0e56e94a KM |
199 | the routing tables. |
200 | .PP | |
201 | If the | |
31bd2db6 KS |
202 | .B flush |
203 | command is specified, | |
0e56e94a KM |
204 | .I route |
205 | will ``flush'' the routing tables of all gateway entries. | |
1d339c5b KS |
206 | One can choose to flush only those routes whose destinations |
207 | are of a given address family, by specifying an optional keyword | |
208 | describing which address family. | |
dfc5a452 MK |
209 | .PP |
210 | The | |
211 | .B \-n | |
212 | option prevents attempts to print host and network names symbolically | |
213 | when reporting actions. | |
1b698439 KS |
214 | The |
215 | .B \-v | |
216 | option causes additional details to be printed. | |
217 | The | |
218 | .B \-q | |
219 | option supresses all output. | |
0e56e94a | 220 | .SH DIAGNOSTICS |
dfc5a452 | 221 | ``\fBadd [ host | network ] %s: gateway %s flags %x\fP'' |
0e56e94a KM |
222 | .br |
223 | The specified route is being added to the tables. The | |
224 | values printed are from the routing table entry supplied | |
225 | in the | |
226 | .I ioctl | |
227 | call. | |
dfc5a452 MK |
228 | If the gateway address used was not the primary address of the gateway |
229 | (the first one returned by | |
230 | .IR gethostbyname ), | |
231 | the gateway address is printed numerically as well as symbolically. | |
0e56e94a | 232 | .PP |
dfc5a452 | 233 | ``\fBdelete [ host | network ] %s: gateway %s flags %x\fP'' |
0e56e94a KM |
234 | .br |
235 | As above, but when deleting an entry. | |
236 | .PP | |
dfc5a452 | 237 | ``\fB%s %s done\fP'' |
0e56e94a KM |
238 | .br |
239 | When the | |
240 | .B \-f | |
241 | flag is specified, each routing table entry deleted | |
242 | is indicated with a message of this form. | |
243 | .PP | |
dfc5a452 MK |
244 | ``\fBNetwork is unreachable\fP'' |
245 | .br | |
246 | An attempt to add a route failed because the gateway listed was not | |
247 | on a directly-connected network. | |
248 | The next-hop gateway must be given. | |
249 | .PP | |
250 | ``\fBnot in table\fP'' | |
0e56e94a KM |
251 | .br |
252 | A delete operation was attempted for an entry which | |
253 | wasn't present in the tables. | |
254 | .PP | |
dfc5a452 | 255 | ``\fBrouting table overflow\fP'' |
0e56e94a KM |
256 | .br |
257 | An add operation was attempted, but the system was | |
258 | low on resources and was unable to allocate memory | |
259 | to create the new entry. | |
260 | .SH "SEE ALSO" | |
2944ec97 | 261 | netintro(4), routed(8), XNSrouted(8) |