Jump to content United States-English
HP.com Home Products and Services Support and Drivers Solutions How to Buy
» Contact HP
More options
HP.com home
Ignite-UX Administration Guide: HP Computers with HP-UX 10.x, 11.0 or 11i > Appendix C Configuring for a DHCP Server

Setting Up a DHCP Server

» 

Technical documentation

Complete book in PDF
» Feedback
Content starts here

 » Table of Contents

 » Index

Once you have decided that using DHCP will provide a benefit, you will need to follow the steps below to set up a DHCP server. Note that only one DHCP server per network subnet is required. On the server system:

  • Allocate a set of currently unused IP addresses (preferably a contiguous block of addresses). For example:

    15.1.48.50 -> 15.1.48.80
  • Pre-assign and register hostnames to the IP address allocated above. Using the -h option to the dhcptools command may be useful. For example, this command creates a /tmp/dhcphosts file that can be incorporated into your /etc/hosts or DNS/NIS database:

    dhcptools -h fip=15.1.48.50 no=30 sm=255.255.255.0 hn=devlab##

  • Designate a system to act as the DHCP server for your network. This should be a system that is "always" available to it's clients.

Use SAM to configure the DHCP services on this server:

  1. As root, enter: sam

    (you may need to set your DISPLAY variable to use the graphical version)

  2. Double-click Networking and Communications

  3. Double-click Bootable Devices

  4. Double-click DHCP Device Groups Booting From this Server

    You should now see a screen that lists any DHCP groups already defined (there may not be any if DHCP is not already configured).

  5. To add the new group of IP addresses which you allocated in Step 1, click Action -> Add DHCP Group

  6. Now fill in the information on this screen. Some information may require additional research if you are not familiar with the terms or with your network.

    • Group Name — This can be any name that isn't already defined as a DHCP group. For example: group1

    • Subnet Address — This is the portion of an IP address that is not masked off by the subnet mask (see below). If you don't want to figure this out, then just enter one of the IP addresses in the range you picked along with the correct subnet mask and SAM will take care of the calculation. For example: 15.1.48.50

    • Subnet Mask — This depends on the "class" of your network, and basically determines how an IP address is separated into a network number and a host specific number. Press F1 in this field for more information. For example: 255.255.255.0

    • Subnet Address Pool — Press this button to select the range of IP addresses that you allocated in Step 1. A new screen will display where you can enter the Start and End address. If there are addresses within the range that you picked that you do not want allocated via DHCP, you can use the Reserved Addresses button to specify those (or ranges of them).

    • Allow Any Device Class — The SAM default allows any type of DHCP device to use the group of IP address you are configuring. This may be undesirable if you use a different method (or a different DHCP server or group) for managing systems such as PCs running Windows98™ or NT™.

      If you want this range of addresses to be used only by HP-UX systems, then unselect this button, and in the text field provided enter: HewlettPackard.HP-UX

      When using Ignite-UX to set up DHCP, it will set a class specific to the server, and will set the dhcp_class_id string to match. For more detail, see the instl_adm manpage.

    • Automatic Allocation to Bootp Clients — Leave this option disabled. Enabling it will cause problems for bootp devices such as printers and terminals which rely only on their preconfigured server to respond to their boot request.

    • Accept New Clients — Leave this option enabled.

    • Address Lease Time — The lease time should be set sufficiently long so that if a client system is temporarily out of service (off) for a time, its lease will not expire too soon.

      Infinite leases will never expire and disable the IP-address reclamation features of DHCP. For example: 2 weeks.

    • Boot file name — You can leave this field blank.

    • Additional Params — There are many parameters that can be specified in this screen for such things as the default routers, time server, DNS server, and NIS domain. You can specify as much or as little as you like in this area.

    • Callback Routines — None are necessary.

  7. Once the parameters are all filled in, then press OK on the Add DHCP Group screen. SAM will then make the modifications to the /etc/dhcptab file.

  8. Click Action -> Enable Boot Server (if it is not already enabled).

New systems that are installed with HP-UX 10.20 or newer version or booted with a pre-installed HP-UX 10.20 or newer version should now contact this server to get an IP address lease and other network information provided by the server.

