Commit | Line | Data |
---|---|---|
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 | .\" |
2944ec97 KB |
16 | .\" @(#)route.8 6.3 (Berkeley) %G% |
17 | .\" | |
18 | .TH ROUTE 8 "" | |
0e56e94a KM |
19 | .UC 5 |
20 | .SH NAME | |
21 | route \- manually manipulate the routing tables | |
22 | .SH SYNOPSIS | |
23 | .B /etc/route | |
24 | [ | |
25 | .B \-f | |
26 | ] [ | |
dfc5a452 MK |
27 | .B \-n |
28 | ] [ | |
0e56e94a KM |
29 | .I command args |
30 | ] | |
31 | .SH DESCRIPTION | |
32 | .I Route | |
33 | is a program used to manually manipulate the network | |
34 | routing tables. It normally is not needed, as the | |
35 | system routing table management daemon, | |
36 | .IR routed (8C), | |
37 | should tend to this task. | |
38 | .PP | |
39 | .I Route | |
dfc5a452 | 40 | accepts two commands: |
0e56e94a | 41 | .IR add , |
dfc5a452 | 42 | to add a route, and |
0e56e94a | 43 | .IR delete , |
dfc5a452 | 44 | to delete a route. |
0e56e94a KM |
45 | .PP |
46 | All commands have the following syntax: | |
47 | .PP | |
dfc5a452 | 48 | .ti +0.25i |
0e56e94a KM |
49 | .B /etc/route |
50 | .I command | |
0e56e94a | 51 | [ |
dfc5a452 MK |
52 | .B net |
53 | | | |
54 | .B host | |
55 | ] | |
56 | .I destination gateway | |
57 | [ | |
58 | .I metric | |
0e56e94a KM |
59 | ] |
60 | .PP | |
61 | where | |
62 | .I destination | |
dfc5a452 | 63 | is the destination host or network, |
0e56e94a | 64 | .I gateway |
dfc5a452 | 65 | is the next-hop gateway to which packets should be addressed, and |
0e56e94a | 66 | .I metric |
dfc5a452 | 67 | is a count indicating the number of hops to |
0e56e94a KM |
68 | the |
69 | .IR destination . | |
dfc5a452 MK |
70 | The metric is required for |
71 | .I add | |
72 | commands; it must be zero if the destination is on a directly-attached network, | |
73 | and nonzero if the route utilizes one or more gateways. | |
74 | If adding a route with metric 0, | |
75 | the gateway given is the address of this host on the common network, | |
76 | indicating the interface to be used for transmission. | |
0e56e94a KM |
77 | Routes to a particular host are distinguished from those to |
78 | a network by interpreting the Internet address associated with | |
79 | .IR destination . | |
dfc5a452 MK |
80 | The optional keywords |
81 | .B net | |
82 | and | |
83 | .B host | |
84 | force the destination to be interpreted as a network or a host, respectively. | |
85 | Otherwise, if the | |
86 | .I destination | |
87 | has a ``local address part'' of INADDR_ANY, | |
88 | or if the | |
0e56e94a | 89 | .I destination |
dfc5a452 | 90 | is the symbolic name of a network, then the route is |
0e56e94a KM |
91 | assumed to be to a network; otherwise, it is presumed to be a |
92 | route to a host. If the route is to a destination connected | |
93 | via a gateway, the | |
94 | .I metric | |
95 | should be greater than 0. All symbolic names specified for a | |
96 | .I destination | |
97 | or | |
98 | .I gateway | |
dfc5a452 MK |
99 | are looked up first as a host name using |
100 | .IR gethostbyname (3N). | |
101 | If this lookup fails, | |
102 | .IR getnetbyname (3N) | |
103 | is then used to interpret the name as that of a network. | |
0e56e94a KM |
104 | .PP |
105 | .I Route | |
106 | uses a raw socket and the SIOCADDRT and SIOCDELRT | |
107 | .IR ioctl 's | |
108 | to do its work. As such, only the super-user may modify | |
109 | the routing tables. | |
110 | .PP | |
111 | If the | |
112 | .B \-f | |
113 | option is specified, | |
114 | .I route | |
115 | will ``flush'' the routing tables of all gateway entries. | |
116 | If this is used in conjunction with one of the commands | |
117 | described above, the tables are flushed prior to the command's | |
118 | application. | |
dfc5a452 MK |
119 | .PP |
120 | The | |
121 | .B \-n | |
122 | option prevents attempts to print host and network names symbolically | |
123 | when reporting actions. | |
0e56e94a | 124 | .SH DIAGNOSTICS |
dfc5a452 | 125 | ``\fBadd [ host | network ] %s: gateway %s flags %x\fP'' |
0e56e94a KM |
126 | .br |
127 | The specified route is being added to the tables. The | |
128 | values printed are from the routing table entry supplied | |
129 | in the | |
130 | .I ioctl | |
131 | call. | |
dfc5a452 MK |
132 | If the gateway address used was not the primary address of the gateway |
133 | (the first one returned by | |
134 | .IR gethostbyname ), | |
135 | the gateway address is printed numerically as well as symbolically. | |
0e56e94a | 136 | .PP |
dfc5a452 | 137 | ``\fBdelete [ host | network ] %s: gateway %s flags %x\fP'' |
0e56e94a KM |
138 | .br |
139 | As above, but when deleting an entry. | |
140 | .PP | |
dfc5a452 | 141 | ``\fB%s %s done\fP'' |
0e56e94a KM |
142 | .br |
143 | When the | |
144 | .B \-f | |
145 | flag is specified, each routing table entry deleted | |
146 | is indicated with a message of this form. | |
147 | .PP | |
dfc5a452 MK |
148 | ``\fBNetwork is unreachable\fP'' |
149 | .br | |
150 | An attempt to add a route failed because the gateway listed was not | |
151 | on a directly-connected network. | |
152 | The next-hop gateway must be given. | |
153 | .PP | |
154 | ``\fBnot in table\fP'' | |
0e56e94a KM |
155 | .br |
156 | A delete operation was attempted for an entry which | |
157 | wasn't present in the tables. | |
158 | .PP | |
dfc5a452 | 159 | ``\fBrouting table overflow\fP'' |
0e56e94a KM |
160 | .br |
161 | An add operation was attempted, but the system was | |
162 | low on resources and was unable to allocate memory | |
163 | to create the new entry. | |
164 | .SH "SEE ALSO" | |
2944ec97 | 165 | netintro(4), routed(8), XNSrouted(8) |