|
» |
|
|
|
This section tells you how to configure your host to find
other hosts on the network, by host name or IP address. It contains
the following sections: To Choose a Name Service | |
HP-UX provides four ways of translating host names to IP addresses
or IP addresses to host names: The /etc/hosts file, a simple ASCII file that is searched sequentially. BIND (Berkeley Internet Name Domain), which is Berkeley's implementation
of the Domain Name System (DNS). NIS (Network Information Service), one of the NFS
Services. (NIS used to be called "Yellow Pages".) NIS+ (the next generation of NIS). NIS+ is more
scalable and has better security features than NIS.
By configuring the Name Service Switch, you can use these
name services in any order you choose. See “Configuring the Name
Service Switch”. If you have a large network, or you need to connect to Internet
hosts outside your local network, use BIND as your primary name
service. When you use BIND, you administer a central database containing
only the hosts on your local network, and you have access to the
databases on all the other hosts on the Internet. See Chapter 3 “Configuring and Administering the
BIND Name Service” for instructions on configuring BIND. If you have a large network and little need for Internet connectivity,
you can use NIS as your primary name service. The NIS hosts database
is administered centrally on one of your hosts, but it must contain
the names and IP addresses of all the other hosts in your network.
For information on NIS, see Installing and Administering
NFS Services. If you have a small network and little need for Internet connectivity,
you can use the /etc/hosts file as your primary name service. Each host in your
network needs a copy of the /etc/hosts file containing the names and addresses of all
the other hosts in your network. For information on the /etc/hosts file, see “To Edit the /etc/hosts
File”. If you choose to use BIND, NIS, or NIS+ as your primary name
service, you still need to configure a minimal /etc/hosts file so that your host can boot if BIND, NIS,
or NIS+ is not available. To Edit the /etc/hosts
File | |
You can use any text editor to edit the /etc/hosts file, or you can use SAM. SAM (System Administration
Manager) is Hewlett-Packard's windows-based user interface
for performing system administration tasks. To run SAM, type sam at the HP-UX prompt. SAM has an extensive online
help facility. If no /etc/hosts file exists on your host, copy /usr/newconfig/etc/hosts to /etc/hosts, or use ftp to copy the /etc/hosts file to your host from another host on your network.
Type man 1 ftp for more information. Make sure your /etc/hosts file contains the following line: 127.0.0.1 localhost loopback Add your own host's IP address, name, and
aliases to the /etc/hosts file, as in the following example: 15.13.131.213 hpindlpk romney The first field is the IP address, the second is the official
host name (as returned by the hostname command), and any remaining fields are aliases.
Type man 4 hosts for more information. If your host has more than one network interface
installed, add a line to /etc/hosts for each interface. The /etc/hosts entries for your host will have the same official
host name but different aliases and different IP addresses. Add any other hosts to the /etc/hosts file that you need to reach. If you will use a
BIND, NIS, or NIS+ server on a different host, add that host to
your /etc/hosts file. If you have no default gateway configured, and you add a host
that is not on your subnet, SAM will prompt you for the gateway.
To stop the prompting, configure a default gateway. If you are not using SAM, you must configure a gateway
for each host that is not on your subnet. See “To Configure Routes”. Make sure the /etc/hosts file is owned by user root and group other, and make sure the permissions are set to 0444
(-r--r--r--).
To Configure Routes | |
If you use only one gateway to reach all systems on other
parts of the network, configure a default gateway. You can use SAM to configure a default gateway, or if you
are not using SAM, issue the following command: /usr/sbin/route add default gateway_address 1
|
where gateway_address is the IP address of the gateway host. Then, set the following environment variables in the /etc/rc.config.d/netconf file: ROUTE_DESTINATION[0]="default" ROUTE_GATEWAY[0]="gateway_address" ROUTE_COUNT[0]="1"
|
If the default gateway is your own host, set the ROUTE_COUNT variable to 0. Otherwise, set it to 1. If your host is a gateway, configure the destination
networks that can be reached from its network interfaces. Issue
the following command for each network interface on your host: /usr/sbin/route add net destination IP_address
|
where destination is a network address reachable by your host, and IP_address is the address of the network interface. Then, create a new set of routing variables in the /etc/rc.config.d/netconf file for each network interface. Whenever you
create a new set of variables, increment the number in square brackets,
as in the following example: ROUTE_DESTINATION[1]="15.13.131.0" ROUTE_GATEWAY[1]="15.13.131.213" ROUTE_COUNT[1]="0"
|
If you will not be using gated, configure routes to all the networks you need
to reach. Type the following command for each network you need to
reach from your host: /usr/sbin/route add net network_address gateway_address
|
Then, create a new set of routing variables in the /etc/rc.config.d/netconf file for each new route. Whenever you create a
new set of variables, increment the number in square brackets. ROUTE_DESTINATION[n]="network_address" ROUTE_GATEWAY[n]="gateway_address" ROUTE_COUNT[n]="1"
|
If ROUTE_GATEWAY[n] is your own host, set ROUTE_COUNT[n] to 0. Otherwise, set it to 1. Type the following command to verify the routes
you have configured:
For more information on static routing, type man 1M route or man 7 routing at the HP-UX prompt. If you have a large and complicated network, use gated for dynamic routing. See Chapter 8 “Configuring gated” for
more information. To Change a Host's
IP Address | |
When you use SAM to change a host's IP address, SAM
does not perform all these steps. For example,
SAM does not update BIND or NIS databases. Change the host's IP address in the /etc/hosts file. See “To Edit the /etc/hosts
File”. Change the IP_ADDRESS[n] variable in the /etc/rc.config.d/netconf file to the new IP address. If the host is on a network that uses BIND, change
the host's IP address in the data files of the authoritative
name servers. See Chapter 3 “Configuring and Administering the
BIND Name Service”. If the host is on a network that uses NIS, change its IP address
in the /etc/hosts file on the NIS master server, and issue the following commands
to regenerate the hosts database and push it out to the NIS slave servers: cd var/yp /usr/ccs/bin/make hosts
|
If the host is on a network that uses NIS+, use the nistbladm (1) command to change the host's IP address
in the NIS+ hosts table. If the host is moving to a different subnet, change
the ROUTE_DESTINATION, ROUTE_GATEWAY, and BROADCAST_ADDRESS[n] variables in /etc/rc.config.d/netconf. If the host is moving to a network that uses a different subnet
mask, change the SUBNET_MASK[n] variable in /etc/rc.config.d/netconf. If the host is moving to a different network, you
may have to configure new routes for it. See “To Configure Routes”
. If the host is on a network that uses gated, change its IP address on all the gated routers. See Chapter 8 “Configuring gated”. If the host is a BOOTP client, change its IP address
in the /etc/bootptab file on the BOOTP server. If the host is a BOOTP server,
and a BOOTP relay agent is configured to relay boot requests to
the host, change the host's IP address in the /etc/bootptab file on the BOOTP relay agent. See Chapter 5 “Configuring TFTP
and BOOTP Servers”. If the host is an NTP server, change its IP address
in the /etc/ntp.conf file on NTP clients. If the host is an NTP client
and is moving to another network, you might have to configure a
different NTP server in its /etc/ntp.conf file. See Chapter 7 “Configuring the Network
Time Protocol (NTP)”. Reboot the host.
|