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:
Determining the host configuration mode for each machine on your network
Setting up the subnet mask for your network (optional)
Configuring TCP/IP on the machines that run in local files mode
Configuring a network configuration server
Configuring TCP/IP on machines that run in network client mode
Editing the network databases, based on the name service you have selected for your network
Configuring the name service switch file
Before configuring the TCP/IP software, you should have:
Designed the network topology, if you are the network designer. (See "Network Topology" for details.)
Obtained a network number from your Internet addressing authority. (See "Network Classes".)
Assembled the network hardware according to the topology designed and assured that the hardware is functioning. (See the hardware manuals and "Network Topology".)
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.)
Planned the IP addressing scheme for the network, including subnet addressing, if applicable. (See "Designing Your IP Addressing Scheme".)
Assigned IP numbers and host names to all machines involved in the network. (See "Designing Your IP Addressing Scheme".)
Determined which name service your network uses: NIS, NIS+, DNS, or local files. (See Solaris Naming Administration Guide.)
Selected domain names for your network, if applicable. (See Solaris Naming Administration Guide.)
Installed the operating system on at least one machine on the prospective network. (See Solaris Advanced Installation Guide.)
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:
Host name of a machine
IP address of the machine
Domain name to which the machine belongs
Default router
Netmask in use on the machine's network
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.
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:
Network configuration servers
NFS servers
Name servers supplying NIS, NIS+, or DNS services
Mail servers
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 are the machines that supply the TCP/IP configuration information to hosts configured in network client mode. These servers support three booting protocols:
RARP - Reverse Address Resolution Protocol (RARP) maps known Ethernet addresses (48 bits) to IP addresses (32 bits), the reverse of ARP. When you run RARP on a network configuration server, this enables hosts running in network client mode to obtain their IP addresses and TCP/IP configuration files from the server. The in.rarpd daemon enables RARP services. Refer to the in.rarpd(1M) man page for complete details.
TFTP - Trivial File Transfer Protocol (TFTP) is an application that transfers files between remote machines. The in.tftpd daemon carries out TFTP services, enabling file transfer between network configuration servers and their network clients.
bootparams - The bootparams protocol supplies parameters for booting that are required by diskless clients. The rpc.bootparamd daemon carries out these services.
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.
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.
Setting up systems for diskless booting is described in the System Administration Guide.
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.
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.
Each machine on the network gets its TCP/IP configuration information from the following TCP/IP configuration files and network databases:
/etc/hostname.interface file
/etc/nodename file
/etc/defaultdomain file
/etc/defaultrouter file (optional)
hosts database
netmasks database (optional)
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.
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.
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.
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.
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.
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.
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.
For compatibility with BSD-based operating systems, the file /etc/hosts is a symbolic link to /etc/inet/hosts.
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.
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:
127.0.0.1 localhost loghost #loopback address 192.9.200.3 ahaggar #host name |
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.
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.
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.
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.
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.
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:
Loopback address
IP address and host name of the local machine (primary network interface)
IP address and host name of additional network interfaces attached to this machine, if applicable
IP addresses and host names of all hosts on the local network
IP addresses and host names of any routers this machine must know about, if applicable
IP address of any machine your machine wants to refer to by its host name
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.
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.
When you create subnets, each new network must be a separate physical network. You cannot apply subnetting to a single physical network.
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.
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.
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.
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.
## 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.
If you are changing from a network that does not use subnets to one that is subnetted, perform the following steps:
Decide on the new subnet topology, including considerations for routers and locations of hosts on the subnets.
Assign all subnet and host addresses.
Modify the /etc/inet/netmasks file, if you are manually configuring TCP/IP, or supply the netmask to the Solaris installation program.
Modify the /etc/inet/hosts files on all hosts to reflect the new host addresses.
The network databases are files that provide information needed to configure the network. The network databases are:
hosts
netmasks
ethers
bootparams
protocols
services
networks
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.
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:
Networks that use local files for their name service rely on files in the /etc/inet and /etc directories
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:
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 |
---|---|---|---|
/etc/inet/hosts |
hosts.ord_dir |
hosts.byaddr hosts.byname |
|
/etc/inet/netmasks |
netmasks.ord_dir |
netmasks.byaddr |
|
/etc/ethers |
ethers.ord_dir |
ethers.byname ethers.byaddr |
|
/etc/bootparams |
bootparams.ord_dir |
bootparams |
|
/etc/inet/protocols |
protocols.ord_dir |
protocols.byname protocols.bynumber |
|
/etc/inet/services |
services.ord_dir |
services.byname |
|
/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+.
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.
# /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.
The /etc directory contains the nsswitch.conf file created by the Solaris installation program. It also contains template files for the following name services:
nsswitch.files
nsswitch.nis
nsswitch.nis+
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.
## /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.
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:
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.
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.
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.
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 |
The remaining network databases seldom need to be edited.
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:
#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 |
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:
# # 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 |
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:
# # 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 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:
IP address of each network interface on every machine
Host names of each machine on the network. You can type the host name in a local file or a name service database.
NIS, NIS+, or DNS domain name in which the machine resides, if applicable
Default router addresses. You supply this only if you have a simple network topology with only one router attached to each network, or your routers don't run routing protocols such as the Router Discovery Server Protocol (RDISC) or the Router Information Protocol (RIP). (See Chapter 5, Configuring Routers, for more information about these protocols.)
Subnet mask (required only for networks with subnets)
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.
Use this procedure for configuring TCP/IP on a machine that run in local files mode.
Become superuser and change to the /etc directory.
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.
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.
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.
Edit the /etc/inet/hosts file to add:
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.
IP address or addresses of the file server, if the /usr file system is NFS mounted.
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".
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.
Type the router's name in /etc/defaultrouter.
See "/etc/defaultrouter File" for information about this file.
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.
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.
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:
Turning on the network configuration daemons:
in.tftpd
in.rarpd
rpc.bootparamd
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.
Become superuser and change to the root directory of the prospective network configuration server.
Turn on the in.tftpd daemon by creating the directory /tftpboot:
# mkdir /tftpboot
This configures the machine as a TFTP, bootparams, and RARP server.
Create a symbolic link to the directory.
# ln -s /tftpboot/. /tftpboot/tftpboot
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.
Edit the hosts database, and add the host names and IP addresses for every client on the network.
Edit the ethers database, and create entries for every host on the network to run in network client mode.
Edit the bootparams database.
See "bootparams Database". Use the wildcard entry or create an entry for every host that run in network client mode.
Reboot the server.
Information for setting up diskless clients, install servers, and boot servers can be found in Solaris Advanced Installation Guide.
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.
Do the following on each host to be configured in network client mode:
Become superuser.
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".
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.
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).
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.
Ensure that the search paths in the client's /etc/nsswitch.conf reflects the name service requirements for your network.
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.
To override the name of the default router provided by the network configuration server:
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 you have finished editing the files on each network client machine, do the following on the network configuration server.
Add entries for the hosts in the ethers and hosts databases.
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".
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.
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.
The names of startup scripts might change from one release to another.
You start the operating system on a host.
The kernel runs /sbin/init, as part of the booting process.
/sbin/init runs the /etc/rcS.d/S30rootusr.sh. startup script.
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.
If the local database files contain the required configuration information (host name and IP address), the script uses it.
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.
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.
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.
At completion of the S69inet tasks, /etc/rc2.d/S71rpc runs. This script starts the NIS, NIS+, or DNS name service.
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.