HP-UX Reference (11i v1 05/09) - 1M System Administration Commands N-Z (vol 4)
r
route(1M) route(1M)
network route.
destination (inet only) The destination host system where the packets will be routed. destination
can be one of the following:
• A host name (the official name or an alias, see gethostent(3N)).
• A network name (the official name or an alias, see getnetent(3N)).
• An Internet address in "dot" notation (see inet(3N)).
• The keyword
default, which signifies the wildcard gateway route (see rout-
ing(7)).
v6destination (inet6 only) The destination host system where the packets will be routed.
v6destination can be one of the following:
• A host name (the official name or an alias, see getipnodebyname(3N)).
• An IPv6 address in "colon" notation (see inet6(3N)).
• The keyword
default, which signifies the wildcard gateway route.
prefix (inet6 only) The prefix is an integer between 0 and 128 inclusive. It specifies how
many of the leftmost contiguous bits of the v6destination address comprise the prefix.
Its format is similar to the CIDR notation in IPv4. A prefix of 0 would be a default
route. If the prefix is omitted when adding a network route, then the prefix would be
64 by default. It is advisable to specify the prefix when an IPv6 network route is
added. The prefix option can be applied to network routes only.
netmask
mask (inet only) The mask that will be bit-wise ANDed with destination to yield a net
address where the packets will be routed. mask can be specified as a single hexade-
cimal number with a leading 0x, with a "dot-notation" Internet address, or with a
pseudo-network name listed in the network table (see networks(4)). The length of the
mask, which is the number of contiguous 1’s starting from the left-most bit position of
the 32-bit field, can be shorter than the default network mask for the destination
address. (see routing(7)). If the netmask option is not given, mask for the route will
be derived from the netmasks associated with the local interfaces. (see ifconfig(1M)).
mask will be defaulted to the longest netmask of those local interfaces that have the
same network address. If there is not any local interface that has the same network
address, then mask will default to the default value of network mask of destination.
gateway (inet only) The gateway through which the destination is reached. gateway can be one
of the following:
• A host name (the official name or an alias, see gethostent(3N)).
• An Internet address in "dot" notation (see inet(3N)).
v6gateway (inet6 only) The gateway through which the destination is reached. v6gateway can be
one of the following:
• A host name (the official name or an alias, see getipnodebyname(3N)).
• An IPv6 address in "colon" notation (see inet6(3N)).
count An integer that indicates whether the gateway is a remote host or the local host. If
the route leads to a destination through a remote gateway, count should be a number
greater than 0. If the route leads to destination and the gateway is the local host,
count should be 0. The default for count is zero. The result is not defined if count is
negative.
Operation
All symbolic names specified for a destination or gateway are looked up first as a host name using
gethostbyname() for IPv4 and getaddrinfo()
for IPv6; if the host name is not found, the destina-
tion is searched for as a network name using
getnetbyname() for IPv4 only. destination and gateway
can be in "dot" notation (see inet(3N)). v6destination and v6gateway can be in "colon" notation (see
inet6(3N)).
If the
-n option is not specified, any host and network addresses are displayed symbolically according to
the name returned by gethostbyaddr() and getnetbyaddr(), respectively, except for the default
network address (printed as default) and addresses that have unknown names. Addresses with
unknown names are printed in Internet "dot" notation (see inet(3N)).
HP-UX 11i Version 1: September 2005 − 2 − Hewlett-Packard Company Section 1M−−775