more updates
[unix-history] / usr / src / sbin / route / route.8
CommitLineData
0e56e94a
KM
1.\" Copyright (c) 1983 Regents of the University of California.
2.\" All rights reserved. The Berkeley software License Agreement
3.\" specifies the terms and conditions for redistribution.
4.\"
f10ef12a 5.\" @(#)route.8 6.1 (Berkeley) %G%
0e56e94a 6.\"
f10ef12a 7.TH ROUTE 8C ""
0e56e94a
KM
8.UC 5
9.SH NAME
10route \- manually manipulate the routing tables
11.SH SYNOPSIS
12.B /etc/route
13[
14.B \-f
15] [
16.I command args
17]
18.SH DESCRIPTION
19.I Route
20is a program used to manually manipulate the network
21routing tables. It normally is not needed, as the
22system routing table management daemon,
23.IR routed (8C),
24should tend to this task.
25.PP
26.I Route
27accepts three commands:
28.IR add ,
29to add a route;
30.IR delete ,
31to delete a route; and
32.IR change ,
33to modify an existing route.
34.PP
35All commands have the following syntax:
36.PP
37.ti +0.5i
38.B /etc/route
39.I command
40.B destination gateway
41[
42.B metric
43]
44.PP
45where
46.I destination
47is a host or network for which
48the route is ``to'',
49.I gateway
50is the gateway to which packets should be addressed, and
51.I metric
52is an optional count indicating the number of hops to
53the
54.IR destination .
55If no metric is specified,
56.I route
57assumes a value of 0.
58Routes to a particular host are distinguished from those to
59a network by interpreting the Internet address associated with
60.IR destination .
61If the
62.I destination
63has a ``local address part'' of INADDR_ANY, then the route is
64assumed to be to a network; otherwise, it is presumed to be a
65route to a host. If the route is to a destination connected
66via a gateway, the
67.I metric
68should be greater than 0. All symbolic names specified for a
69.I destination
70or
71.I gateway
72are looked up first in the host name database,
73.IR hosts (5).
74If this lookup fails, the name is then looked for
75in the network name database,
76.IR networks (5).
77.PP
78.I Route
79uses a raw socket and the SIOCADDRT and SIOCDELRT
80.IR ioctl 's
81to do its work. As such, only the super-user may modify
82the routing tables.
83.PP
84If the
85.B \-f
86option is specified,
87.I route
88will ``flush'' the routing tables of all gateway entries.
89If this is used in conjunction with one of the commands
90described above, the tables are flushed prior to the command's
91application.
92.SH DIAGNOSTICS
93.B ``add %s: gateway %s flags %x''
94.br
95The specified route is being added to the tables. The
96values printed are from the routing table entry supplied
97in the
98.I ioctl
99call.
100.PP
101.B ``delete %s: gateway %s flags %x''
102.br
103As above, but when deleting an entry.
104.PP
105.B ``%s %s done''
106.br
107When the
108.B \-f
109flag is specified, each routing table entry deleted
110is indicated with a message of this form.
111.PP
112.B ``not in table''
113.br
114A delete operation was attempted for an entry which
115wasn't present in the tables.
116.PP
117.B ``routing table overflow''
118.br
119An add operation was attempted, but the system was
120low on resources and was unable to allocate memory
121to create the new entry.
122.SH "SEE ALSO"
123intro(4N),
124routed(8C)
125.SH BUGS
126The change operation is not implemented, one should add
127the new route, then delete the old one.