TCP/IP and Data Communications Administration Guide

Chapter 4 Configuring TCP/IP on the Network

The second phase of network administration involves setting up the network. This consists of assembling the hardware which makes up the physical part of the network, and configuring TCP/IP. This chapter explains how to configure TCP/IP, including:

Before You Configure TCP/IP

Before configuring the TCP/IP software, you should have:

  1. Designed the network topology, if you are the network designer. (See "Network Topology" for details.)

  2. Obtained a network number from your Internet addressing authority. (See "Network Classes".)

  3. Assembled the network hardware according to the topology designed and assured that the hardware is functioning. (See the hardware manuals and "Network Topology".)

  4. Run any configuration software required by network interfaces and routers, if applicable. (See Chapter 3, Planning Your Network, and Chapter 5, Configuring Routers, for information on routers. If you have purchased network interfaces for your machines, refer to the manuals that came with them for software configuration requirements.)

  5. Planned the IP addressing scheme for the network, including subnet addressing, if applicable. (See "Designing Your IP Addressing Scheme".)

  6. Assigned IP numbers and host names to all machines involved in the network. (See "Designing Your IP Addressing Scheme".)

  7. Determined which name service your network uses: NIS, NIS+, DNS, or local files. (See Solaris Naming Administration Guide.)

  8. Selected domain names for your network, if applicable. (See Solaris Naming Administration Guide.)

  9. Installed the operating system on at least one machine on the prospective network. (See Solaris Advanced Installation Guide.)

Determining Host Configuration Modes

One of your key functions as a network administrator is configuring TCP/IP to run on hosts and routers (if applicable). You can set up these machines to obtain configuration information from two sources: files on the local machine or files located on other machines on the network. Configuration information includes:

A machine that obtains TCP/IP configuration information from local files is said to be operating in local files mode. A machine that obtains TCP/IP configuration information from a remote machine is said to be operating in network client mode.

Machines That Should Run in Local Files Mode

To run in local files mode, a machine must have local copies of the TCP/IP configuration files. These files are described in "TCP/IP Configuration Files". The machine should have its own disk, though this is not strictly necessary.

Most servers should run in local file mode. This requirement includes:

Additionally, routers should run in local files mode.

Machines that exclusively function as print servers do not need to run in local files mode. Whether individual hosts should run in local files mode depends on the size of your network.

If you are running a very small network, the amount of work involved in maintaining these files on individual hosts is manageable. If your network serves hundreds of hosts, the task becomes difficult, even with the network divided into a number of administrative subdomains. Thus, for large networks, using local files mode is usually less efficient. On the other hand, because routers and servers must be self-sufficient, they should be configured in local files mode.

Network Configuration Servers

Network configuration servers are the machines that supply the TCP/IP configuration information to hosts configured in network client mode. These servers support three booting protocols:

Network configuration servers can also can function as NFS file servers.

If you are going to configure any hosts as network clients, then you must also configure at least one machine on your network as a network configuration server. If your network is subnetted, then you must have at least one network configuration server for each subnet with network clients.

Machines That Are Network Clients

Any host that gets its configuration information from a network configuration server is said to be "operating" in network client mode. Machines configured as network clients do not require local copies of the TCP/IP configuration files.

Network client mode greatly simplifies administration of large networks. It minimizes the number of configuration tasks that must be performed on individual hosts and assures that all machines on the network adhere to the same configuration standards.

You can configure network client mode on all types of computers, from fully standalone systems to diskless and dataless machines. Although it is possible to configure routers and servers in network client mode, local files mode is a better choice for these machines. Routers and servers should be as self-sufficient as possible.

Diskless Booting

Setting up systems for diskless booting is described in the System Administration Guide.

Mixed Configurations

Due to the flexibility of the system, configurations are not limited to either an all-local-hosts mode or an all-network-client mode. The configuration of routers and servers typifies this, in that routers and servers should always be configured in local mode. For hosts, you can use any combination of local and network client mode you want.

Sample Network

Figure 4-1 shows the hosts of a fictional network with the network number 192.9.200. The network includes one network configuration server, the machine sahara. It serves the diskless client ahaggar. Machines tenere and nubian have their own disks and run in local files mode. Machine faiyum also has a disk but operates in network client mode.

Finally, the machine timbuktu is configured as a router. It includes two network interfaces, one named timbuktu on network 192.9.200 and one named timbuktu-201 on network 192.9.201. Both networks are in the organizational domain deserts.worldwide.com. The domain uses local files as its name service.

