Commit | Line | Data |
---|---|---|
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 |
26 | is a program used to manually manipulate the network |
27 | routing tables. It normally is not needed, as the | |
28 | system routing table management daemon, | |
70567b1c | 29 | .Xr routed 8 , |
0e56e94a | 30 | should tend to this task. |
70567b1c CL |
31 | .Pp |
32 | Options supported by | |
33 | .Nm route : | |
34 | .Pp | |
35 | .Bl -tag -width Ds | |
36 | .It Fl n | |
37 | Prevent attempts to print host and network names symbolically | |
38 | when reporting actions. | |
39 | .It Fl v | |
40 | (verbose) Print additional details. | |
41 | .It Fl q | |
42 | Suppress all output. | |
43 | .El | |
44 | .Pp | |
45 | Commands accepted by | |
46 | .Nm route : | |
47 | .Pp | |
48 | .Bl -tag -width Fl -compact | |
49 | .It Cm add | |
50 | Add a route. | |
51 | .It Cm flush | |
52 | Remove all routes. | |
53 | .It Cm delete | |
54 | Delete a specific route. | |
55 | .It Cm change | |
56 | Change aspects of a route (such as its gateway). | |
57 | .It Cm get | |
58 | Lookup and display the route for a destination. | |
59 | .It Cm monitor | |
60 | Continuously report any changes to the routing information base, | |
653ba8b6 | 61 | routing lookup misses, or suspected network partitionings. |
70567b1c CL |
62 | .El |
63 | .Pp | |
7d5f817b | 64 | The 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 | 71 | The 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 | |
79 | Where the address family may be specified by any of the | |
80 | .Fl osi , | |
81 | .Fl xns , | |
1b698439 | 82 | or |
70567b1c | 83 | .Fl inet |
1b698439 | 84 | keywords. |
70567b1c | 85 | .Pp |
7d5f817b | 86 | The 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 | 95 | where |
70567b1c | 96 | .Ar destination |
dfc5a452 | 97 | is the destination host or network, |
70567b1c | 98 | .Ar gateway |
7d5f817b | 99 | is the next-hop gateway to which packets should be addressed. |
0e56e94a KM |
100 | Routes to a particular host are distinguished from those to |
101 | a network by interpreting the Internet address associated with | |
70567b1c | 102 | .Ar destination . |
dfc5a452 | 103 | The optional keywords |
70567b1c | 104 | .Fl net |
dfc5a452 | 105 | and |
70567b1c | 106 | .Fl host |
dfc5a452 MK |
107 | force the destination to be interpreted as a network or a host, respectively. |
108 | Otherwise, if the | |
70567b1c CL |
109 | .Ar destination |
110 | has a ``local address part'' of | |
111 | INADDR_ANY , | |
dfc5a452 | 112 | or if the |
70567b1c | 113 | .Ar destination |
dfc5a452 | 114 | is the symbolic name of a network, then the route is |
0e56e94a | 115 | assumed to be to a network; otherwise, it is presumed to be a |
1b698439 | 116 | route to a host. |
70567b1c | 117 | .Pp |
1b698439 | 118 | For example, |
70567b1c CL |
119 | .Li 128.32 |
120 | is interpreted as | |
121 | .Fl host Li 128.0.0.32 ; | |
122 | .Li 128.32.130 | |
123 | is interpreted as | |
124 | .Fl host Li 128.32.0.130 ; | |
125 | .Fl net Li 128.32 | |
1b698439 | 126 | is interpreted as |
70567b1c | 127 | .Li 128.32.0.0; |
1b698439 | 128 | and |
70567b1c | 129 | .Fl net Li 128.32.130 |
1b698439 | 130 | is interpreted as |
70567b1c CL |
131 | .Li 128.32.130.0 . |
132 | .Pp | |
1b698439 | 133 | If the route is via an interface rather than |
0e56e94a | 134 | via a gateway, the |
70567b1c | 135 | .Fl interface |
31bd2db6 | 136 | modifier should be specified; |
7d5f817b KS |
137 | the gateway given is the address of this host on the common network, |
138 | indicating the interface to be used for transmission. | |
70567b1c | 139 | .Pp |
31bd2db6 | 140 | The optional modifiers |
70567b1c | 141 | .Fl xns , |
7d5f817b | 142 | and |
70567b1c CL |
143 | .Fl osi |
144 | specify that all subsequent addresses are in the | |
145 | .Tn XNS | |
146 | or | |
147 | .Tn OSI | |
148 | address families, | |
7d5f817b KS |
149 | and the names must be numeric specifications rather than |
150 | symbolic names. | |
70567b1c | 151 | .Pp |
1d339c5b | 152 | The optional |
70567b1c | 153 | .Fl netmask |
1d339c5b | 154 | qualifier is intended |
70567b1c CL |
155 | to achieve the effect of an |
156 | .Tn OSI | |
157 | .Tn ESIS | |
158 | redirect with the netmask option. | |
1d339c5b KS |
159 | One specifies an additional ensuing address parameter |
160 | (to be interpreted as a network mask). | |
70567b1c CL |
161 | The implicit network mask generated in the inet case |
162 | can be overridden by making sure this option follows the destination parameter. | |
163 | .Pp | |
1b698439 | 164 | The 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 | 172 | and |
70567b1c | 173 | .Fl ssthresh |
1b698439 KS |
174 | provide initial values to metrics maintained in the routing entry. |
175 | These may be individually locked by preceding each such modifier to | |
176 | be locked by | |
177 | the | |
70567b1c | 178 | .Fl lock |
1b698439 KS |
179 | meta-modifier, or one can |
180 | specify that all ensuing metrics may be locked by the | |
70567b1c | 181 | .Fl lockrest |
1b698439 | 182 | meta-modifier. |
70567b1c | 183 | .Pp |
c66eb739 | 184 | In a |
70567b1c CL |
185 | .Cm change |
186 | or | |
187 | .Cm add | |
c66eb739 | 188 | command where the destination and gateway are not sufficient to specify |
70567b1c CL |
189 | the route (as in the |
190 | .Tn ISO | |
191 | case where several interfaces may have the | |
c66eb739 | 192 | same address), the |
70567b1c CL |
193 | .Fl ifp |
194 | or | |
195 | .Fl ifa | |
c66eb739 | 196 | modifiers may be used to determine the interface or interface address. |
70567b1c | 197 | .Pp |
7d5f817b | 198 | All symbolic names specified for a |
70567b1c | 199 | .Ar destination |
0e56e94a | 200 | or |
70567b1c | 201 | .Ar gateway |
dfc5a452 | 202 | are looked up first as a host name using |
70567b1c | 203 | .Xr gethostbyname 3 . |
dfc5a452 | 204 | If this lookup fails, |
70567b1c | 205 | .Xr getnetbyname 3 |
dfc5a452 | 206 | is then used to interpret the name as that of a network. |
70567b1c CL |
207 | .Pp |
208 | .Nm Route | |
7d5f817b | 209 | uses a routing socket and the new message types |
70567b1c CL |
210 | RTM_ADD, |
211 | RTM_DELETE, | |
212 | RTM_GET, | |
213 | and | |
214 | RTM_CHANGE. | |
7d5f817b | 215 | As such, only the super-user may modify |
0e56e94a | 216 | the routing tables. |
70567b1c | 217 | .Pp |
0e56e94a | 218 | If the |
70567b1c | 219 | .Cm flush |
31bd2db6 | 220 | command is specified, |
70567b1c | 221 | .Nm route |
0e56e94a | 222 | will ``flush'' the routing tables of all gateway entries. |
1d339c5b KS |
223 | One can choose to flush only those routes whose destinations |
224 | are of a given address family, by specifying an optional keyword | |
225 | describing 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 |
229 | The specified route is being added to the tables. The |
230 | values printed are from the routing table entry supplied | |
231 | in the | |
70567b1c | 232 | .Xr ioctl 2 |
0e56e94a | 233 | call. |
dfc5a452 MK |
234 | If the gateway address used was not the primary address of the gateway |
235 | (the first one returned by | |
70567b1c | 236 | .Xr gethostbyname 3 ) , |
dfc5a452 | 237 | the gateway address is printed numerically as well as symbolically. |
70567b1c | 238 | .It Sy "delete [ host &| network ] %s: gateway %s flags %x" |
0e56e94a | 239 | As above, but when deleting an entry. |
70567b1c | 240 | .It Sy "%s %s done" |
0e56e94a | 241 | When the |
70567b1c | 242 | .Cm flush |
c66eb739 | 243 | command is specified, each routing table entry deleted |
0e56e94a | 244 | is indicated with a message of this form. |
70567b1c | 245 | .It Sy "Network is unreachable" |
dfc5a452 MK |
246 | An attempt to add a route failed because the gateway listed was not |
247 | on a directly-connected network. | |
248 | The next-hop gateway must be given. | |
70567b1c | 249 | .It Sy "not in table" |
0e56e94a KM |
250 | A delete operation was attempted for an entry which |
251 | wasn't present in the tables. | |
70567b1c | 252 | .It Sy "routing table overflow" |
0e56e94a KM |
253 | An add operation was attempted, but the system was |
254 | low on resources and was unable to allocate memory | |
255 | to 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 | |
264 | The | |
265 | .Nm | |
266 | command appeared in | |
267 | .Bx 4.2 . | |
268 | .Sh BUGS | |
269 | The first paragraph may have slightly exaggerated | |
270 | .Xr routed Ns 's | |
271 | abilities. |