route

This diagnostic command manipulates network routing tables.

Syntax

route [-f] [command [destination] [MASK netmask] [gateway]]

Parameters

-f

Clears the routing tables of all gateway entries. If this parameter is used in conjunction with one of the commands, the tables are cleared prior to running the command.

command

Specifies one of four commands.

Command

Purpose

print

Prints a route

add

Adds a route

delete

Deletes a route

change

Modifies an existing route


destination

Specifies the host to send command.

MASK

Specifies, if present, that the next parameter be interpreted as the netmask parameter.

netmask

Specifies, if present, the subnet mask value to be associated with this route entry. If not present, this parameter defaults to 255.255.255.255.

gateway

Specifies the gateway.

Notes

The route utility does not accept a subnet mask value of 255.255.255.255 on the command line. To specify a subnet mask with this value, you must accept the default.

On a multihomed computer on which a network is available from more than one adapter card, all network traffic is passed over the first gateway defined. If you add a second gateway to the same network, the entry is added to the route table, but it is never used.

The route utility uses the NETWORKS file to convert destination names to addresses. For the route utility to work correctly, the network numbers in the NETWORKS file must specify all four octets in dotted decimal notation. For example, a network number of 284.122.107 must be specified in the NETWORKS file as 284.122.107.0, with trailing zeroes appended.