gateways File Format for TCP/IP

Purpose

Specifies Internet routing information to the routed daemon on a network.

Description

The /etc/gateways file identifies gateways for the routed daemon. Ordinarily, the daemon queries the network and builds routing tables. The daemon builds the tables from routing information transmitted by other hosts directly connected to the network. Gateways that the daemon cannot identify through its queries are known as distant gateways. Such gateways should be identified in the gateways file, which the routed daemon reads when it starts.

The general format of an entry (contained on a single line) in the gateways file is:

Following is a brief description of each element in an gateways file entry:

Item Description
Destination A keyword that indicates whether the route is to a network or a specific host. The two possible keywords are net and host.
Name1 The name associated with Destination. The Name1 variable can be either a symbolic name (as used in the /etc/hosts or /etc/networks file) or an Internet address specified in dotted-decimal format.
gateway An indicator that the following string identifies the gateway host.
Name2 The name or address of the gateway host to which messages should be forwarded.
metric An indicator that the next string represents the hop count to the destination host or network.
Value The hop count, or number of gateways from the local network to the destination network.
Type A keyword that indicates whether the gateway should be treated as active, passive, or external. The three possible keywords are:
active An active gateway is treated like a network interface. That is, the gateway is expected to exchange Routing Information Protocol (RIP) information. As long as the gateway is active, information about it is maintained in the internal routing tables. This information is included with any routing information transmitted through RIP. If the gateway does not respond for a period of time, the associated route is deleted from the internal routing tables.
passive A passive gateway is not expected to exchange RIP information. Information about the gateway is maintained in the routing tables indefinitely and is included with any routing information transmitted through RIP.
external An external gateway is identified to inform the routed daemon that another routing process will install such a route and that alternative routes to that destination should not be installed. Information about external gateways is not maintained in the internal routing tables and is not transmitted through RIP.
Note: These routes must be to networks.

Examples

  1. To specify a route to a network through a gateway host with an entry in the gateways file, enter a line in the following format:
    net net2 gateway host4 metric 4 passive
    This example specifies a route to a network, net2, through the gateway host4. The hop count metric to net2 is 4 and the gateway is treated as passive.
  2. To specify a route to a host through a gateway host with an entry in the gateways file, enter a line in the following format:
    host host2 gateway host4 metric 4 passive
    This example specifies a route to a host, host2, through the gateway host4. The hop count metric to host2 is 4 and the gateway is treated as passive.
  3. To specify a route to a host through an active Internet gateway with an entry in the gateways file, enter a line in the following format:
    host host10 gateway 192.100.11.5 metric 9 
    active
    This example specifies a route to a specific host, host10, through the gateway 192.100.11.5. The hop count metric to host10 is 9 and the gateway is treated as active
  4. To specify a route to a host through a passive Internet gateway with an entry in the gateways file, enter a line in the following format:
    host host10 gateway 192.100.11.5 metric 9 
    passive
  5. To specify a route to a network through an external gateway with an entry in the gateways file, enter a line in the following format:
    net net5 gateway host7 metric 11 external
    This example specifies a route to a network, net5, through the gateway host7. The hop count metric to net5 is 11 and the gateway is treated as external (that is, it is not advertised through RIP but instead through an unspecified routing protocol).

Files

Item Description
/usr/lpp/tcpip/samples/gateways Contains the sample gateways file, which also contains directions for its use.