route - manually manipulate the routing tables
/usr/etc/route [ -fn ] add|delete [ host|net ] destination [ gateway [
metric ] ]
This program is available with the Networking software installation
option. Refer to for information on how to install optional software.
route manually manipulates the network routing tables normally main-
tained by the system routing daemon, routed(8C), or through default
routes and redirect messages from routers. route allows the super-user
to operate directly on the routing table for the specific host or net-
work indicated by destination. The gateway argument, if present, indi-
cates the network gateway to which packets should be addressed. The
metric argument indicates the number of "hops" to the destination. The
metric is required for add commands; it must be zero if the destination
is on a directly-attached network, and nonzero if the route utilizes
one or more gateways.
The add command instructs route to add a route to destination. delete
deletes a route.
Routes to a particular host must be distinguished from those to a net-
work. 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, then the route is
assumed to be to a network; otherwise, it is presumed to be a route to
a host. If the route is to a destination connected by a gateway, the
metric parameter should be greater than 0. If adding a route with met-
ric 0, the gateway given is the address of this host on the common net-
work, indicating the interface to be used directly for transmission.
All symbolic names specified for a destination or gateway are looked up
in the hosts database using gethostbyname() (see gethostent(3N)). If
this lookup fails, then the name is looked up in the networks database
using getnetbyname() (see getnetent(3N)). "default" is also a valid
destination, which is used for all routes if there is no specific host
or network route.
-f Flush the routing tables of all gateway entries. If this is
used in conjunction with one of the commands described above,
route flushes the gateways before performing the command.
-n Prevents attempts to print host and network names symbolically
when reporting actions. This is useful, for example, when all
name servers are down on your local net, so you need a route
before you can contact the name server.
ioctl(2), gethostent(3N), getnetent(3N), routing(4N), routed(8C)
add [ host|net] destination:gateway
The specified route is being added to the tables. The values
printed are from the routing table entry supplied in the
delete [ host|net] destination:gateway
The specified route is being deleted.
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. Give the next-hop gateway
not in table
A delete operation was attempted for an entry that is not in
routing table overflow
An add operation was attempted, but the system was unable to
allocate memory to create the new entry.
3 August 1988 ROUTE(8C)