ROUTE (1M)ROUTE

NAME

route manipulate the routing tables

SYNOPSIS

route flush [<nethost>]

route add [<nethost>] destination gateway metric [netmask value] [mtu value] route delete [<nethost>] destination gateway

DESCRIPTION

Route is used to manipulate the network routing tables used by ip to determine which local network interface should be used to transmit a packet.

The flush command will remove all gateway routes (see netstat(1)) from the tables. If the optional net or host keywords is used, only gateway routes of those type will be removed.

The optional keywords net and host force the destination of the route to be interpreted as a network or host, respectively. If neither option is specified, the Inter- net address of the destination is used to determine the type. The destination will be interpreted as a network if the host part of the Internet address is INADDR_ANY or the address matches an entry in the networks database (see networks(4)). Other- wise, the destination is presumed to be a host.

Destination is the name or Internet address of the host or network to which the route leads. The destination default will match any host or network address, the default route is used for outbound packets to any destination for which a more specific route does not exist.

Gateway is the name or Internet address of the gateway through which packets intended for the destination should be routed.

Metric is the number of hops from the local host to the destination. The metric between the local host and another host on the local network will be zero. If the route is to a destination connected through a gateway, the metric will be greater than zero.

Netmask can be used when installing network routes. Value can be represented in any of the normal forms associated with network masks. The netmask is applied to the destination address when IP is looking for network routes.

Mtu and it's value allow the route to have a maximum transmission unit (MTU) associated with the route to destination. Value must be less than or equal to the MTU associated with the network interface used to get to gateway (see netstat(1) -i). If the mtu option is not given when installing a route, IP will default the route MTU to the network interface MTU used to get to gateway. The route MTU is given to TCP when TCP asks IP for the Maximum Segment Size (MSS) it should use when communicating with destination.

Only the superuser can modify the routing tables. The command netstat -rwill display the current routing tables.

E-40

Issue 3