Manual Page Result
0
Command: route | Section: 8 | Source: Digital UNIX | File: route.8.gz
route(8) System Manager's Manual route(8)
NAME
route - Manually manipulates the routing tables
SYNOPSIS
route [-nqvC] command odifiers] [args]
FLAGS
Prevents attempts to print host and network names symbolically when re-
porting actions. Causes additional details to be printed. Suppresses
all output. Forces route to use the old ioctl calls instead of the
current route server request path.
DESCRIPTION
The route command is a program used to manually manipulate the network
routing tables. It normally is not needed, as a system routing table
management daemon, such as gated or routed, should tend to this task.
The route command accepts five commands: Adds a route. Removes all
routes. Deletes a specific route. Changes aspects of a route (such as
its gateway). Reports any changes to the routing information base,
routing lookup misses, or suspected network partionings.
The monitor command has the syntax: route [-n] monitor
The flush command has the syntax: route [-n] flush [family] where the
address family may be specified by the -inet keyword.
The other commands have the following syntax: route [-n] [-C] command
[-net|-host] destination[/bitmask]
gateway modifier [-netmask mask] where destination is the destina-
tion host or network (with or without the optional Classless Inter-Do-
main Routing (CIDR) mask (/bitmask)), and gateway is the next hop and
gateway to which packets should be addressed. Routes to a particular
host are distinguished from those to a network by interpreting the In-
ternet 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 symbolic 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
-interface modifier should be specified; the gateway given is the ad-
dress of this host on the common network, indicating the interface to
be used for transmission.
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.
The optional modifiers -reject and -blackhole specify route behavior
different from a normal route. A normal route allows packets to be
forwarded out on it. Packets sent to reject routes are dropped and
messages designating the route as unreachable are sent to the packet
originators. Packets sent to blackhole routes are also dropped, but no
notification is sent to the packet originators. In both cases, you
must specify 127.0.0.1 (localhost) as the gateway argument.
The -netmask mask option specifies the subnet mask to use for the rout-
ing entry. Networks that use a nonstandard subnet must include this
option. Specify this option after any optional modifiers. Do not
specify this option if you specify a CIDR bitmask (/bitmask).
All symbolic names specified for a destination or gateway are looked up
first as a hostname using gethostbyname(3). If this lookup fails, get-
netbyname(3) is then used to interpret the name as that of a network.
The route command uses a routing socket and the new message types
RTM_ADD, RTM_DELETE, and RTM_CHANGE. As such, only the superuser 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 op-
tional keyword describing which address family.
EXAMPLES
To add gateway 128.32.0.130 as a default gateway, enter: route add
default 128.32.0.130 To add a route to host milan via gateway
128.32.0.130, enter: route add -host milan 128.32.0.130 -hop-
count 2 where 2 is the distance in hops to the host. To delete an ex-
isting route 128.32.0.130 to host milan, enter: route delete -host
milan 128.32.0.130 To add a route to network 212.232.32 via gateway
128.32.0.130, enter: route add -net 212.232.32/22 128.32.0.130
The previous example aggregates routes for four Class C networks:
212.232.32, 212.232.33, 212.232.34, and 212.232.35.
DIAGNOSTICS
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. As above, but when deleting an
entry. When the -f flag is specified, each routing table entry deleted
is indicated with a message of this form. The gateway value is incor-
rect for creating reject and blackhole routes. The bitmask specified
is not in the range of 1 to 32, inclusive. The -netmask option was
specified together with a CIDR bitmask. An attempt to add a route
failed because the gateway listed was not on a directly connected net-
work. The next hop gateway must be given. A delete operation was at-
tempted for an entry that was not present in the tables. An add opera-
tion was attempted, but the system was low on resources and was unable
to allocate memory to create the new entry.
FILES
Specifies the command path
RELATED INFORMATION
Commands: routed(8), gated(8)
Files: netintro(7) delim off
route(8)