|
| 以 PDF 格式下载本书
Configuring TCP/IP on the Network
4
- The second phase of network administration involves setting up the network. This consists of assembling the hardware that 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 will run in local files mode
- Configuring a network configuration server
- Configuring TCP/IP on machines that will 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 You Configure TCP/IP
- Before configuring the TCP/IP software, you should have:
-
- Designed the network topology, if you are the network designer. (See "Network Topology" on page 38 for details.)
- Obtained a network number from your Internet addressing authority. (See "Network Classes" on page 28.)
- Assembled the network hardware according to the topology designed and assured that the hardware is functioning. (See the hardware manuals and "Network Topology" on page 38.)
- 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" on page 31.)
- Assigned IP numbers and host names to all machines involved in the network. (See "Designing Your IP Addressing Scheme" on page 31.)
- Determined which name service your network will use: NIS, NIS+, DNS, or local files. (See Name Services Administration Guide.)
- Selected a domain name(s) for your network, if applicable. (See Name Services Administration Guide.)
- Installed the operating system on at least one machine on the prospective network (SPARC: Installing Solaris Software or x86: Installing Solaris Software).
Determining Host Configuration Modes
- One of the key functions you will carry out 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.
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" on page 49. 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 usually is not efficient. On the other hand, because routers and servers must be self-sufficient, they should be configured in the 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:
-
- 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 may also may 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 get 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 x86: Installing Solaris Software and SPARC: Installing Solaris Software.
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 wish.
Sample Network
-
Figure 4-1 on page 48 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 on page 48 as their basis.

Figure 4-1
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:
-
-
/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 "TCP/IP Configuration Files". 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" on page 58 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 your preferred text editor; the Solaris installation program will not create them for you.
- For example, consider the machine timbuktu shown in Figure 4-1 on page 48. It has two network interfaces and therefore is considered a router. The primary network interface le0 is connected to network 192.9.200. It has an IP address 192.9.200.70 and the host name 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 on page 48, 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 Name Services 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 on page 48, 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 host 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 on page 48: Code 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 Code Example 4-1, the IP address 127.0.0.1 is the loopback address, the reserved network interface used by the local machine to send packets to itself. The ifconfig command uses the loopback address for configuration and testing, as explained in "ifconfig Command" on page 88. Every machine on a TCP/IP network has 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 Machines functioning as routers have at least two network interfaces. Each additional network interface attached to the machine requires its own IP address and associated name. When you configure a router, you must manually add this information to the router's /etc/inet/hosts file.
- Here is the /etc/inet/hosts file for machine timbuktu shown in Figure 4-1 on page 48.
-
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 Name Services 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:
-
- 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 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
-
Code Example 4-2 on page 54 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.
-

-
Code Example 4-2 /etc/inet/hosts File for Machine Running in Local Files Mode
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 Subnetting Is
- 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 get 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 for each major division in an organization. For instance, you could allocate one for Engineering, one for 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 will need to select a network wide netmask. The netmask determines how many and which bits in the host address space will represent the subnet number and how many and which will 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 an Existing Network" on page 58. If you plan to install the operating system as part of network configuration, the Solaris installation program will request the netmask for your network.
- As described in "Parts of the IP Address" on page 27, 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 will 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.
- Which bits in the host address bytes will be applied to subnet addresses and which 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 calctool from the OpenWindows(TM) desktop environment 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.
-
- 144.41.101 & 255.255.255.0 = 129.144.41.0
- In binary form, the operation is:
- 11111111.11111111.11111111.00000000 (netmask)
- AND
-
- 10010000.00101001.01100101 (IP address)
- Now the system will look 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 will look for and find. 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.192.0
- This netmask provides a result of:
- 11111111.11111111.1100000.00000000
- This still leaves 14 bits available for host addresses.
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.
- Here is a sample /etc/inet/netmasks file for a Class B network.
-
## The netmasks file associates Internet Protocol (IP) address
# masks with IP network numbers.
#
# network-numbernetmask
#
# 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:
-
- You also can 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 an Existing Network
- 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.
-
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:
-
-
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.
How Name Services Affect Network Databases
- The form a network database takes 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 in use on your network.
- The network databases are used as follows:
-
- Networks that use local files for their name service use files in the /etc/inet and /etc directories
- NIS+ uses databases called NIS+ tables
- NIS uses databases called NIS maps
- DNS uses records with host information
-
Note - DNS boot and data files do not correspond directly to the network databases.
-
Figure 4-2 on page 60 shows the forms of the hosts database used by these name services:

