route(1M) route(1M)
NAME
route - manually manipulate the routing tables
SYNOPSIS
route [-fn] [netmask mask] add [host | net] destination gateway metric
[nc]
route [-fn] delete [host | net] destination gateway
route [-fn] [netmask mask] add default gateway metric [nc]
route [-fn] delete default gateway
DESCRIPTION
route manually manipulates the network routing tables normally main-
tained by the system routing daemon, e.g., routed(1M), or through
default routes and redirect messages from routers. route allows the
superuser to operate directly on the routing table for the specific
host or network indicated by destination. default is available for
gateways to use after all other routes have been attempted. The gate-
way argument indicates the network gateway to which packets should be
addressed. The metric argument indicates the number of "hops" to the
destination. It must be zero if the destination is on a directly-
attached network, and non-zero if the route utilizes one or more gate-
ways. All route entries generated with the route command are marked as
static [see netstat(1M)] to supply a method to distinguish route
entries added manually from such added by a routing daemon.
The netmask parameter is intended to manually add subnet routes with a
netmask mask different from that of the implied network interface.
mask has to be supplied as a hex number.
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 INADDRANY, 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
metric 0, the gateway given is the address of this host on the common
network, indicating the interface to be used directly for transmis-
sion. All symbolic names specified for a destination (except default)
or gateway are looked up in the hosts database using
gethostbyname(3N). If this lookup fails, then the name is looked up in
the networks database using getnetbyname(3N).
Page 1 Reliant UNIX 5.44 Printed 11/98
route(1M) route(1M)
The nc parameter [sets the RTFNOCHECKSUM flag; see routing(4)] is
only used when defining a new route. It indicates to the system kernel
that the described route is secure and also ensures that checksums for
udp packets are not formed when sending data packets to the named tar-
get which accelerates data transfer.
OPTIONS
-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 gateway entries 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.
EXAMPLE
To add a route entry with netmask 0xfffe0000:
route netmask 0xfffe0000 add net 181.160.0.0 139.22.228.9 1
DIAGNOSTICS
add [host | net] destination: gateway gateway
The specified route is being added to the tables. The values
printed are from the routing table entry supplied in the ioctl(2)
call.
delete [host | net] destination: gateway gateway
The specified route is being deleted.
destination 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. Give the next-hop gateway
instead.
not in table
A delete operation was attempted for an entry that is not in the
table.
routing table overflow
An add operation was attempted, but the system was unable to
allocate memory to create the new entry.
FILES
/etc/inet/hosts
/etc/inet/networks
Page 2 Reliant UNIX 5.44 Printed 11/98
route(1M) route(1M)
SEE ALSO
netstat(1M), routed(1M), ioctl(2), gethostbyname(3N),
getnetbyname(3N), routing(4).
Page 3 Reliant UNIX 5.44 Printed 11/98