When you run the Solaris installation program on a machine, it sets up the initial /etc/inet/hosts file. This file contains the minimum entries that the local host requires: its loopback address, its IPv4 address, and its host name.
For example, the Solaris installation program might create the following /etc/inet/hosts file for machine tenere shown in Figure 6-1:
127.0.0.1 localhost loghost #loopback address 192.9.200.3 tenere #host name |
In Example 7-1, the IPv4 address 127.0.0.1 is the loopback address, the reserved network interface used by the local machine to allow interprocess communication so that it sends packets to itself. The ifconfig command uses the loopback address for configuration and testing, as explained in "ifconfig Command". Every machine on a TCP/IP network must use the IP address 127.0.0.1 for the local host.
The IPv4 address 192.9.200.1 and the name tenere are the address and host name of the local machine. They are assigned to the machine's primary network interface.
Some machines have more than one network interface, because they ar eeither routers or multihomed hosts. Each additional network interface attached to the machine requires its own IPv4 address and associated name. When you configure a router or multihomed host, you must add this information manually to the router's /etc/inet/hosts file. (See "Configuring Routers" for more information on setting up routers and multihomed hosts.)
Example 7-2 is the /etc/inet/hosts file for machine timbuktu shown in Figure 6-1.
127.0.0.1 localhost loghost 192.9.200.70 timbuktu #This is the local host name 192.9.201.10 timbuktu-201 #Interface to network 192.9.201 |
With these two interfaces, timbuktu connects networks 192.9.200 and 192.9.201 as a router.