OSDN Git Service

Import translated manuals from JM CVS Repository.
[linuxjm/jm.git] / manual / net-tools / original / man8 / route.8
1 .TH ROUTE 8 "2 January 2000" "net-tools" "Linux Programmer's Manual"
2 .SH NAME
3 route \- show / manipulate the IP routing table
4 .SH SYNOPSIS
5 .B route
6 .RB [ \-CFvnee ]
7 .TP
8 .B route 
9 .RB [ \-v ]
10 .RB [ \-A
11 family] 
12 .B add 
13 .RB [ \-net | \-host ] 
14 target 
15 .RB [ netmask 
16 Nm] 
17 .RB [ gw 
18 Gw] 
19 .RB [ metric 
20 N] 
21 .RB [ mss 
22 M] 
23 .RB [ window 
24 W] 
25 .RB [ irtt 
26 I]
27 .RB [ reject ]
28 .RB [ mod ]
29 .RB [ dyn ] 
30 .RB [ reinstate ] 
31 .RB [[ dev ] 
32 If]
33 .TP
34 .B route 
35 .RB [ \-v ] 
36 .RB [ \-A
37 family]
38 .B del 
39 .RB [ \-net | \-host ] 
40 target 
41 .RB [ gw 
42 Gw] 
43 .RB [ netmask 
44 Nm] 
45 .RB [ metric 
46 N] 
47 .RB [[ dev ]
48 If]
49 .TP
50 .B route 
51 .RB [ \-V ] 
52 .RB [ \-\-version ]
53 .RB [ \-h ]
54 .RB [ \--help ]
55 .SH DESCRIPTION
56 .B Route
57 manipulates the kernel's IP routing tables.  Its primary use is to set
58 up static routes to specific hosts or networks via an interface after
59 it has been configured with the
60 .BR ifconfig (8)
61 program.
62
63 When the
64 .B add
65 or
66 .B del
67 options are used,
68 .B route
69 modifies the routing tables.  Without these options,
70 .B route
71 displays the current contents of the routing tables.
72
73 .SH OPTIONS
74 .TP
75 .B \-A family
76 use the specified address family (eg `inet'; use `route --help' for a full 
77 list).
78
79 .TP 
80 .B -F
81 operate on the kernel's FIB (Forwarding Information Base) routing
82 table. 
83 This is the default.
84 .TP 
85 .B -C
86 operate on the kernel's routing cache.
87
88 .TP
89 .B \-v
90 select verbose operation.
91 .TP
92 .B \-n
93 show numerical addresses instead of trying to determine symbolic host
94 names. This is useful if you are trying to determine why the route to your
95 nameserver has vanished.
96 .TP
97 .B \-e
98 use
99 .BR netstat (8)-format
100 for displaying the routing table.
101 .B \-ee 
102 will generate a very long line with all parameters from the routing table.
103
104 .TP
105 .B del
106 delete a route.
107 .TP 
108 .B add 
109 add a new route.
110 .TP
111 .B target
112 the destination network or host. You can provide IP addresses in dotted
113 decimal or host/network names.
114 .TP
115 .B \-net
116 the
117 .B target
118 is a network.
119 .TP
120 .B -host
121 the
122 .B target 
123 is a host.
124 .TP
125 .B netmask NM
126 when adding a network route, the netmask to be used.
127 .TP
128 .B gw GW
129 route packets via a gateway.
130 .B NOTE:
131 The specified gateway must be reachable first. This usually means that
132 you have to set up a static route to the gateway beforehand. If you specify
133 the address of one of your local interfaces, it will be used to decide about
134 the interface to which the packets should be routed to. This is a BSDism
135 compatibility hack.
136 .TP
137 .B metric M
138 set the metric field in the routing table (used by routing daemons) to M.
139 .TP 
140 .B mss M
141 set the TCP Maximum Segment Size (MSS) for connections over this route
142 to M bytes. 
143 The default is the device MTU minus headers, or a lower MTU when path mtu 
144 discovery occured. This setting can be used to force smaller TCP packets on the
145 other end when path mtu discovery does not work (usually because of
146 misconfigured firewalls that block ICMP Fragmentation Needed)
147 .TP 
148 .B window W 
149 set the TCP window size for connections over this route to W
150 bytes. This is typically only used on AX.25 networks and with drivers
151 unable to handle back to back frames.
152 .TP
153 .B irtt I
154 set the initial round trip time (irtt) for TCP connections over this
155 route to I milliseconds (1-12000). This is typically only used on
156 AX.25 networks. If omitted the RFC 1122 default of 300ms is used.
157 .TP
158 .B reject
159 install a blocking route, which will force a route lookup to fail.
160 This is for example used to mask out networks before using the default
161 route.  This is NOT for firewalling.
162 .TP
163 .B mod, dyn, reinstate
164 install a dynamic or modified route. These flags are for diagnostic
165 purposes, and are generally only set by routing daemons.
166 .TP
167 .B dev If
168 force the route to be associated with the specified device, as the
169 kernel will otherwise try to determine the device on its own (by
170 checking already existing routes and device specifications, and where
171 the route is added to). In most normal networks you won't need this.
172
173 If 
174 .B dev If
175 is the last option on the command line, the word 
176 .B dev
177 may be omitted, as it's the default. Otherwise the order of the route
178 modifiers (metric - netmask - gw - dev) doesn't matter.
179
180 .SH EXAMPLES
181 .TP
182 .B route add -net 127.0.0.0
183 adds the normal loopback entry, using netmask 255.0.0.0 (class A net,
184 determined from the destination address) and associated with the 
185 "lo" device (assuming this device was prviously set up correctly with
186 .BR ifconfig (8)). 
187
188 .TP 
189 .B route add -net 192.56.76.0 netmask 255.255.255.0 dev eth0
190 adds a route to the network 192.56.76.x via 
191 "eth0". The Class C netmask modifier is not really necessary here because
192 192.* is a Class C IP address. The word "dev" can be omitted here. 
193
194 .TP
195 .B route add default gw mango-gw
196 adds a default route (which will be used if no other route matches).
197 All packets using this route will be gatewayed through "mango-gw". The
198 device which will actually be used for that route depends on how we
199 can reach "mango-gw" - the static route to "mango-gw" will have to be
200 set up before. 
201
202 .TP
203 .B route add ipx4 sl0
204 Adds the route to the "ipx4" host via the SLIP interface (assuming that
205 "ipx4" is the SLIP host).
206
207 .TP
208 .B route add -net 192.57.66.0 netmask 255.255.255.0 gw ipx4
209 This command adds the net "192.57.66.x" to be gatewayed through the former
210 route to the SLIP interface.
211
212 .TP
213 .B route add -net 224.0.0.0 netmask 240.0.0.0 dev eth0
214 This is an obscure one documented so people know how to do it. This sets
215 all of the class D (multicast) IP routes to go via "eth0". This is the
216 correct normal configuration line with a multicasting kernel. 
217
218 .TP
219 .B route add -net 10.0.0.0 netmask 255.0.0.0 reject
220 This installs a rejecting route for the private network "10.x.x.x."
221
222 .LP
223 .SH OUTPUT
224 The output of the kernel routing table is organized in the following columns
225 .TP
226 .B Destination     
227 The destination network or destination host.
228 .TP
229 .B Gateway
230 The gateway address or '*' if none set.
231 .TP
232 .B Genmask         
233 The netmask for the destination net; '255.255.255.255' for a host destination
234 and '0.0.0.0' for the 
235 .B default
236 route.
237 .TP
238 .B Flags 
239 Possible flags include
240 .br
241 .B U
242 (route is
243 .BR up )
244 .br
245 .B H
246 (target is a
247 .BR host )
248 .br
249 .B G
250 (use
251 .BR gateway )
252 .br
253 .B R
254 .RB ( reinstate
255 route for dynamic routing)
256 .br
257 .B D
258 .RB ( dynamically
259 installed by daemon or redirect)
260 .br
261 .B M
262 .RB ( modified
263 from routing daemon or redirect)
264 .br
265 .B A
266 (installed by
267 .BR addrconf )
268 .br
269 .B C
270 .RB ( cache
271 entry)
272 .br
273 .B !
274 .RB ( reject
275 route)
276 .TP
277 .B Metric 
278 The 'distance' to the target (usually counted in hops). It is not used by
279 recent kernels, but may be needed by routing daemons.
280 .TP
281 .B Ref    
282 Number of references to this route. (Not used in the Linux kernel.)
283 .TP
284 .B Use
285 Count of lookups for the route.  Depending on the use of -F and -C this will
286 be either route cache misses (-F) or hits (-C).
287 .TP
288 .B Iface
289 Interface to which packets for this route will be sent.
290 .TP
291 .B MSS 
292 Default maximum segement size for TCP connections over this route.
293 .TP
294 .B Window  
295 Default window size for TCP connections over this route.
296 .TP
297 .B irtt
298 Initial RTT (Round Trip Time). The kernel uses this to guess about the best
299 TCP protocol parameters without waiting on (possibly slow) answers.
300 .TP
301 .B HH (cached only)
302 The number of ARP entries and cached routes that refer to the hardware
303 header cache for the cached route. This will be \-1 if a hardware
304 address is not needed for the interface of the cached route (e.g. lo).
305 .TP
306 .B Arp (cached only)
307 Whether or not the hardware address for the cached route is up to date.
308 .LP
309 .SH FILES
310 .I /proc/net/ipv6_route
311 .br
312 .I /proc/net/route
313 .br
314 .I /proc/net/rt_cache
315 .LP
316 .SH SEE ALSO
317 .I ifconfig(8), netstat(8), arp(8), rarp(8)
318 .LP
319 .SH HISTORY
320 .B Route
321 for Linux was originally written by Fred N.  van Kempen,
322 <waltje@uwalt.nl.mugnet.org> and then modified by Johannes Stille and
323 Linus Torvalds for pl15. Alan Cox added the mss and window options for
324 Linux 1.1.22. irtt support and merged with netstat from Bernd Eckenfels.
325 .SH AUTHOR
326 Currently maintained by Phil Blundell <Philip.Blundell@pobox.com>.