Setting Up the Network

During the installation of the operating system, you’ll use the Solaris software installation program to configure your network. The following are the network configuration files set up by the Solaris installation program:

/etc/hostname.interface

/etc/nodename

/etc/defaultdomain

/etc/inet/hosts

/etc/defaultrouter

/etc/hostname.interface

This file defines the network interfaces on the local host. At least one /etc/ hostname.<interface> file should exist on the local machine. The Solaris installation program creates this file for you. In the filename, <interface> is replaced by the device name of the primary network interface.

The file contains only one entry: the hostname or IP address associated with the network interface. For example, suppose le0 is the primary network interface for a machine called system1. The file would be called /etc/hostname.le0, and the file would contain the entry system1.

/etc/nodename

This file should contain one entry: the hostname of the local machine. For example, on a computer named xena, the file /etc/nodename would contain the entry xena.

/etc/defaultdomain

This file is present only if your network uses a name service (described later in this chapter). This file should contain one entry: the fully qualified domain name of the administrative domain to which the local host’s network belongs. You can supply this name to the Solaris installation program or edit the file at a later date.

For example, if the host is part of the domain pyramid, which is classified as a .com domain, /etc/defaultdomain should contain the entry pyramid.com.

/etc/inet/hosts

The hosts database contains details of the machines on your network. This file contains the hostnames and IP addresses of the primary network interface and any other network addresses the machine must know about. When a user enters a command such as ping xena, the system needs to know how to get to the host named xena. The /etc/hosts file provides a cross-reference to look up and find xena’s network IP address. For compatibility with BSD-based operating systems, the file /etc/hosts is a symbolic link to /etc/inet/hosts.

Each line in the /etc/inet/hosts file uses the following format:

<address> <hostname> <nickname> [#comment] 

Each field in this syntax is described in Table 21.6.

Table 21.6. /etc/inet/hosts File Format
Field Description
<address> The IP address for each interface the local host must know about.
<hostname> The hostname assigned to the machine at setup and the hostnames assigned to additional network interfaces that the local host must know about.
<nickname> An optional field containing a nickname or alias for the host. More than one nickname can exist.
[# comment] An optional field where you can include a comment.

When you run the Solaris installation program on a system, it sets up the initial /etc/inet/hosts file. This file contains the minimum entries that the local host requires: its loopback address, its IP address, and its hostname.

For example, the Solaris installation program might create the following entries in the /etc/inet/hosts file for a system called xena:

127.0.0.1       localhost         loghost    #loopback address 
192.9.200.3     xena                         #host name 

In the /etc/inet/hosts file for machine xena, the IP 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 operating system, through the ifconfig command, uses the loopback address for configuration and testing. Every machine on a TCP/IP network must have an entry for the localhost and must use the IP address 127.0.0.1.

If you’ve already installed your operating system and answered “no” to installing a network, you can either edit the network configuration files manually or reissue the network configuration portion of the installation program.

To reissue the program portion, you must first be superuser. Then type sys-unconfig at the command line to restore the system’s configuration to an “as-manufactured” state. After you run the command, the system starts up again and prompts you for the system information described in Table 21.7.

Table 21.7. System Information
Information Action
Hostname Input a unique name for the computer.
Name service Select NIS, NIS+, DNS, or NONE (in which case a local file will be used).
Time zone Input your local time zone.
IP address Input the unique IP address for this host.
IP subnet mask Input the subnet mask if your network uses one.
Root password Enter a root password.

When the system is finished prompting you for input, it continues the startup process. When the system is started, the network has been configured.

/etc/defaultrouter

This file is present only when you need to define a router for a host. The /etc/defaultrouter file should contain an entry for each router directly connected to the network. The entry should be the name for the network interface that functions as a router between networks.

Note

Chapter 16 covered network security. If necessary, refer to that discussion of configuring the network security files /etc/hosts.equiv and /.rhosts.


..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset