System Administration Guide: IP Services

Initial /etc/inet/hosts File

When you run the Oracle Solaris installation program on a system, the program configures the initial /etc/inet/hosts file. This file contains the minimum entries that the local host requires. The entries include the loopback address, the host IPv4 address, and the host name.

For example, the Oracle Solaris installation program might create the following /etc/inet/hosts file for system tenere shown in Figure 5–1:

Example 10–1 /etc/inet/hosts File for System tenere     localhost         loghost    #loopback address   tenere                      #host name

Loopback Address

In Example 10–1, the IPv4 address is the loopback address. The loopback address is the reserved network interface that is used by the local system to allow interprocess communication. This address enables the host to send packets to itself. The ifconfig command uses the loopback address for configuration and testing, as explained in Monitoring the Interface Configuration With the ifconfig Command. Every system on a TCP/IP network must use the IP address for IPv4 loopback on the local host.

Host Name

The IPv4 address and the name tenere are the address and host name of the local system. They are assigned to the system's primary network interface.

Multiple Network Interfaces

Some systems have more than one network interface, because they are either routers or multihomed hosts. Each network interface that is attached to the system requires its own IP address and associated name. During installation, you must configure the primary network interface. If a particular system has multiple interfaces at installation time, the Oracle Solaris installation program also prompts you about these additional interfaces. You can optionally configure one or more additional interfaces at this time, or manually, at a later date.

After the Oracle Solaris installation, you can configure additional interfaces for a router or multihomed host by adding interface information to the systems' /etc/inet/hosts file. For more information on configuring routers and multihomed hosts refer to Configuring an IPv4 Router and Configuring Multihomed Hosts.

Example 10–2 shows the /etc/inet/hosts file for system timbuktu that is shown in Figure 5–1.

Example 10–2 /etc/inet/hosts File for System timbuktu        localhost     loghost   timbuktu      #This is the local host name   timbuktu-201  #Interface to network 192.9.201

With these two interfaces, timbuktu connects networks 192.168.200 and 192.168.201 as a router.