UNIX System Administration Handbook - Evi Nemeth [186]
In general, we recommend using your vendor’s standard system if possible. It’s tempting to just “fix” things that get in your way, but UNIX is a delicate ecosystem, and it is vulnerable to unintended side effects, especially while booting.
Chapter 2 describes the succulent details of our example systems’ booting procedures. In the next four sections, we simply summarize the chores that are related to configuring a network. Our example systems configure the loopback interface automatically; you should never need to modify that part of the configuration. Beyond that, each system is different.
UNIX vendors are serious sufferers of the “not invented here” syndrome. They mess with and rename configuration files all the time, never realizing (or caring?) that they are not the only ones who write code that depends on the format of these files. Table 13.15 lists the files you must touch to set a machine’s hostname and IP address on our example systems.
Table 13.15 Network configuration files by system
a. In Solaris 8 and later, /etc/inet/ipnodes will replace /etc/hosts. It can contain both IPv4 addresses and IPv6 addresses. /etc/hosts will survive for a while for legacy reasons.
b. Relative to /etc/sysconfig
Two files are common to all operating systems: /etc/hosts and /etc/resolv.conf; we listed these once at the beginning of the table instead of with each individual operating system. We also omitted the service switch files; see Table 13.14 on page 305 for a summary of those.
After changing one of these files, you may need to reboot or bring the network interface down and back up again for your change to take effect.
In the next four sections, we cover the details of network configuration for each of our supported operating systems. In particular, we cover:
• Basic configuration
• Examples
• DHCP client configuration
• Dynamic reconfiguration and tuning
• Security, firewalls, filtering, and NAT configuration
• PPP configuration
• Quirks
Not all of our operating systems need sections for each topic, although they all have a quirks section!
13.12 SOLARIS NETWORK CONFIGURATION
Solaris comes with a bounteous supply of startup scripts. At a recent trade show, we scored a tear-off calendar with sysadmin trivia questions on each day’s page. The question for January 1 was to name all the files you had to touch to change the hostname and IP address of a machine running Solaris and a machine running SunOS. A quick peek at the answers showed six files for Solaris. This is modularization taken to bizarre extremes. That said, let’s look at Solaris network configuration.
Basic network configuration for Solaris
Solaris stashes some network configuration files in /etc and some in /etc/inet. Many are duplicated through the magic of symbolic links, with the actual files living in /etc/inet and the links in /etc.
To set the hostname, enter it into the file /etc/nodename. The change will take effect when the machine is rebooted. Some sites use just the short hostname; others use the fully qualified domain name. NIS+ may have trouble with fully qualified names in the nodename file.
See page 530 for more information about NIS+.
The /etc/defaultdomain file’s name suggests that it might be used to specify the DNS domain, but it actually specifies the NIS or NIS+ domain name. The DNS domain is specified in /etc/resolv.conf.
See page 523 for more information about the name service switch.
Solaris uses /etc/nsswitch.conf to set the order in which /etc/hosts, NIS, NIS+, and DNS are consulted for hostname resolution. We recommend looking at the hosts file, then DNS for easy booting, but that contradicts Sun’s recommendations. The line from nsswitch.conf would be: