provide way to specify and lock metrics, alias interface for iface
[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.\"
31bd2db6 16.\" @(#)route.8 6.5 (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
KS
29.B \-v
30] [
7d5f817b
KS
31.B \-k
32.I vmunix
31bd2db6
KS
33]
34.I command
35[ [
36.I modifiers
37]
38.I args
0e56e94a
KM
39]
40.SH DESCRIPTION
41.I Route
42is a program used to manually manipulate the network
43routing tables. It normally is not needed, as the
44system routing table management daemon,
45.IR routed (8C),
46should tend to this task.
47.PP
48.I Route
31bd2db6 49accepts five commands:
0e56e94a 50.IR add ,
7d5f817b 51to add a route,
31bd2db6
KS
52.IR flush ,
53to remove all routes,
0e56e94a 54.IR delete ,
31bd2db6
KS
55to delete a specific route,
56.IR change ,
57to changes aspects of a route (such as its gateway),
58and
7d5f817b
KS
59.IR monitor ,
60to report any changes to the routing information base,
61routing lookup misses, or suspected network partionings.
62.PP
63The monitor command has the syntax
64.ti +0.25i
31bd2db6 65.B route
7d5f817b
KS
66[
67.I -n
68]
69.I monitor
0e56e94a 70.PP
7d5f817b 71The other commands have the following syntax:
0e56e94a 72.PP
dfc5a452 73.ti +0.25i
31bd2db6 74.B route
7d5f817b 75[
31bd2db6 76.I -n
7d5f817b 77]
0e56e94a 78.I command
0e56e94a 79[
31bd2db6 80.B -net
dfc5a452 81|
31bd2db6 82.B -host
dfc5a452
MK
83]
84.I destination gateway
85[
7d5f817b 86.I mask
0e56e94a
KM
87]
88.PP
89where
90.I destination
dfc5a452 91is the destination host or network,
0e56e94a 92.I gateway
7d5f817b 93is the next-hop gateway to which packets should be addressed.
0e56e94a
KM
94Routes to a particular host are distinguished from those to
95a network by interpreting the Internet address associated with
96.IR destination .
dfc5a452 97The optional keywords
31bd2db6 98.B -net
dfc5a452 99and
31bd2db6 100.B -host
dfc5a452
MK
101force the destination to be interpreted as a network or a host, respectively.
102Otherwise, if the
103.I destination
104has a ``local address part'' of INADDR_ANY,
105or if the
0e56e94a 106.I destination
dfc5a452 107is the symbolic name of a network, then the route is
0e56e94a 108assumed to be to a network; otherwise, it is presumed to be a
7d5f817b 109route to a host. If the route is via an interface rather than
0e56e94a 110via a gateway, the
31bd2db6
KS
111.I -interface
112modifier should be specified;
7d5f817b
KS
113the gateway given is the address of this host on the common network,
114indicating the interface to be used for transmission.
115.PP
31bd2db6
KS
116The optional modifiers
117.I -xns,
7d5f817b 118and
31bd2db6
KS
119.I -osi
120specify that all subsequent addresses are in the XNS or OSI address families,
7d5f817b
KS
121and the names must be numeric specifications rather than
122symbolic names.
31bd2db6 123For OSI addresses a third parameter is the address mask,
7d5f817b 124as given in an ESIS redirect.
31bd2db6 125(preceded by the -netmask modifier)
7d5f817b
KS
126.PP
127All symbolic names specified for a
0e56e94a
KM
128.I destination
129or
130.I gateway
dfc5a452
MK
131are looked up first as a host name using
132.IR gethostbyname (3N).
133If this lookup fails,
134.IR getnetbyname (3N)
135is then used to interpret the name as that of a network.
0e56e94a
KM
136.PP
137.I Route
7d5f817b
KS
138uses a routing socket and the new message types
139RTM_ADD and RTM_DELETE.
140As such, only the super-user may modify
0e56e94a
KM
141the routing tables.
142.PP
143If the
31bd2db6
KS
144.B flush
145command is specified,
0e56e94a
KM
146.I route
147will ``flush'' the routing tables of all gateway entries.
148If this is used in conjunction with one of the commands
149described above, the tables are flushed prior to the command's
150application.
dfc5a452
MK
151.PP
152The
153.B \-n
154option prevents attempts to print host and network names symbolically
155when reporting actions.
0e56e94a 156.SH DIAGNOSTICS
dfc5a452 157``\fBadd [ host | network ] %s: gateway %s flags %x\fP''
0e56e94a
KM
158.br
159The specified route is being added to the tables. The
160values printed are from the routing table entry supplied
161in the
162.I ioctl
163call.
dfc5a452
MK
164If the gateway address used was not the primary address of the gateway
165(the first one returned by
166.IR gethostbyname ),
167the gateway address is printed numerically as well as symbolically.
0e56e94a 168.PP
dfc5a452 169``\fBdelete [ host | network ] %s: gateway %s flags %x\fP''
0e56e94a
KM
170.br
171As above, but when deleting an entry.
172.PP
dfc5a452 173``\fB%s %s done\fP''
0e56e94a
KM
174.br
175When the
176.B \-f
177flag is specified, each routing table entry deleted
178is indicated with a message of this form.
179.PP
dfc5a452
MK
180``\fBNetwork is unreachable\fP''
181.br
182An attempt to add a route failed because the gateway listed was not
183on a directly-connected network.
184The next-hop gateway must be given.
185.PP
186``\fBnot in table\fP''
0e56e94a
KM
187.br
188A delete operation was attempted for an entry which
189wasn't present in the tables.
190.PP
dfc5a452 191``\fBrouting table overflow\fP''
0e56e94a
KM
192.br
193An add operation was attempted, but the system was
194low on resources and was unable to allocate memory
195to create the new entry.
196.SH "SEE ALSO"
2944ec97 197netintro(4), routed(8), XNSrouted(8)