Details of the DHCP Services

  • When cold-installing HP-UX 10.20 or newer:

    The installation tools will broadcast out on the network for any available DHCP servers. The first server to respond will be chosen to provide the default network information that the user is presented with.

    In the network parameters screen during a cold install, you see the question: "Is this networking information only temporary?" Responding yes or no answer to this question implies the following:

    • no (the default) means that if the IP address and hostname were leased from an DHCP server, then that lease will be retained after the install is done, so that the first boot of the system will attempt to renew the same lease.

    • yes implies that the IP address and hostname lease should be returned to the server after the installation is complete. In this case, the first system boot will try to get a new lease. This is most useful when the system is being installed on a network that is different from its final destination.

      This answer to the question can also be set in the configuration file with the instl_adm command using the keyword: is_net_info_temporary

    When automating system installations, the DHCP services allows systems to get networking information without mapping the Ignite-UX configuration files. For more information, see instl_adm(1M) and instl_adm(4).

  • When a system boots for the first time (either after a cold install or the first boot of a pre-loaded (Instant Ignition) system):

    With HP-UX 10.20, the auto_parms and set_parms tools (they let you configure the system identity and basic configuration parameters) will invoke the dhcpclient, which will broadcast out to find a DHCP server. The server, in turn, provides a default set of networking parameters.

    With HP-UX 11.0, you are asked if DHCP should be enabled and used (by set_parms). The default is to not use DHCP.

    In both cold install and a first boot of a pre-loaded system, if the user chooses not to use the IP address given by the DHCP server, the tool will inform the DHCP server that it can release the lease on it and give it to someone else.

  • At each system boot:

    If a client system was initially set up using an IP address that was leased by a DHCP server, that client will check to ensure that the lease is still valid at each boot. In addition, the system will start a daemon process (dhcpclient -m) that will maintain and renew that lease while the system is running.

    If a system cannot contact the DHCP server from which it originally got the IP address lease, it will try to contact other DHCP servers in order to determine if it has been moved to a different network. If this is the case, the system will write a message to the auto_parms log file (/etc/auto_parms.log) indicating that it has detected a move to a new subnet and that it is attempting to request a new lease. If the new lease request is successful, new networking configuration values supplied by the DHCP server will automatically be applied.

Enabling DHCP on a System Not Initially Configured with DHCP

If a system has been set up without using DHCP, but you would like to start using it, the following steps may be taken.

NOTE: The system's hostname and IP address may change based on what the DHCP server assigns to it the first time it boots.

There are two methods for enabling DHCP on a system that is not currently using it:

Enable DHCP using SAM

  1. As root, run: sam

  2. Double-click Networking and Communications

  3. Double-click Network Interface Cards

  4. Highlight the card on which you wish to enable DHCP.

  5. Click Actions -> Configure

  6. Click Enable DHCP

    TIP: If Enable DHCP appears grayed-out, use the alternate method below.
  7. Click OK and exit SAM.

Your system will now begin using DHCP after the next reboot. Please note that all of the current networking parameters will be overridden with new values supplied by the DHCP server. If for some reason the system cannot contact a DHCP server during the next reboot, it will continue to use its current networking parameters.

If you suspect that your system had problem contacting the DHCP server, examine /etc/auto_parms.log to determine if the lease request was successful.

Alternate method

You can also enable DHCP over a particular network interface using a text editor such as vi or emacs to edit the /etc/rc.config.d/netconf file. In the header of this file, you will find some brief instructions regarding a variable named DHCP_ENABLE. This variable is tied by an index number to an individual network interface. For example:

INTERFACE_NAME[0]=lan0
IP_ADDRESS[0]=15.1.50.76
SUBNET_MASK[0]=255.255.248.0
BROADCAST_ADDRESS[0]=""
DHCP_ENABLE[0]=1

Here, the variables are instructing the system to use the lan0 interface when attempting to contact a DHCP server. Similarly, if the lease request is successful, the above IP_ADDRESS variable would be updated to reflect the new value supplied by the DHCP server.

If the DHCP_ENABLE variable was set to 0 or if the variable did not exist, no DHCP operations would be attempted over the corresponding network interface.

As noted in the first method of enabling DHCP, if the variable DHCP_ENABLE does not exist for a particular interface, SAM will display a grayed out DHCP enable button.

In this case, you will need to add the variable definition to a specific interface variable block. As an example, you would need to add DHCP_ENABLE[2]=1 to the following interface variable block in order to enable DHCP on the lan1 interface:

INTERFACE_NAME[2]=lan1
IP_ADDRESS[2]=15.1.50.89
SUBNET_MASK[2]=255.255.248.0
BROADCAST_ADDRESS[2]=""

