version 1 showing authors affecting page license.
.
Rev |
Author |
# |
Line |
1 |
perry |
1 |
ROUTE |
|
|
2 |
!!!ROUTE |
|
|
3 |
NAME |
|
|
4 |
SYNOPSIS |
|
|
5 |
DESCRIPTION |
|
|
6 |
OPTIONS |
|
|
7 |
EXAMPLES |
|
|
8 |
OUTPUT |
|
|
9 |
FILES |
|
|
10 |
SEE ALSO |
|
|
11 |
HISTORY |
|
|
12 |
AUTHOR |
|
|
13 |
---- |
|
|
14 |
!!NAME |
|
|
15 |
|
|
|
16 |
|
|
|
17 |
route - show / manipulate the IP routing table |
|
|
18 |
!!SYNOPSIS |
|
|
19 |
|
|
|
20 |
|
|
|
21 |
__route__ [[__-CFvnee__] |
|
|
22 |
|
|
|
23 |
|
|
|
24 |
__route__ |
|
|
25 |
|
|
|
26 |
|
|
|
27 |
[[__-v__] [[__-A__ family] __add__ |
|
|
28 |
[[__-net__|__-host__] target [[__netmask__ Nm] |
|
|
29 |
[[__gw__ Gw] [[__metric__ N] [[__mss__ M] |
|
|
30 |
[[__window__ W] [[__irtt__ I] [[__reject__] |
|
|
31 |
[[__mod__] [[__dyn__] [[__reinstate__] [[[[__dev__] |
|
|
32 |
If] |
|
|
33 |
|
|
|
34 |
|
|
|
35 |
__route__ |
|
|
36 |
|
|
|
37 |
|
|
|
38 |
[[__-v__] [[__-A__ family] __del__ |
|
|
39 |
[[__-net__|__-host__] target [[__gw__ Gw] |
|
|
40 |
[[__netmask__ Nm] [[__metric__ N] [[[[__dev__] |
|
|
41 |
If] |
|
|
42 |
|
|
|
43 |
|
|
|
44 |
__route__ |
|
|
45 |
|
|
|
46 |
|
|
|
47 |
[[__-V__] [[__--version__] [[__-h__] |
|
|
48 |
[[__--help__] |
|
|
49 |
!!DESCRIPTION |
|
|
50 |
|
|
|
51 |
|
|
|
52 |
__Route__ manipulates the kernel's IP routing tables. Its |
|
|
53 |
primary use is to set up static routes to specific hosts or |
|
|
54 |
networks via an interface after it has been configured with |
|
|
55 |
the ifconfig(8) program. |
|
|
56 |
|
|
|
57 |
|
|
|
58 |
When the __add__ or __del__ options are used, |
|
|
59 |
__route__ modifies the routing tables. Without these |
|
|
60 |
options, __route__ displays the current contents of the |
|
|
61 |
routing tables. |
|
|
62 |
!!OPTIONS |
|
|
63 |
|
|
|
64 |
|
|
|
65 |
__-A family__ |
|
|
66 |
|
|
|
67 |
|
|
|
68 |
use the specified address family (eg `inet'; use `route |
|
|
69 |
--help' for a full list). |
|
|
70 |
|
|
|
71 |
|
|
|
72 |
__-F__ |
|
|
73 |
|
|
|
74 |
|
|
|
75 |
operate on the kernel's FIB (Forwarding Information Base) |
|
|
76 |
routing table. This is the default. |
|
|
77 |
|
|
|
78 |
|
|
|
79 |
__-C__ |
|
|
80 |
|
|
|
81 |
|
|
|
82 |
operate on the kernel's routing cache. |
|
|
83 |
|
|
|
84 |
|
|
|
85 |
__-v__ |
|
|
86 |
|
|
|
87 |
|
|
|
88 |
select verbose operation. |
|
|
89 |
|
|
|
90 |
|
|
|
91 |
__-n__ |
|
|
92 |
|
|
|
93 |
|
|
|
94 |
show numerical addresses instead of trying to determine |
|
|
95 |
symbolic host names. This is useful if you are trying to |
|
|
96 |
determine why the route to your nameserver has |
|
|
97 |
vanished. |
|
|
98 |
|
|
|
99 |
|
|
|
100 |
__-e__ |
|
|
101 |
|
|
|
102 |
|
|
|
103 |
use netstat(8)-format for displaying the routing |
|
|
104 |
table. __-ee__ will generate a very long line with all |
|
|
105 |
parameters from the routing table. |
|
|
106 |
|
|
|
107 |
|
|
|
108 |
__del__ |
|
|
109 |
|
|
|
110 |
|
|
|
111 |
delete a route. |
|
|
112 |
|
|
|
113 |
|
|
|
114 |
__add__ |
|
|
115 |
|
|
|
116 |
|
|
|
117 |
add a new route. |
|
|
118 |
|
|
|
119 |
|
|
|
120 |
__target__ |
|
|
121 |
|
|
|
122 |
|
|
|
123 |
the destination network or host. You can provide IP |
|
|
124 |
addresses in dotted decimal or host/network |
|
|
125 |
names. |
|
|
126 |
|
|
|
127 |
|
|
|
128 |
__-net__ |
|
|
129 |
|
|
|
130 |
|
|
|
131 |
the __target__ is a network. |
|
|
132 |
|
|
|
133 |
|
|
|
134 |
__-host__ |
|
|
135 |
|
|
|
136 |
|
|
|
137 |
the __target__ is a host. |
|
|
138 |
|
|
|
139 |
|
|
|
140 |
__netmask NM__ |
|
|
141 |
|
|
|
142 |
|
|
|
143 |
when adding a network route, the netmask to be |
|
|
144 |
used. |
|
|
145 |
|
|
|
146 |
|
|
|
147 |
__gw GW__ |
|
|
148 |
|
|
|
149 |
|
|
|
150 |
route packets via a gateway. __NOTE:__ The specified |
|
|
151 |
gateway must be reachable first. This usually means that you |
|
|
152 |
have to set up a static route to the gateway beforehand. If |
|
|
153 |
you specify the address of one of your local interfaces, it |
|
|
154 |
will be used to decide about the interface to which the |
|
|
155 |
packets should be routed to. This is a BSDism compatibility |
|
|
156 |
hack. |
|
|
157 |
|
|
|
158 |
|
|
|
159 |
__metric M__ |
|
|
160 |
|
|
|
161 |
|
|
|
162 |
set the metric field in the routing table (used by routing |
|
|
163 |
daemons) to M. |
|
|
164 |
|
|
|
165 |
|
|
|
166 |
__mss M__ |
|
|
167 |
|
|
|
168 |
|
|
|
169 |
set the TCP Maximum Segment Size (MSS) for connections over |
|
|
170 |
this route to M bytes. The default is the device MTU minus |
|
|
171 |
headers, or a lower MTU when path mtu discovery occured. |
|
|
172 |
This setting can be used to force smaller TCP packets on the |
|
|
173 |
other end when path mtu discovery does not work (usually |
|
|
174 |
because of misconfigured firewalls that block ICMP |
|
|
175 |
Fragmentation Needed) |
|
|
176 |
|
|
|
177 |
|
|
|
178 |
__window W__ |
|
|
179 |
|
|
|
180 |
|
|
|
181 |
set the TCP window size for connections over this route to W |
|
|
182 |
bytes. This is typically only used on AX.25 networks and |
|
|
183 |
with drivers unable to handle back to back |
|
|
184 |
frames. |
|
|
185 |
|
|
|
186 |
|
|
|
187 |
__irtt I__ |
|
|
188 |
|
|
|
189 |
|
|
|
190 |
set the initial round trip time (irtt) for TCP connections |
|
|
191 |
over this route to I milliseconds (1-12000). This is |
|
|
192 |
typically only used on AX.25 networks. If omitted the RFC |
|
|
193 |
1122 default of 300ms is used. |
|
|
194 |
|
|
|
195 |
|
|
|
196 |
__reject__ |
|
|
197 |
|
|
|
198 |
|
|
|
199 |
install a blocking route, which will force a route lookup to |
|
|
200 |
fail. This is for example used to mask out networks before |
|
|
201 |
using the default route. This is NOT for |
|
|
202 |
firewalling. |
|
|
203 |
|
|
|
204 |
|
|
|
205 |
__mod, dyn, reinstate__ |
|
|
206 |
|
|
|
207 |
|
|
|
208 |
install a dynamic or modified route. These flags are for |
|
|
209 |
diagnostic purposes, and are generally only set by routing |
|
|
210 |
daemons. |
|
|
211 |
|
|
|
212 |
|
|
|
213 |
__dev If__ |
|
|
214 |
|
|
|
215 |
|
|
|
216 |
force the route to be associated with the specified device, |
|
|
217 |
as the kernel will otherwise try to determine the device on |
|
|
218 |
its own (by checking already existing routes and device |
|
|
219 |
specifications, and where the route is added to). In most |
|
|
220 |
normal networks you won't need this. |
|
|
221 |
|
|
|
222 |
|
|
|
223 |
If __dev If__ is the last option on the command line, the |
|
|
224 |
word __dev__ may be omitted, as it's the default. |
|
|
225 |
Otherwise the order of the route modifiers (metric - netmask |
|
|
226 |
- gw - dev) doesn't matter. |
|
|
227 |
!!EXAMPLES |
|
|
228 |
|
|
|
229 |
|
|
|
230 |
__route add -net 127.0.0.0__ |
|
|
231 |
|
|
|
232 |
|
|
|
233 |
adds the normal loopback entry, using netmask 255.0.0.0 |
|
|
234 |
(class A net, determined from the destination address) and |
|
|
235 |
associated with the |
|
|
236 |
ifconfig__(8)). |
|
|
237 |
|
|
|
238 |
|
|
|
239 |
__route add -net 192.56.76.0 netmask 255.255.255.0 dev |
|
|
240 |
eth0__ |
|
|
241 |
|
|
|
242 |
|
|
|
243 |
adds a route to the network 192.56.76.x via |
|
|
244 |
|
|
|
245 |
|
|
|
246 |
__route add default gw mango-gw__ |
|
|
247 |
|
|
|
248 |
|
|
|
249 |
adds a default route (which will be used if no other route |
|
|
250 |
matches). All packets using this route will be gatewayed |
|
|
251 |
through |
|
|
252 |
|
|
|
253 |
|
|
|
254 |
__route add ipx4 sl0__ |
|
|
255 |
|
|
|
256 |
|
|
|
257 |
Adds the route to the |
|
|
258 |
|
|
|
259 |
|
|
|
260 |
__route add -net 192.57.66.0 netmask 255.255.255.0 gw |
|
|
261 |
ipx4__ |
|
|
262 |
|
|
|
263 |
|
|
|
264 |
This command adds the net |
|
|
265 |
|
|
|
266 |
|
|
|
267 |
__route add -net 224.0.0.0 netmask 240.0.0.0 dev |
|
|
268 |
eth0__ |
|
|
269 |
|
|
|
270 |
|
|
|
271 |
This is an obscure one documented so people know how to do |
|
|
272 |
it. This sets all of the class D (multicast) IP routes to go |
|
|
273 |
via |
|
|
274 |
|
|
|
275 |
|
|
|
276 |
__route add -net 10.0.0.0 netmask 255.0.0.0 |
|
|
277 |
reject__ |
|
|
278 |
|
|
|
279 |
|
|
|
280 |
This installs a rejecting route for the private network |
|
|
281 |
!!OUTPUT |
|
|
282 |
|
|
|
283 |
|
|
|
284 |
The output of the kernel routing table is organized in the |
|
|
285 |
following columns |
|
|
286 |
|
|
|
287 |
|
|
|
288 |
__Destination__ |
|
|
289 |
|
|
|
290 |
|
|
|
291 |
The destination network or destination host. |
|
|
292 |
|
|
|
293 |
|
|
|
294 |
__Gateway__ |
|
|
295 |
|
|
|
296 |
|
|
|
297 |
The gateway address or '*' if none set. |
|
|
298 |
|
|
|
299 |
|
|
|
300 |
__Genmask__ |
|
|
301 |
|
|
|
302 |
|
|
|
303 |
The netmask for the destination net; '255.255.255.255' for a |
|
|
304 |
host destination and '0.0.0.0' for the __default__ |
|
|
305 |
route. |
|
|
306 |
|
|
|
307 |
|
|
|
308 |
__Flags__ |
|
|
309 |
|
|
|
310 |
|
|
|
311 |
Possible flags include__ |
|
|
312 |
U__ (route is __up__)__ |
|
|
313 |
H__ (target is a __host__)__ |
|
|
314 |
G__ (use __gateway__)__ |
|
|
315 |
R__ (__reinstate__ route for dynamic routing)__ |
|
|
316 |
D__ (__dynamically__ installed by daemon or |
|
|
317 |
redirect)__ |
|
|
318 |
M__ (__modified__ from routing daemon or |
|
|
319 |
redirect)__ |
|
|
320 |
A__ (installed by __addrconf__)__ |
|
|
321 |
C__ (__cache__ entry)__ |
|
|
322 |
!__ (__reject__ route) |
|
|
323 |
|
|
|
324 |
|
|
|
325 |
__Metric__ |
|
|
326 |
|
|
|
327 |
|
|
|
328 |
The 'distance' to the target (usually counted in hops). It |
|
|
329 |
is not used by recent kernels, but may be needed by routing |
|
|
330 |
daemons. |
|
|
331 |
|
|
|
332 |
|
|
|
333 |
__Ref__ |
|
|
334 |
|
|
|
335 |
|
|
|
336 |
Number of references to this route. (Not used in the Linux |
|
|
337 |
kernel.) |
|
|
338 |
|
|
|
339 |
|
|
|
340 |
__Use__ |
|
|
341 |
|
|
|
342 |
|
|
|
343 |
Count of lookups for the route. Depending on the use of -F |
|
|
344 |
and -C this will be either route cache misses (-F) or hits |
|
|
345 |
(-C). |
|
|
346 |
|
|
|
347 |
|
|
|
348 |
__Iface__ |
|
|
349 |
|
|
|
350 |
|
|
|
351 |
Interface to which packets for this route will be |
|
|
352 |
sent. |
|
|
353 |
|
|
|
354 |
|
|
|
355 |
__MSS__ |
|
|
356 |
|
|
|
357 |
|
|
|
358 |
Default maximum segement size for TCP connections over this |
|
|
359 |
route. |
|
|
360 |
|
|
|
361 |
|
|
|
362 |
__Window__ |
|
|
363 |
|
|
|
364 |
|
|
|
365 |
Default window size for TCP connections over this |
|
|
366 |
route. |
|
|
367 |
|
|
|
368 |
|
|
|
369 |
__irtt__ |
|
|
370 |
|
|
|
371 |
|
|
|
372 |
Initial RTT (Round Trip Time). The kernel uses this to guess |
|
|
373 |
about the best TCP protocol parameters without waiting on |
|
|
374 |
(possibly slow) answers. |
|
|
375 |
|
|
|
376 |
|
|
|
377 |
__HH (cached only)__ |
|
|
378 |
|
|
|
379 |
|
|
|
380 |
The number of ARP entries and cached routes that refer to |
|
|
381 |
the hardware header cache for the cached route. This will be |
|
|
382 |
-1 if a hardware address is not needed for the interface of |
|
|
383 |
the cached route (e.g. lo). |
|
|
384 |
|
|
|
385 |
|
|
|
386 |
__Arp (cached only)__ |
|
|
387 |
|
|
|
388 |
|
|
|
389 |
Whether or not the hardware address for the cached route is |
|
|
390 |
up to date. |
|
|
391 |
!!FILES |
|
|
392 |
|
|
|
393 |
|
|
|
394 |
''/proc/net/ipv6_route |
|
|
395 |
/proc/net/route |
|
|
396 |
/proc/net/rt_cache'' |
|
|
397 |
!!SEE ALSO |
|
|
398 |
|
|
|
399 |
|
|
|
400 |
''ifconfig(8), netstat(8), arp(8), rarp(8)'' |
|
|
401 |
!!HISTORY |
|
|
402 |
|
|
|
403 |
|
|
|
404 |
__Route__ for Linux was originally written by Fred N. van |
|
|
405 |
Kempen, |
|
|
406 |
__ |
|
|
407 |
!!AUTHOR |
|
|
408 |
|
|
|
409 |
|
|
|
410 |
Currently maintained by Phil Blundell |
|
|
411 |
---- |