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
Installing HP-UX 11.0 and Updating HP-UX 10.x to 11.0: HP 9000 Computers > Appendix A 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:

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

      15.1.48.50 - 15.1.48.80
  2. Pre-assign and register hostnames to the IP address allocated above. Using the -h option to the dhcptools(1M) command may be useful. For example, the following line:

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

    This command will create a file /tmp/dhcphosts that can be incorporated into your /etc/hosts or DNS/NIS database.

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

  4. Use the SAM application to configure the DHCP services on this server. To do this:

    1. Start the interactive SAM application by typing sam. (Note, you may need to set your DISPLAY variable to use the graphical version)

    2. Double-click on the icon Networking and Communications.

    3. Double-click on the icon Bootable Devices.

    4. Double-click on the icon 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 on the Action menu item and choose Add DHCP Group.

      This should bring up a form with parameters to fill in.

    6. Now you will need to 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.

      Title not available (Setting Up a DHCP Server )

      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 be displayed 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 is to allow 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 Win95™ or NT™.

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

      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(4) man page.

      AutomaticAllocation 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 is 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. You will now want to use the Action menu to Enable boot Server (if it is not already enabled).

  5. Now, new systems that are installed with HP-UX 10.20 (or newer) or booted with a pre-installed 10.20 (or newer) version of HP-UX should contact this server to get an IP address lease and other network information provided by the server.

Details of the DHCP Services

  • When doing a cold install of the HP-UX Operating system (version 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?". The "yes" or "no" answer to this implies the following:

    • "no": Answering "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": Answering "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 instl_adm(1M) using the keyword is_netwk_info_temporary).

    When automating system installations, the DHCP services allows systems to get networking information without the need to make a mapping in the Ignite-UX configuration files. (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):

    The auto_parms tool, that lets 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.

    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:

  1. The first method is to use SAM.

    1. As root, run sam.

    2. Double-click Networking and Communications.

    3. Double-click Network Interface Cards.

    4. Highlight the card you wish to enable DHCP on, go to the Actions pull-down menu and select Configure.

    5. Single click the Enable DHCP button.

      NOTE: If Enable DHCP appears grayed-out, you will need to use the alternate method for enabling DHCP described below.
    6. Single 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, you can examine the auto_parms log file (/etc/auto_parms.log) to determine if the lease request was successful.

  2. The second method for enabling DHCP over a particular network interface is use 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, in the following block:

                    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, the SAM tool 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.

Examples of DHCP Usage

To enable a DHCP server to respond only to specific clients, use the instl_adm(1M) tool to configure specific dhcp_class_id's.

DHCP Examples

For example, your situation might fall into one of the following four categories:

  1. 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. Then the Ignite-UX server setup should be:

    • Don't set up DHCP on Ignite-UX server In this case, enter the following in INSTALLFS, (using instl_adm).:

                   is_network_info_temporary=false
  2. 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 8K config file. This dhpc_class_id could have the server's hostname init. In this case, enter the following in INSTALLFS:

                   is_network_info_temporary=true
    3. And enter your class i.d. as the following in the dhcptab and INSTALLFS:

      dhcp_class_id
  3. 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 the following:

                   Is_network_info_temporary=false
    3. And enter your class i.d. as the following in the dhcptab and INSTALLFS:

      dhcp_class_id

    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.

  4. You want to start using DHCP with this server managing the whole network.

    • Refer to the preceding sections and /usr/sbin/sam, and its manpage (sam(1M)) for this procedure.

If you want to set up the Ignite-UX system to be a DHCP server, the default setting will give you Item 2. Otherwise, you can toggle the is_network_info_temporary keyword to select Item 3.

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

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 is a subset of DHCP, 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 would be like the entry below (with your own hostname, IP address, hardware address, and subnet mask). Other networking information may also be specified here, or can be specified via instl_adm. The IP address of the IUX server must be specified 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(1M)). 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(1M) 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

Refer to the auto_parms(1M) man page and the dhcpdb2conf(1M) man page for more information regarding the networking parameters which DHCP can supply.

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

  • Man pages:

     bootpd(1m)
    dhcptools(1M)
    auto_parms(1M)
    dhcpdb2conf(1M)
  • Worldwide Web information site:

            http://web.syr.edu/~jmwobus/comfaqs/dhcp.faq.html
Printable version
Privacy statement Using this site means you accept its terms Feedback to webmaster
© Hewlett-Packard Development Company, L.P.