Most examples in this chapter use the network shown in Figure 4-1 as their basis.

Figure 4-1 Hosts in a Sample Network

Graphic

TCP/IP Configuration Files

Each machine on the network gets its TCP/IP configuration information from the following TCP/IP configuration files and network databases:

The Solaris installation program creates these files as part of the installation process. You can also edit the files manually, as explained in this section. The hosts and netmasks databases are two of the network databases read by the name services available on Solaris networks. "Network Databases and nsswitch.conf File" describes the concept of network databases in detail.

/etc/hostname.interface File

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 file name, interface is replaced by the device name of the primary network interface.

The file contains only one entry: the host name or IP address associated with the network interface. For example, suppose smc0 is the primary network interface for a machine called ahaggar. Its /etc/hostname.interface file would have the name /etc/hostname.smc0; the file would contain the entry ahaggar.

For Multiple Network Interfaces

If a machine contains more than one network interface, you must create additional /etc/hostname.interface files for the additional network interfaces. You must create these files with a text editor; the Solaris installation program does not create them for you.

For example, consider the machine timbuktu shown in Figure 4-1. It has two network interfaces and functions as a router. The primary network interface le0 is connected to network 192.9.200. Its IP address is 192.9.200.70, and its host name is timbuktu. The Solaris installation program creates the file /etc/hostname.le0 for the primary network interface and enters the host name timbuktu in the file.

