ROUTE(8)ROUTE(8)NAMEroute - manually manipulate the routing tables (Interim)
SYNOPSISroute [ -n ] [ -q ] [ -v ] command [ [ modifiers ] args ]
DESCRIPTION
Route is a program used to manually manipulate the network routing
tables. It normally is not needed, as the system routing table manage‐
ment daemon, routed(8C), should tend to this task.
Route accepts five commands: add, to add a route, flush, to remove all
routes, delete, to delete a specific route, change, to changes aspects
of a route (such as its gateway), and monitor, to report any changes to
the routing information base, routing lookup misses, or suspected net‐
work partionings.
The monitor command has the syntax
route [ -n ] monitor
The flush command has the syntax
route [ -n ] [ -n ] flush [ family ]
where the address family may be specified by any of the -osi, -xns, or
-inet keywords.
The other commands have the following syntax:
route [ -n ] command [ -net | -host ] destination gateway
where destination is the destination host or network, gateway is the
next-hop gateway to which packets should be addressed. Routes to a
particular host are distinguished from those to a network by interpret‐
ing the Internet address associated with destination. The optional
keywords -net and -host force the destination to be interpreted as a
network or a host, respectively. Otherwise, if the destination has a
``local address part'' of INADDR_ANY, or if the destination is the sym‐
bolic name of a network, then the route is assumed to be to a network;
otherwise, it is presumed to be a route to a host.
For example, 128.32 is interpreted as -host 128.0.0.32, 128.32.130 is
interpreted as -host 128.32.0.130; -net 128.32 is interpreted as
128.32.0.0, and -net 128.32.130 is interpreted as 128.32.130.0.
If the route is via an interface rather than via a gateway, the -inter‐
face modifier should be specified; the gateway given is the address of
this host on the common network, indicating the interface to be used
for transmission.
The optional modifiers -xns, and -osi specify that all subsequent
addresses are in the XNS or OSI address families, and the names must be
numeric specifications rather than symbolic names.
The optional -netmask qualifier is intended to acheieve the effect of
an OSI ESIS redirect with the netmask option. One specifies an addi‐
tional ensuing address parameter (to be interpreted as a network mask).
One can override the implicit network mask generated in the inet case
by making sure this option follows the destination parameter.
The optional modifiers -rtt, -rttvar, -sendpipe, -recvpipe, -mtu, -hop‐
count, -expire, and -ssthresh provide initial values to metrics main‐
tained in the routing entry. These may be individually locked by pre‐
ceding each such modifier to be locked by the -lock meta-modifier, or
one can specify that all ensuing metrics may be locked by the -lockrest
meta-modifier.
All symbolic names specified for a destination or gateway are looked up
first as a host name using gethostbyname(3N). If this lookup fails,
getnetbyname(3N) is then used to interpret the name as that of a net‐
work.
Route uses a routing socket and the new message types RTM_ADD,
RTM_DELETE, and RTM_CHANGE. As such, only the super-user may modify
the routing tables.
If the flush command is specified, route will ``flush'' the routing
tables of all gateway entries. One can choose to flush only those
routes whose destinations are of a given address family, by specifying
an optional keyword describing which address family.
The -n option prevents attempts to print host and network names symbol‐
ically when reporting actions. The -v option causes additional details
to be printed. The -q option supresses all output.
DIAGNOSTICS
``add [ host | network ] %s: gateway %s flags %x''
The specified route is being added to the tables. The values printed
are from the routing table entry supplied in the ioctl call. If the
gateway address used was not the primary address of the gateway (the
first one returned by gethostbyname), the gateway address is printed
numerically as well as symbolically.
``delete [ host | network ] %s: gateway %s flags %x''
As above, but when deleting an entry.
``%s %s done''
When the -f flag is specified, each routing table entry deleted is
indicated with a message of this form.
``Network is unreachable''
An attempt to add a route failed because the gateway listed was not on
a directly-connected network. The next-hop gateway must be given.
``not in table''
A delete operation was attempted for an entry which wasn't present in
the tables.
``routing table overflow''
An add operation was attempted, but the system was low on resources and
was unable to allocate memory to create the new entry.
SEE ALSOnetintro(4), routed(8), XNSrouted(8)4.2 Berkeley Distribution June 24, 1990 ROUTE(8)