Commit | Line | Data |
---|---|---|
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 | |
10 | route \- 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 | |
20 | is a program used to manually manipulate the network | |
21 | routing tables. It normally is not needed, as the | |
22 | system routing table management daemon, | |
23 | .IR routed (8C), | |
24 | should tend to this task. | |
25 | .PP | |
26 | .I Route | |
27 | accepts three commands: | |
28 | .IR add , | |
29 | to add a route; | |
30 | .IR delete , | |
31 | to delete a route; and | |
32 | .IR change , | |
33 | to modify an existing route. | |
34 | .PP | |
35 | All 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 | |
45 | where | |
46 | .I destination | |
47 | is a host or network for which | |
48 | the route is ``to'', | |
49 | .I gateway | |
50 | is the gateway to which packets should be addressed, and | |
51 | .I metric | |
52 | is an optional count indicating the number of hops to | |
53 | the | |
54 | .IR destination . | |
55 | If no metric is specified, | |
56 | .I route | |
57 | assumes a value of 0. | |
58 | Routes to a particular host are distinguished from those to | |
59 | a network by interpreting the Internet address associated with | |
60 | .IR destination . | |
61 | If the | |
62 | .I destination | |
63 | has a ``local address part'' of INADDR_ANY, then the route is | |
64 | assumed to be to a network; otherwise, it is presumed to be a | |
65 | route to a host. If the route is to a destination connected | |
66 | via a gateway, the | |
67 | .I metric | |
68 | should be greater than 0. All symbolic names specified for a | |
69 | .I destination | |
70 | or | |
71 | .I gateway | |
72 | are looked up first in the host name database, | |
73 | .IR hosts (5). | |
74 | If this lookup fails, the name is then looked for | |
75 | in the network name database, | |
76 | .IR networks (5). | |
77 | .PP | |
78 | .I Route | |
79 | uses a raw socket and the SIOCADDRT and SIOCDELRT | |
80 | .IR ioctl 's | |
81 | to do its work. As such, only the super-user may modify | |
82 | the routing tables. | |
83 | .PP | |
84 | If the | |
85 | .B \-f | |
86 | option is specified, | |
87 | .I route | |
88 | will ``flush'' the routing tables of all gateway entries. | |
89 | If this is used in conjunction with one of the commands | |
90 | described above, the tables are flushed prior to the command's | |
91 | application. | |
92 | .SH DIAGNOSTICS | |
93 | .B ``add %s: gateway %s flags %x'' | |
94 | .br | |
95 | The specified route is being added to the tables. The | |
96 | values printed are from the routing table entry supplied | |
97 | in the | |
98 | .I ioctl | |
99 | call. | |
100 | .PP | |
101 | .B ``delete %s: gateway %s flags %x'' | |
102 | .br | |
103 | As above, but when deleting an entry. | |
104 | .PP | |
105 | .B ``%s %s done'' | |
106 | .br | |
107 | When the | |
108 | .B \-f | |
109 | flag is specified, each routing table entry deleted | |
110 | is indicated with a message of this form. | |
111 | .PP | |
112 | .B ``not in table'' | |
113 | .br | |
114 | A delete operation was attempted for an entry which | |
115 | wasn't present in the tables. | |
116 | .PP | |
117 | .B ``routing table overflow'' | |
118 | .br | |
119 | An add operation was attempted, but the system was | |
120 | low on resources and was unable to allocate memory | |
121 | to create the new entry. | |
122 | .SH "SEE ALSO" | |
123 | intro(4N), | |
124 | routed(8C) | |
125 | .SH BUGS | |
126 | The change operation is not implemented, one should add | |
127 | the new route, then delete the old one. |