add nsellength processing for GOSIP, default 1;
[unix-history] / usr / src / sbin / route / route.8
CommitLineData
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 21route \- 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
39is a program used to manually manipulate the network
40routing tables. It normally is not needed, as the
41system routing table management daemon,
42.IR routed (8C),
43should tend to this task.
44.PP
45.I Route
31bd2db6 46accepts five commands:
0e56e94a 47.IR add ,
7d5f817b 48to add a route,
31bd2db6
KS
49.IR flush ,
50to remove all routes,
0e56e94a 51.IR delete ,
31bd2db6
KS
52to delete a specific route,
53.IR change ,
54to changes aspects of a route (such as its gateway),
55and
7d5f817b
KS
56.IR monitor ,
57to report any changes to the routing information base,
58routing lookup misses, or suspected network partionings.
59.PP
60The 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
68The 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
82where the address family may be specified by any of the
83.BR -osi ,
84.BR -xns ,
85or
86.B -inet
87keywords.
0e56e94a 88.PP
7d5f817b 89The 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
104where
105.I destination
dfc5a452 106is the destination host or network,
0e56e94a 107.I gateway
7d5f817b 108is the next-hop gateway to which packets should be addressed.
0e56e94a
KM
109Routes to a particular host are distinguished from those to
110a network by interpreting the Internet address associated with
111.IR destination .
dfc5a452 112The optional keywords
31bd2db6 113.B -net
dfc5a452 114and
31bd2db6 115.B -host
dfc5a452
MK
116force the destination to be interpreted as a network or a host, respectively.
117Otherwise, if the
118.I destination
119has a ``local address part'' of INADDR_ANY,
120or if the
0e56e94a 121.I destination
dfc5a452 122is the symbolic name of a network, then the route is
0e56e94a 123assumed to be to a network; otherwise, it is presumed to be a
1b698439
KS
124route to a host.
125.PP
126For example,
127128.32 is interpreted as
128.I -host
129128.0.0.32,
130128.32.130 is interpreted as
131.I -host
132128.32.0.130;
133.I -net 128.32
134is interpreted as
135128.32.0.0,
136and
137.I -net 128.32.130
138is interpreted as
139128.32.130.0.
140.PP
141If the route is via an interface rather than
0e56e94a 142via a gateway, the
31bd2db6
KS
143.I -interface
144modifier should be specified;
7d5f817b
KS
145the gateway given is the address of this host on the common network,
146indicating the interface to be used for transmission.
147.PP
31bd2db6
KS
148The optional modifiers
149.I -xns,
7d5f817b 150and
31bd2db6
KS
151.I -osi
152specify that all subsequent addresses are in the XNS or OSI address families,
7d5f817b
KS
153and the names must be numeric specifications rather than
154symbolic names.
1d339c5b
KS
155.PP
156The optional
1b698439 157.I -netmask
1d339c5b
KS
158qualifier is intended
159to acheieve the effect of an OSI ESIS redirect with the netmask option.
160One specifies an additional ensuing address parameter
161(to be interpreted as a network mask).
1b698439
KS
162One can override the implicit network mask generated in the inet case
163by making sure this option follows the destination parameter.
164.PP
165The optional modifiers
166.IR -rtt ,
167.IR -rttvar ,
168.IR -sendpipe ,
169.IR -recvpipe ,
170.IR -mtu ,
171.IR -hopcount ,
172.IR -expire ,
173and
174.I -ssthresh
175provide initial values to metrics maintained in the routing entry.
176These may be individually locked by preceding each such modifier to
177be locked by
178the
179.I -lock
180meta-modifier, or one can
181specify that all ensuing metrics may be locked by the
182.I -lockrest
183meta-modifier.
7d5f817b
KS
184.PP
185All symbolic names specified for a
0e56e94a
KM
186.I destination
187or
188.I gateway
dfc5a452
MK
189are looked up first as a host name using
190.IR gethostbyname (3N).
191If this lookup fails,
192.IR getnetbyname (3N)
193is then used to interpret the name as that of a network.
0e56e94a
KM
194.PP
195.I Route
7d5f817b 196uses a routing socket and the new message types
1b698439 197RTM_ADD, RTM_DELETE, and RTM_CHANGE.
7d5f817b 198As such, only the super-user may modify
0e56e94a
KM
199the routing tables.
200.PP
201If the
31bd2db6
KS
202.B flush
203command is specified,
0e56e94a
KM
204.I route
205will ``flush'' the routing tables of all gateway entries.
1d339c5b
KS
206One can choose to flush only those routes whose destinations
207are of a given address family, by specifying an optional keyword
208describing which address family.
dfc5a452
MK
209.PP
210The
211.B \-n
212option prevents attempts to print host and network names symbolically
213when reporting actions.
1b698439
KS
214The
215.B \-v
216option causes additional details to be printed.
217The
218.B \-q
219option supresses all output.
0e56e94a 220.SH DIAGNOSTICS
dfc5a452 221``\fBadd [ host | network ] %s: gateway %s flags %x\fP''
0e56e94a
KM
222.br
223The specified route is being added to the tables. The
224values printed are from the routing table entry supplied
225in the
226.I ioctl
227call.
dfc5a452
MK
228If the gateway address used was not the primary address of the gateway
229(the first one returned by
230.IR gethostbyname ),
231the 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
235As above, but when deleting an entry.
236.PP
dfc5a452 237``\fB%s %s done\fP''
0e56e94a
KM
238.br
239When the
240.B \-f
241flag is specified, each routing table entry deleted
242is indicated with a message of this form.
243.PP
dfc5a452
MK
244``\fBNetwork is unreachable\fP''
245.br
246An attempt to add a route failed because the gateway listed was not
247on a directly-connected network.
248The next-hop gateway must be given.
249.PP
250``\fBnot in table\fP''
0e56e94a
KM
251.br
252A delete operation was attempted for an entry which
253wasn't present in the tables.
254.PP
dfc5a452 255``\fBrouting table overflow\fP''
0e56e94a
KM
256.br
257An add operation was attempted, but the system was
258low on resources and was unable to allocate memory
259to create the new entry.
260.SH "SEE ALSO"
2944ec97 261netintro(4), routed(8), XNSrouted(8)