Figure 4-2 hosts
-
Table 4-1 on page 61 lists the network databases and how they are used by local files, NIS+, DNS, and NIS.
-
Table 4-1
| Network Database | Local Files | NIS+ Tables | NIS Maps |
| hosts | /etc/inet/hosts | hosts | hosts.byaddr
hosts.byname |
| netmasks | /etc/inet/netmasks | netmasks | netmasks.byaddr |
| ethers | /etc/ethers | ethers | ethers.byname
ethers.byaddr |
| bootparam s | /etc/bootparams | bootparams | bootparams |
| protocols | /etc/inet/protocol s | protocols | protocols.byname protocols.bynumbe r |
| services | /etc/inet/services | services | services.byname |
| networks | /etc/inet/networks | networks | networks.byaddr
networks.byname |
- This book discusses network databases as they are used by networks using local files for name services. Information regarding the hosts database is in "hosts Database" on page 51; information regarding the netmasks database is in "netmasks Database" on page 54. Refer to Name Services 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 will resemble Figure 4-3 on page 62.
- :
-
# /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
|
-
Figure 4-3 nsswitch.conf for Networks Using Files for Name Service
- 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 Figure 4-3 on page 62, 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:
-
-
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 may 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 then nis. Figure 4-4 on page 64 shows the correct search paths.
- .
-
## /etc/nsswitch.conf:
#
.
.
passwd: files nis
group: files 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 [NOTFOUND=return] files
netgroup: nis
automount: files nis
aliases: files nis
# for efficient getservbyname() avoid nis
services: files nis
sendmailvars: files
|
-
Figure 4-4 nsswitch.conf for a Diskless Client on a Network Running NIS
- For complete details on the name service switch, refer to the Name Services Administration Guide.
bootparams Database
- The bootparams database contains information used by diskless clients and machines configured to boot in the network client mode. You will have to edit it if your network will have network clients. (See "Configuring Network Clients" on page 73 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 may 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 bootparams database:
-
myclient root=myserver : /nfsroot/myclient \
swap=myserver : /nfsswap//myclient \
dump=myserver : /nfsdump/myclient
|
- 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.
- In this /etc/ethers file, note that entries are in alphabetical order by machine name.
-
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.
- Here is a sample /etc/networks file:
-
#ident"@(#)networks1.492/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-namenetwork-numbernicnames . . .
# The loopback network is used only for intra-machine
communication
#
loopback127
# Internet networks
#
arpanet 10 arpa# Historical
ucb-ether 46ucbether
#
# 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. Here is an example of the /etc/inet/protocols file:
-
#
# Internet (IP) protocols
#
ip 0 IP # internet protocol, pseudo protocol number
icmp1 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. Here is an excerpt from a typical /etc/inet/services file:
-
#
# Network services
#
echo 7/udp
echo 7/tcp
discard 9/udp sink null
discard 9/tcp sink null
systat 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:
-
- 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 Name Services Administration Guide for information on working with name service databases.
· How to Configure a Host for Local Files Mode
- Use the following procedures for configuring TCP/IP on a machine that will 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" on page 49 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:
-
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" on page 51.
-
a. 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.
-
b. IP address or addresses of the file server, if the /usr file system is NFS mounted.
-
-
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" on page 50 for more information.
-
Type the router's name in /etc/defaultrouter. See "/etc/defaultrouter File" on page 50 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" on page 73. 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.
-
-
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" on page 46 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.
· How to Set Up a Network Configuration Server
-
-
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:
-
- This configures the machine as a TFTP, bootparams, and RARP server.
-
-
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" on page 65. Use the wildcard entry or create an entry for every host that will run in network client mode.
-
Reboot the server.
- Information for setting up diskless clients, install servers, and boot servers can be found in SPARC: Installing Solaris Software and x86: Installing Solaris Software.
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:
-
-
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" on page 70.
-
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" on page 52). 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 will set the domain name automatically. If you wish 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.
· How to Specify a Router for the Network Client
-
-
If you have only one router on the network and you want the network configuration server to automatically specify its name, 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:
a. Create /etc/defaultrouter on the network client. b. Type the host name and IP address of the machine you have designated as the default router.
c. Add the host name and IP address of the designated default router to the network client's /etc/inet/hosts.
-
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.
-
-
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" on page 65.
-
Reboot the server.
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 may 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.
a. If the local database files contain the required configuration information (host name and IP address), the script uses it. b. 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 Common Administration Tasks for a complete description of the booting process.
|
|