The contents of /etc/rc.config.d/netconf for this definition block should now look like the following:

INTERFACE_NAME[2]=lan1
IP_ADDRESS[2]=15.1.50.89
SUBNET_MASK[2]=255.255.248.0
BROADCAST_ADDRESS[2]=""
DHCP_ENABLE[2]=1

Correspondingly, you could disable DHCP over a particular interface by setting the variable to 0.

Again, as in the first method, the system will only begin using DHCP after the next reboot.

DHCP Usage Examples

To enable a DHCP server to respond only to specific clients during an installation, use instl_adm to configure specific dhcp_class_ids.

Your situation might fall into one of these categories:

  • The network has a DHCP server that manages the whole network, and the clients doing installations will be using the addresses from this server permanently. In this case, do nothing since this line is entered in INSTALLFS file by default:

    is_network_info_temporary=false
  • The network has a DHCP server, but the user would like to manage a small group of temporary IP addresses, just for use in doing installations, and the clients will get reassigned new addresses when deployed.

    1. Set up DHCP on Ignite-UX server.

    2. Use a unique dhcp_class_id in both the dhcptab and the 8KB config file. This dhpc_class_id could include the server's hostname. In this case, enter the following in INSTALLFS using instl_adm:

      is_network_info_temporary=true
    3. Enter your class ID as the following in the dhcptab and INSTALLFS:

      dhcp_class_id

      If you have a non-HP server that does not recognize dhcp_class_id, specify the server using the dhcp_server keyword instead.

  • The user would like to setup the Ignite-UX server as a "departmental" DHCP server, in which case the IP address leases are permanent, but they will be isolated to the department's DHCP server.

    1. Set up DHCP on the Ignite-UX server.

    2. Enter this line:

      is_network_info_temporary=false
    3. And enter your class ID as the following in the dhcptab and INSTALLFS:

      dhcp_class_id

      (Or use the dhcp_server keyword as explained in the previous Step 3 above.)

    Use a unique dhcp_class_id in both the dhcptab and the INSTALLFS file. This dhcp_class_id could have the server's hostname in it.

  • You want to start using DHCP with this server managing the whole network. Refer to the preceding sections, /usr/sbin/sam, and the sam(1M) manpage for this procedure.

For more information, see the setup_server(1M) and bootpd(1M) manpages.

Using bootptab as an Alternative to DHCP

If you want to have more control over the allocation of IP addresses and their mappings to your clients, you can configure entries in /etc/bootptab for each client. Because BOOTP protocol is a subset of DHCP protocol, the client's request for a DHCP server will be satisfied with the BOOTP response.

If you also specify a boot-file (bf) of /opt/ignite/boot/boot_lif in the bootptab entries, then you do not need any additional entries in /etc/opt/ignite/inst_boottab. In this case, you would then boot the clients using boot lan instead of boot lan install. Only clients known in /etc/bootptab would be able to boot if you do not use instl_boottab.

A minimal example /etc/bootptab entry is shown below (use your own hostname, IP address, hardware address, and subnet mask). Other networking information may also be specified here or via instl_adm. Specify the Ignite-UX server's IP address with the instl_adm -t option.

sysname:\
hn:\
vm=rfc1048:\
ht=ether:\
ha=080009352575:\
ip=15.1.51.82:\
sm=255.255.248.0:\
bf=/opt/ignite/boot/boot_lif

Background Information on DHCP Design

The DHCP protocol is implemented as extensions to the BOOTP protocol, and in fact the HP-UX DHCP server daemon and the BOOTP daemon are the same: bootpd. This daemon reads two configuration files: /etc/bootptab and /etc/dhcptab.

The mapping of systems to IP addresses and lease time information is kept in the DHCP database file /etc/dhcpdb. Some amount of management of this database is provided by the dhcptools command.

On the client side, a command called /usr/lbin/dhcpclient is used to contact the server to get an IP address lease. This command has the ability to broadcast out onto the network prior to the network interface being enabled.

The dhcpclient also serves as a daemon process that sleeps until the time that it needs to renew the IP address lease, at which time it will re-contact the server where it got the original lease in order to extend it.

The dhcpclient command is not intended to be run by users directly, and is called by other tools during system bootup and installation.

For More Information

See the auto_parms(1M)and dhcpdb2conf(1M) manpages for more information regarding the networking parameters which DHCP can supply.

More general information on DHCP can be found in the following locations:

Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© Hewlett-Packard Development Company, L.P.