The second network interface is le1; it is connected to network 192.9.201. Although this interface is physically installed on machine timbuktu, it must have a separate IP address. Therefore, you have to manually create the /etc/hostname.le1 file for this interface; the entry in the file would be the router`s name, timbuktu-201.

/etc/nodename File

This file should contain one entry: the host name of the local machine. For example, on machine timbuktu, the file /etc/nodename would contain the entry timbuktu.

/etc/defaultdomain File

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.

In Figure 4-1, the networks are part of the domain deserts.worldwide, which was classified as a .com domain. Therefore, /etc/defaultdomain should contain the entry deserts.worldwide.com. For more information on network domains, refer to the Solaris Naming Administration Guide.

/etc/defaultrouter File

This 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.

In Figure 4-1, the network interface le1 connects machine timbuktu with network 192.9.201. This interface has the unique name timbuktu-201. Thus, the machines on network 192.9.200 that are configured in local files mode have the name timbuktu-201 as the entry in /etc/defaultrouter.

hosts Database

The hosts database contains the IP addresses and host names of machines on your network. If you use the NIS, NIS+, or DNS name services, the hosts database is maintained in a database designated for host information. For example, on a network running NIS+, the hosts database is maintained in the host table.

If you use local files for name service, the hosts database is maintained in the /etc/inet/hosts file. This file contains the host names and IP addresses of the primary network interface, other network interfaces attached to the machine, and any other network addresses that the machine must know about.


Note -

For compatibility with BSD-based operating systems, the file /etc/hosts is a symbolic link to /etc/inet/hosts.


/etc/inet/hosts File Format

The /etc/inet/hosts file uses this basic syntax: (Refer to the hosts(4) man page for complete syntax information.)

IP-address hostname [nicknames] [#comment]

IP-address contains the IP address for each interface that the local host must know about.

hostname contains the host name assigned to the machine at setup, plus the host names assigned to additional network interfaces that the local host must know about.

[nickname] is an optional field containing a nickname for the host.

[# comment] is an optional field where you can include a comment.

Initial /etc/inet/hosts File

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 IP address, and its host name.

For example, the Solaris installation program might create the following /etc/inet/hosts file for machine ahaggar shown in Figure 4-1:


Example 4-1 /etc/inet/hosts File for Machine ahaggar


127.0.0.1     localhost         loghost    #loopback address
192.9.200.3   ahaggar                      #host name

Loopback Address

In Example 4-1, 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 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.

Host Name

The IP address 192.9.200.3 and the name ahaggar are the address and host name of the local machine. They are assigned to the machine's primary network interface.

Multiple Network Interfaces

Some machines have more than one network interface, either because they are routers or multihomed hosts. Each additional network interface attached to the machine requires its own IP address and associated name. When you configure a router or multihomed host, you must manually add this information to the router's /etc/inet/hosts file. (See Chapter 5, Configuring Routers, for more information on setting up routers and multihomed hosts.)

Example 4-2 is the /etc/inet/hosts file for machine timbuktu shown in Figure 4-1.


Example 4-2 /etc/inet/hosts File for Machine timbuktu


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.

How Name Services Affect the hosts Database

The NIS, NIS+, and DNS name services maintain host names and addresses on one or more servers. These servers maintain hosts databases containing information for every host and router (if applicable) on the servers' network. Refer to the Solaris Naming Administration Guide for more information about these services.

When Local Files Provide Name Service

On a network using local files for name service, machines running in local files mode consult their individual /etc/inet/hosts files for IP addresses and host names of other machines on the network. Therefore, their /etc/inet/hosts files must contain the:

Example 4-3 shows the /etc/inet/hosts file for machine tenere, a machine that runs in local files mode. Notice that the file contains the IP addresses and host names for every machine on the 192.9.200 network. It also contains the IP address and interface name timbuktu-201, which connects the 192.9.200 network to the 192.9.201 network.

A machine configured as a network client uses the local /etc/inet/hosts file for its loopback address and IP address.


Example 4-3 /etc/inet/hosts File for Machine Running in Local Files Mode

Graphic

netmasks Database

You need to edit the netmasks database as part of network configuration only if you have set up subnetting on your network. The netmasks database consists of a list of networks and their associated subnet masks.


Note -

When you create subnets, each new network must be a separate physical network. You cannot apply subnetting to a single physical network.


What is Subnetting

Subnetting is a method for getting the most out of the limited 32-bit IP addressing space and reducing the size of the routing tables in a large internetwork. With any address class, subnetting provides a means of allocating a part of the host address space to network addresses, which lets you have more networks. The part of the host address space allocated to new network addresses is known as the subnet number.

In addition to making more efficient use of the IP address space, subnetting has several administrative benefits. Routing can become very complicated as the number of networks grows. A small organization, for example, might give each local network a class C number. As the organization grows, administering a number of different network numbers could become complicated. A better idea is to allocate a few class B network numbers to each major division in an organization. For instance, you could allocate one to Engineering, one to Operations, and so on. Then, you could divide each class B network into additional networks, using the additional network numbers gained by subnetting. This can also reduce the amount of routing information that must be communicated among routers.

Creating the Network Mask

As part of the subnetting process, you need to select a network-wide netmask. The netmask determines how many and which bits in the host address space represent the subnet number and how many and which represent the host number. Recall that the complete IP address consists of 32 bits. Depending on the address class, as many as 24 bits and as few as 8 bits can be available for representing the host address space. The netmask is specified in the netmasks database.

If you plan to use subnets, you must determine your netmask before you configure TCP/IP. You then need to carry out the procedures in "How to Add a Subnet to a Network". If you plan to install the operating system as part of network configuration, the Solaris installation program requests the netmask for your network.

As described in "Parts of the IP Address", 32-bit IP addresses consist of a network part and a host part. The 32 bits are divided into 4 bytes. Each byte is assigned either to the network number or the host number, depending on the network class.

For example, in a class B IP address, the 2 left-hand bytes are assigned to the network number, and the 2 right-hand bytes are assigned to the host number. In the class B IP address 129.144.41.10, you can assign the 2 right-hand bytes to hosts.

If you are going to implement subnetting, you need to use some of the bits in the bytes assigned to the host number to apply to subnet addresses. For example, a 16-bit host address space provides addressing for 65,534 hosts. If you apply the third byte to subnet addresses and the fourth to host addresses, you can address up to 254 networks, with up to 254 hosts on each.

The bits in the host address bytes that will be applied to subnet addresses and those applied to host addresses is determined by a subnet mask. Subnet masks are used to select bits from either byte for use as subnet addresses. Although netmask bits must be contiguous, they need not align on byte boundaries.

The netmask can be applied to an IP address using the bitwise logical AND operator. This operation selects out the network number and subnet number positions of the address.

It is easiest to explain netmasks in terms of their binary representation. You can use a calculator for binary-to-decimal conversion. The following examples show both the decimal and binary forms of the netmask.

If a netmask 255.255.255.0 is applied to the IP address 129.144.41.101, the result is the IP address of 129.144.41.0.

129.144.41.101 & 255.255.255.0 = 129.144.41.0

In binary form, the operation is:

10000001.10010000.00101001.01100101 (IP address)

ANDed with

11111111.11111111.11111111.00000000 (netmask)

Now the system looks for a network number of 129.144.41 instead of a network number of 129.144. If you have a network with the number 129.144.41, that is what the system looks for and finds. Since you can assign up to 254 values to the third byte of the IP address space, subnetting lets you create address space for 254 networks, where previously there was room for only one.

If you want to provide address space for only two additional networks, you could use a subnet mask of:

255.255.192.0

This netmask provides a result of:

11111111.11111111.1100000.00000000

This still leaves 14 bits available for host addresses. Since all 0s and 1s are reserved, at least two bits must be reserved for the host number.

Editing the /etc/inet/netmasks File

If your network runs NIS or NIS+, the servers for these name services maintain netmasks databases. For networks that use local files for name service, this information is maintained in the /etc/inet/netmasks file.


Note -

For compatibility with BSD-based operating systems, the file /etc/netmasks is a symbolic link to /etc/inet/netmasks.


Example 4-4 shows the /etc/inet/netmasks file for a class B network.


Example 4-4 /etc/inet/netmasks File for a Class B Network


## The netmasks file associates Internet Protocol (IP) address
 # masks with IP network numbers.
 #
 # 	network-number	netmask
 #
 # Both the network-number and the netmasks are specified in
 # "decimal dot" notation, e.g:
 #
 #        128.32.0.0   255.255.255.0
          129.144.0.0  255.255.255.0

If the file does not exist, create it. Use the following syntax:

network-number	netmask-number

Refer to the netmasks(4) man page for complete details.

When creating netmask numbers, type the network number assigned by the InterNIC (not the subnet number) and netmask number in /etc/inet/netmasks. Each subnet mask should be on a separate line.

For example:


128.78.0.0	    255.255.248.0

You can also type symbolic names for network numbers in the /etc/inet/hosts file. You can then use these network names instead of the network numbers as parameters to commands.

How to Add a Subnet to a Network

If you are changing from a network that does not use subnets to one that is subnetted, perform the following steps:

  1. Decide on the new subnet topology, including considerations for routers and locations of hosts on the subnets.

  2. Assign all subnet and host addresses.

  3. Modify the /etc/inet/netmasks file, if you are manually configuring TCP/IP, or supply the netmask to the Solaris installation program.

  4. Modify the /etc/inet/hosts files on all hosts to reflect the new host addresses.

  5. Reboot all machines.

Network Databases and nsswitch.conf File

The network databases are files that provide information needed to configure the network. The network databases are:

As part of the configuration process, you edit the hosts database and the netmasks database, if your network is subnetted. Two network databases, bootparams and ethers, are used to configure machines as network clients. The remaining databases are used by the operating system and seldom require editing.

Although it is not a network database, the nsswitch.conf file needs to be configured along with the relevant network databases. nsswitch.conf specifies which name service to use for a particular machine: NIS, NIS+, DNS, or local files.

How Name Services Affect Network Databases

Your network database takes a form that depends on the type of name service you select for your network. For example, the hosts database contains, at minimum, the host name and IP address of the local machine and any network interfaces directly connected to the local machine. However, the hosts database could contain other IP addresses and host names, depending on the type of name service on your network.

The network databases are used as follows:


Note -

DNS boot and data files do not correspond directly to the network databases.


Figure 4-2 shows the forms of the hosts database used by these name services:

Figure 4-2 Forms of the hosts Database Used by Name Services

Graphic

Table 4-1 lists the network databases and how they are used by local files, NIS+, and NIS.

Table 4-1 Network Databases and Corresponding Name Service Files

Network Database 

Local Files 

NIS+ Tables 

NIS Maps 

hosts

/etc/inet/hosts

hosts.ord_dir

hosts.byaddr hosts.byname

netmasks

/etc/inet/netmasks

netmasks.ord_dir

netmasks.byaddr

ethers

/etc/ethers

ethers.ord_dir

ethers.byname ethers.byaddr

bootparams

/etc/bootparams

bootparams.ord_dir

bootparams

protocols

/etc/inet/protocols

protocols.ord_dir

protocols.byname protocols.bynumber

services

/etc/inet/services

services.ord_dir

services.byname

networks

/etc/inet/networks

networks.ord_dir

networks.byaddr networks.byname

This book discusses network databases as viewed by networks using local files for name services. Information regarding the hosts database is in "hosts Database"; information regarding the netmasks database is in "netmasks Database". Refer to Solaris Naming Administration Guide for information on network databases correspondences in NIS, DNS, and NIS+.

nsswitch.conf File -- Specifying Which Name Service to Use

The /etc/nsswitch.conf file defines the search order of the network databases. The Solaris installation program creates a default /etc/nsswitch.conf file for the local machine, based on the name service you indicate during the installation process. If you selected the "None" option, indicating local files for name service, the resulting nsswitch.conf file resembles Example 4-5.


Example 4-5 nsswitch.conf for Networks Using Files for Name Service


# /etc/nsswitch.files:
#
# An example file that could be copied over to /etc/nsswitch.conf;
# it does not use any naming service.
#
# "hosts:" and "services:" in this file are used only if the
# /etc/netconfig file contains "switch.so" as a
# nametoaddr library for "inet" transports.

passwd:          files
group:           files
hosts:           files
networks:        files
protocols:       files
rpc:             files
ethers:          files
netmasks:        files	
bootparams:      files
publickey:       files
# At present there isn't a 'files' backend for netgroup; the
# system will figure it out pretty quickly,
# and won't use netgroups at all.
netgroup:        files
automount:       files
aliases:         files
services:        files
sendmailvars:    files

The nsswitch.conf(4) man page describes the file in detail. Its basic syntax is:

database name-service-to-search

The database field can list one of many types of databases searched by the operating system. For example, it could indicate a database affecting users, such as passwd or aliases, or a network database. The parameter name-service-to-search can have the values files, nis, or nis+ for the network databases. (The hosts database can also have dns as a name service to search.) You can also list more than one name service, such as nis+ and files.

In Example 4-5, the only search option indicated is files. Therefore, the local machine gets security and automounting information, in addition to network database information, from files located in its /etc and /etc/inet directories.

Changing nsswitch.conf

The /etc directory contains the nsswitch.conf file created by the Solaris installation program. It also contains template files for the following name services:

If you want to change from one name service to another, you can copy the appropriate template to nsswitch.conf. You can also selectively edit the nsswitch.conf file, and change the default name service to search for individual databases.

For example, on a network running NIS, you might have to change the nsswitch.conf file on diskless clients. The search path for the bootparams and ethers databases must list files as the first option, and nis. Example 4-6 shows the correct search paths.


Example 4-6 nsswitch.conf for a Diskless Client on a Network Running NIS


## /etc/nsswitch.conf:#
.
.
passwd:        files nis
group:         file nis

# consult /etc "files" only if nis is down.
hosts:         nis    [NOTFOUND=return] files
networks:      nis    [NOTFOUND=return] files
protocols:     nis    [NOTFOUND=return] files
rpc:           nis    [NOTFOUND=return] files
ethers:        files  [NOTFOUND=return] nis
netmasks:      nis    [NOTFOUND=return] files	
bootparams:    files  [NOTFOUND=return] nis
publickey:     nis    netgroup:         nis

automount:     files nis
aliases:       files nis

# for efficient getservbyname() avoid nis
services:      files nis
sendmailvars:  files

For complete details on the name service switch, refer to Solaris Naming Administration Guide.

bootparams Database

The bootparams database contains information used by diskless clients and machines configured to boot in the network client mode. You need to edit it if your network will have network clients. (See "Configuring Network Clients" for procedures.) The database is built from information entered into the /etc/bootparams file.

The bootparams(4) man page contains complete syntax for this database. Its basic syntax is

machine-name file-key-server-name:pathname

For each diskless or network client machine, the entry might contain the following information: the name of the client, a list of keys, the names of servers, and path names.

The first item of each entry is the name of the client machine. Next is a list of keys, names of servers, and path names, separated by tab characters. All items but the first are optional. The database can contain a wildcard entry that will be matched by all clients. Here is an example:


Example 4-7 bootparams Database


myclient   root=myserver : /nfsroot/myclient  \
swap=myserver : /nfsswap//myclient \
dump=myserver : /nfsdump/myclient

In this example the term dump=: tells diskless hosts not to look for a dump file.

Wildcard Entry for bootparams

In most cases, you will want to use the wildcard entry when editing the bootparams database to support diskless clients. This entry is:

*  root=server:/path dump=:

The asterisk (*) wildcard indicates that this entry applies to all clients not specifically named within the bootparams database.

ethers Database

The ethers database is built from information entered into the /etc/ethers file. It associates host names to their Ethernet addresses. You need to create an ethers database only if you are running the RARP daemon; that is, if you are configuring network clients or diskless machines.

RARP uses the file to map Ethernet addresses to IP addresses. If you are running the RARP daemon in.rarpd, you need to set up the ethers file and maintain it on all hosts running the daemon to reflect changes to the network.

The ethers(4) man page contains complete syntax information for this database. Its basic format is:

Ethernet-address hostname #comment

Ethernet-address is the Ethernet address of the host.

hostname is the official name of the host.

#comment is any kind of note you want to append to an entry in the file.

The equipment manufacturer provides the Ethernet address. If a machine does not display the Ethernet address when you power up, see your hardware manuals for assistance.

When adding entries to the ethers database, make sure that host names correspond to the primary names in the hosts database, not to the nicknames, as shown in Example 4-8.


Example 4-8 Entries in the ethers Database


8:0:20:1:40:16  fayoum
8:0:20:1:40:15  nubian 
8:0:20:1:40:7   sahara    # This is a comment
8:0:20:1:40:14  tenere 

Other Network Databases

The remaining network databases seldom need to be edited.

networks database

The networks database associates network names with network numbers, enabling some applications to use and display names rather than numbers. The networks database is based on information in the /etc/inet/networks file. It contains the names of all networks to which your network connects via routers.

The Solaris installation program sets up the initial networks database. The only time you need to update it is when you add a new network to your existing network topology.

The networks(4) man page contains full syntax information for /etc/inet/networks. Here is its basic format

network-name network-number nickname(s) # comment

network-name is the official name for the network.

network-number is the number assigned by the InterNIC.

nickname is any other name by which the network is known.

#comment is any kind of note you want to append to an entry in the file.

It is particularly important that you maintain the networks file. The netstat program uses the information in this database to produce status tables.

Example 4-9 shows a sample /etc/networks file:


Example 4-9 /etc/networks File


#ident	"@(#)networks	1.4	92/07/14 SMI"	/* SVr4.0 1.1	*/
#
# The networks file associates Internet Protocol (IP) network
numbers with network names. The format of this file is:
#
# 	network-name		 	 network-number		 	 nicnames . . .

# The loopback network is used only for intra-machine
communication
#loopback		 	 127

# Internet networks
#
arpanet     10	   arpa  # Historical
ucb-ether   46	   ucbether
#
# local networks

eng   193.9.0  #engineering
acc   193.9.1  #accounting
prog  193.9.2  #programming

protocols Database

The protocols database lists the TCP/IP protocols installed on your system and their numbers; the Solaris installation program automatically creates it. It is rare when this file requires administrative handling.

The protocols database contains the names of the TCP/IP protocols installed on the system. Its syntax is completely described in the protocols(4) man page. Example 4-10 shows an example of the /etc/inet/protocols file:


Example 4-10 /etc/inet/protocols File


#
# Internet (IP) protocols
#
ip    0   IP    # internet protocol, pseudo protocol number
icmp  1   ICMP  # internet control message protocol
tcp   6   TCP   # transmission control protocol
udp  17   UDP   # user datagram protocol

services Database

The services database lists the names of TCP and UDP services and their well known port numbers; it is used by programs that call network services. The Solaris installation automatically creates the services database; it generally requires no administrative handling.

The services(4) man page contains complete syntax information. Example 4-11 shows an excerpt from a typical /etc/inet/services file:


Example 4-11 /etc/inet/services File


#
# Network services
#
echo      7/udp
echo      7/tcp
discard   9/udp     sink null
discard   11/tcp
daytime   13/udp
daytime   13/tcp
netstat   15/tcp
ftp-data  20/tcp
ftp       21/tcp
telnet    23/tcp
time      37/tcp    timeserver
time      37/udp    timeserver
name      42/udp    nameserver
whois     43/tcp    nickname

Network Configuration Procedures

Network software installation takes place along with the installation of the operating system software. At that time, certain IP configuration parameters must be stored in appropriate files so they can be read at boot time.

The procedure is simply a matter of creating or editing the network- configuration files. How configuration information is made available to a machine's kernel depends on whether these files are stored locally (local files mode) or acquired from the network configuration server (network client mode).

Parameters supplied during network configuration are:

This chapter contains complete information on creating and editing local configuration files. See the Solaris Naming Administration Guide for information on working with name service databases.

How to Configure a Host for Local Files Mode

Use this procedure for configuring TCP/IP on a machine that run in local files mode.

  1. Become superuser and change to the /etc directory.

  2. Type the host name of the machine in the file /etc/nodename.

    For example, if the name of the host is tenere, type tenere in the file.

  3. Create a file named /etc/hostname.interface for each network interface.

    (The Solaris installation program automatically creates this file for the primary network interface.)

    Refer to "/etc/hostname.interface File" for complete details.

  4. Type either the interface IP address or the interface name in each /etc/hostname.interface file.

    For example, create a file named hostname.ie1, and type either the IP address of the host's interface or the host's name.

  5. Edit the /etc/inet/hosts file to add:

    1. IP addresses that you have assigned to any additional network interfaces in the local machine, along with the corresponding host name for each interface.

      The Solaris installation program will already have created entries for the primary network interface and loopback address.

    2. IP address or addresses of the file server, if the /usr file system is NFS mounted.


      Note -

      The Solaris installation program creates the default /etc/inet/hosts for the local machine. If the file does not exist, create it as shown in "hosts Database".


  6. Type the host's fully qualified domain name in the /etc/defaultdomain file.

    For example, suppose host tenere was part of the domain deserts.worldwide.com. Therefore, you would type: deserts.worldwide.com in /etc/defaultdomain. See "/etc/defaultdomain File" for more information.

  7. Type the router's name in /etc/defaultrouter.

    See "/etc/defaultrouter File" for information about this file.

  8. Type the name of the default router and its IP addresses in /etc/inet/hosts.

    Additional routing options are available. Refer to the discussion on routing options in "How to Configure Hosts for Network Client Mode". You can apply these options to a local files mode configuration.

  9. If your network is subnetted, type the network number and the netmask in the file /etc/inet/netmasks.

    If you have set up a NIS or NIS+ server, you can type netmask information in the appropriate database on the server as long as server and clients are on the same network.

  10. Reboot each machine on the network.

Setting Up a Network Configuration Server

If you plan to configure certain hosts as network clients, you must configure at least one machine on your network as a network configuration server. (Refer to "Network Configuration Servers" for an introduction.)

Setting up a network configuration server involves:

  1. Turning on the network configuration daemons:

    • in.tftpd

    • in.rarpd

    • rpc.bootparamd

  2. Editing and maintaining the network configuration files on the configuration server.

    "How to Set Up a Network Configuration Server" assumes that you have already set up the network configuration server for local files mode.

How to Set Up a Network Configuration Server

  1. Become superuser and change to the root directory of the prospective network configuration server.

  2. Turn on the in.tftpd daemon by creating the directory /tftpboot:

    # mkdir /tftpboot

    This configures the machine as a TFTP, bootparams, and RARP server.

  3. Create a symbolic link to the directory.

    # ln -s /tftpboot/. /tftpboot/tftpboot

  4. Enable the tftp line in intetd.conf.

    Check that the /etc/inetd.conf entry reads:

    tftp dgram udp wait root /usr/sbin/in.tftpd in.tftpd -s /tftpboot

    This prevents inettftpd() from retrieving any file other than one located in /tftpboot.

  5. Edit the hosts database, and add the host names and IP addresses for every client on the network.

  6. Edit the ethers database, and create entries for every host on the network to run in network client mode.

  7. Edit the bootparams database.

    See "bootparams Database". Use the wildcard entry or create an entry for every host that run in network client mode.

  8. Reboot the server.

Information for setting up diskless clients, install servers, and boot servers can be found in Solaris Advanced Installation Guide.

Configuring Network Clients

Network clients receive their configuration information from network configuration servers. Therefore, before you configure a host as a network client you must ensure that at least one network configuration server is set up for the network.

How to Configure Hosts for Network Client Mode

Do the following on each host to be configured in network client mode:

  1. Become superuser.

  2. Check the directory for the existence of an /etc/nodename file. If one exists, delete it.

    Eliminating /etc/nodename causes the system to use the hostconfig program to obtain the host name, domain name, and router addresses from the network configuration server. See "Network Configuration Procedures".

  3. Create the file /etc/hostname.interface, if it does not exist.

    Make sure that the file is empty. An empty /etc/hostname.interface file causes the system to acquire the IP address from the network configuration server.

  4. Ensure that the /etc/inet/hosts file contains only the host name and IP address of the loopback network interface.

    (See "Loopback Address".) The file should not contain the IP address and host name for the local machine (primary network interface).

    EXCEPTION: For a diskless client (a machine with an NFS-mounted root file system), type the name and IP address of the server that provides the client's root file system (usually, but not always, the network configuration server).

  5. Check for the existence of an /etc/defaultdomain file. If one exists, delete it.

    The hostconfig program sets the domain name automatically. If you want to override the domain name set by hostconfig, type the substitute domain name in the file /etc/defaultdomain.

  6. Ensure that the search paths in the client's /etc/nsswitch.conf reflects the name service requirements for your network.

How to Specify a Router for the Network Client

  1. If you have only one router on the network and you want the network configuration server to specify its name automatically, ensure that the network client does not have a /etc/defaultrouter file.

  2. To override the name of the default router provided by the network configuration server:

    1. Create /etc/defaultrouter on the network client.

    2. Type the host name and IP address of the machine you have designated as the default router.

    3. Add the host name and IP address of the designated default router to the network client's /etc/inet/hosts.

  3. If you have multiple routers on the network, create /etc/defaultrouter on the network client, but leave it empty.

Creating /etc/defaultrouter and leaving it empty causes one of the two dynamic routing protocols to run: ICMP Router Discovery protocol (RDISC), or Routing Information Protocol (RIP). The system first runs the program in.rdisc, which looks for routers that are running the router discovery protocol. If it finds one such router, in.rdisc continues to run and keeps track of the routers that are running the RDISC protocol.

If the system discovers that routers are not responding to the RDISC protocol, it uses RIP and runs the daemon in.routed to keep track of them.

After Installing a Network Client

After you have finished editing the files on each network client machine, do the following on the network configuration server.

  1. Add entries for the hosts in the ethers and hosts databases.

  2. Add entries for the hosts to the bootparams database.

    To simplify matters, you can type a wild card in the bootparams database in place of individual entries for each host. For an example, see "bootparams Database".

  3. Reboot the server.

Configuring Standard TCP/IP Services

Services such as telnet, ftp, and rlogin are started by the inetd daemon, which runs automatically at boot time. Like the name service ordering specified in nsswitch.conf, you can configure TCP/IP services in the file /etc/inetd.conf by using the inetd -t flag.

For example, you can use inetd to log the IP addresses of all incoming TCP connections (remote logins and telnet). To turn the logging on, kill the running inetd and type:

# /usr/sbin/inetd -t -s

The t switch turns on TCP connection-tracing in inetd.

Refer to the inetd(1M) and inetd.conf(4) man pages.

See Solaris Naming Administration Guide and Solaris Naming Setup and Configuration Guide for further information on name services.

Overview of the Booting Processes

The following information is provided for your reference. It is a brief overview of the network booting processes to help you better visualize what is happening during configuration.


Note -

The names of startup scripts might change from one release to another.


  1. You start the operating system on a host.

  2. The kernel runs /sbin/init, as part of the booting process.

  3. /sbin/init runs the /etc/rcS.d/S30rootusr.sh. startup script.

  4. The script runs a number of system startup tasks, including establishing the minimum host and network configurations for diskless and dataless operations. /etc/rcS.d/S30rootusr.sh also mounts the /usr file system.

    1. If the local database files contain the required configuration information (host name and IP address), the script uses it.

    2. If the information is not available in local host configuration files, /etc/rcS.d/S30rootusr.sh uses RARP to acquire the host's IP address.

  5. If the local files contain domain name, host name, and default router address, the machine uses them. If the configuration information is not in local files, then the system uses the Bootparams protocol to acquire the host name, domain name, and default router address. Note that the required information must be available on a network configuration server that is located on the same network as the host. This is necessary because no internetwork communications exist at this point.

  6. After /etc/rcS/S30rootusr.sh completes its tasks and several other boot procedures have executed, /etc/rc2.d/S69inet runs. This script executes startup tasks that must be completed before the name services (NIS, NIS+, or DNS) can start. These tasks include configuring the IP routing and setting the domain name.

  7. At completion of the S69inet tasks, /etc/rc2.d/S71rpc runs. This script starts the NIS, NIS+, or DNS name service.

  8. After /etc/rc2.d/S71 runs, /etc/rc2.d/S72inetsvc runs. This script starts up services that depend on the presence of the name services. S72inetsvc also starts the daemon inetd, which manages user services such as telnet.

See System Administration Guide for a complete description of the booting process.