copyediting for Usenix manuals
[unix-history] / usr / src / sbin / route / route.8
CommitLineData
1a010d0f
KB
1.\" Copyright (c) 1983, 1991, 1993
2.\" The Regents of the University of California. All rights reserved.
0e56e94a 3.\"
942a1d2b 4.\" %sccs.include.redist.man%
0e56e94a 5.\"
653ba8b6 6.\" @(#)route.8 8.2 (Berkeley) %G%
2944ec97 7.\"
70567b1c
CL
8.Dd
9.Dt ROUTE 8
10.Os BSD 4.2
11.Sh NAME
12.Nm route
13.Nd manually manipulate the routing tables (Interim)
14.Sh SYNOPSIS
15.Nm route
16.Op Fl n
17.Op Fl q
18.Op Fl v
19.Ar command
20.Oo
21.Op Ar modifiers
22.Ar args
23.Oc
24.Sh DESCRIPTION
25.Nm Route
0e56e94a
KM
26is a program used to manually manipulate the network
27routing tables. It normally is not needed, as the
28system routing table management daemon,
70567b1c 29.Xr routed 8 ,
0e56e94a 30should tend to this task.
70567b1c
CL
31.Pp
32Options supported by
33.Nm route :
34.Pp
35.Bl -tag -width Ds
36.It Fl n
37Prevent attempts to print host and network names symbolically
38when reporting actions.
39.It Fl v
40(verbose) Print additional details.
41.It Fl q
42Suppress all output.
43.El
44.Pp
45Commands accepted by
46.Nm route :
47.Pp
48.Bl -tag -width Fl -compact
49.It Cm add
50Add a route.
51.It Cm flush
52Remove all routes.
53.It Cm delete
54Delete a specific route.
55.It Cm change
56Change aspects of a route (such as its gateway).
57.It Cm get
58Lookup and display the route for a destination.
59.It Cm monitor
60Continuously report any changes to the routing information base,
653ba8b6 61routing lookup misses, or suspected network partitionings.
70567b1c
CL
62.El
63.Pp
7d5f817b 64The monitor command has the syntax
70567b1c
CL
65.Pp
66.Bd -filled -offset indent -compact
67.Nm route Op Fl n
68.Cm monitor
69.Ed
70.Pp
1b698439 71The flush command has the syntax
70567b1c
CL
72.Pp
73.Bd -filled -offset indent -compact
74.Nm route Op Fl n
75.Cm flush
76.Op Ar family
77.Ed
78.Pp
79Where the address family may be specified by any of the
80.Fl osi ,
81.Fl xns ,
1b698439 82or
70567b1c 83.Fl inet
1b698439 84keywords.
70567b1c 85.Pp
7d5f817b 86The other commands have the following syntax:
70567b1c
CL
87.Pp
88.Bd -filled -offset indent -compact
89.Nm route Op Fl n
90.Ar command
91.Op Fl net No \&| Fl host
92.Ar destination gateway
93.Ed
94.Pp
0e56e94a 95where
70567b1c 96.Ar destination
dfc5a452 97is the destination host or network,
70567b1c 98.Ar gateway
7d5f817b 99is the next-hop gateway to which packets should be addressed.
0e56e94a
KM
100Routes to a particular host are distinguished from those to
101a network by interpreting the Internet address associated with
70567b1c 102.Ar destination .
dfc5a452 103The optional keywords
70567b1c 104.Fl net
dfc5a452 105and
70567b1c 106.Fl host
dfc5a452
MK
107force the destination to be interpreted as a network or a host, respectively.
108Otherwise, if the
70567b1c
CL
109.Ar destination
110has a ``local address part'' of
111INADDR_ANY ,
dfc5a452 112or if the
70567b1c 113.Ar destination
dfc5a452 114is the symbolic name of a network, then the route is
0e56e94a 115assumed to be to a network; otherwise, it is presumed to be a
1b698439 116route to a host.
70567b1c 117.Pp
1b698439 118For example,
70567b1c
CL
119.Li 128.32
120is interpreted as
121.Fl host Li 128.0.0.32 ;
122.Li 128.32.130
123is interpreted as
124.Fl host Li 128.32.0.130 ;
125.Fl net Li 128.32
1b698439 126is interpreted as
70567b1c 127.Li 128.32.0.0;
1b698439 128and
70567b1c 129.Fl net Li 128.32.130
1b698439 130is interpreted as
70567b1c
CL
131.Li 128.32.130.0 .
132.Pp
1b698439 133If the route is via an interface rather than
0e56e94a 134via a gateway, the
70567b1c 135.Fl interface
31bd2db6 136modifier should be specified;
7d5f817b
KS
137the gateway given is the address of this host on the common network,
138indicating the interface to be used for transmission.
70567b1c 139.Pp
31bd2db6 140The optional modifiers
70567b1c 141.Fl xns ,
7d5f817b 142and
70567b1c
CL
143.Fl osi
144specify that all subsequent addresses are in the
145.Tn XNS
146or
147.Tn OSI
148address families,
7d5f817b
KS
149and the names must be numeric specifications rather than
150symbolic names.
70567b1c 151.Pp
1d339c5b 152The optional
70567b1c 153.Fl netmask
1d339c5b 154qualifier is intended
70567b1c
CL
155to achieve the effect of an
156.Tn OSI
157.Tn ESIS
158redirect with the netmask option.
1d339c5b
KS
159One specifies an additional ensuing address parameter
160(to be interpreted as a network mask).
70567b1c
CL
161The implicit network mask generated in the inet case
162can be overridden by making sure this option follows the destination parameter.
163.Pp
1b698439 164The optional modifiers
70567b1c
CL
165.Fl rtt ,
166.Fl rttvar ,
167.Fl sendpipe ,
168.Fl recvpipe ,
169.Fl mtu ,
170.Fl hopcount ,
171.Fl expire ,
1b698439 172and
70567b1c 173.Fl ssthresh
1b698439
KS
174provide initial values to metrics maintained in the routing entry.
175These may be individually locked by preceding each such modifier to
176be locked by
177the
70567b1c 178.Fl lock
1b698439
KS
179meta-modifier, or one can
180specify that all ensuing metrics may be locked by the
70567b1c 181.Fl lockrest
1b698439 182meta-modifier.
70567b1c 183.Pp
c66eb739 184In a
70567b1c
CL
185.Cm change
186or
187.Cm add
c66eb739 188command where the destination and gateway are not sufficient to specify
70567b1c
CL
189the route (as in the
190.Tn ISO
191case where several interfaces may have the
c66eb739 192same address), the
70567b1c
CL
193.Fl ifp
194or
195.Fl ifa
c66eb739 196modifiers may be used to determine the interface or interface address.
70567b1c 197.Pp
7d5f817b 198All symbolic names specified for a
70567b1c 199.Ar destination
0e56e94a 200or
70567b1c 201.Ar gateway
dfc5a452 202are looked up first as a host name using
70567b1c 203.Xr gethostbyname 3 .
dfc5a452 204If this lookup fails,
70567b1c 205.Xr getnetbyname 3
dfc5a452 206is then used to interpret the name as that of a network.
70567b1c
CL
207.Pp
208.Nm Route
7d5f817b 209uses a routing socket and the new message types
70567b1c
CL
210RTM_ADD,
211RTM_DELETE,
212RTM_GET,
213and
214RTM_CHANGE.
7d5f817b 215As such, only the super-user may modify
0e56e94a 216the routing tables.
70567b1c 217.Pp
0e56e94a 218If the
70567b1c 219.Cm flush
31bd2db6 220command is specified,
70567b1c 221.Nm route
0e56e94a 222will ``flush'' the routing tables of all gateway entries.
1d339c5b
KS
223One can choose to flush only those routes whose destinations
224are of a given address family, by specifying an optional keyword
225describing which address family.
70567b1c
CL
226.Sh DIAGNOSTICS
227.Bl -tag -width Ds
228.It Sy "add [host \&| network ] %s: gateway %s flags %x"
0e56e94a
KM
229The specified route is being added to the tables. The
230values printed are from the routing table entry supplied
231in the
70567b1c 232.Xr ioctl 2
0e56e94a 233call.
dfc5a452
MK
234If the gateway address used was not the primary address of the gateway
235(the first one returned by
70567b1c 236.Xr gethostbyname 3 ) ,
dfc5a452 237the gateway address is printed numerically as well as symbolically.
70567b1c 238.It Sy "delete [ host &| network ] %s: gateway %s flags %x"
0e56e94a 239As above, but when deleting an entry.
70567b1c 240.It Sy "%s %s done"
0e56e94a 241When the
70567b1c 242.Cm flush
c66eb739 243command is specified, each routing table entry deleted
0e56e94a 244is indicated with a message of this form.
70567b1c 245.It Sy "Network is unreachable"
dfc5a452
MK
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.
70567b1c 249.It Sy "not in table"
0e56e94a
KM
250A delete operation was attempted for an entry which
251wasn't present in the tables.
70567b1c 252.It Sy "routing table overflow"
0e56e94a
KM
253An add operation was attempted, but the system was
254low on resources and was unable to allocate memory
255to create the new entry.
70567b1c
CL
256.El
257.Sh SEE ALSO
258.Xr netintro 4 ,
259.Xr route 4 ,
260.Xr esis 4 ,
261.Xr routed 8 ,
262.Xr XNSrouted 8
263.Sh HISTORY
264The
265.Nm
266command appeared in
267.Bx 4.2 .
268.Sh BUGS
269The first paragraph may have slightly exaggerated
270.Xr routed Ns 's
271abilities.