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