System Administration Guide, Volume 3

Chapter 10 Configuring DHCP Service

Configuring DHCP Service on your network consists largely of configuring and starting the first DHCP server. Other servers can be added later, and access the same data from a shared location. This chapter includes procedures for configuring the DHCP server and placing networks and their associated IP addresses under DHCP management. It also explains how to unconfigure a server.

This chapter also provides instructions for procedures using both DHCP Manager and dhcpconfig in separate sections. This chapter contains the following information:

Configuring and Unconfiguring a DHCP Server Using DHCP Manager

This section includes procedures for configuring and unconfiguring a server using DHCP Manager. Note that you must be running an X Window system such as CDE to use DHCP Manager.

The first time you run DHCP Manager on a system, the following screen is displayed to allow you to specify whether you want to configure a DHCP server or BOOTP relay agent.

Figure 10-1 Choose Server Configuration Dialog

Graphic

Configuring DHCP Servers

When you configure a DHCP server, DHCP Manager starts the DHCP Configuration Wizard, which prompts you for information needed to configure the server. The initial screen of the wizard is shown in the following figure.

Figure 10-2 DHCP Configuration Wizard's Initial Screen

Graphic

When you finish answering the wizard prompts, DHCP Manager creates the items listed in the following table.

Table 10-1 Items Created During DHCP Server Configuration

Item 

Description 

Contents 

Service configuration file, /etc/default/dhcp

Records keywords and values for server configuration options. 

Data store type and location, options used with in.dhcpd to start the DHCP daemon when system boots.

dhcptab file

DHCP Manager creates an empty filedhcptab if it does not already exist.

Macros and options with assigned values. 

Locale macro, optional

Contains the local time zone's offset in seconds from Universal Time (UTC). 

UTCoffst option

Server macro, named to match server's node name 

Contains options whose values were set using input from administrator configuring the DHCP server. Options should apply to all clients using addresses owned by the server. 

The Locale macro, plus the following options:

  • Timeserv, set to point to the server's primary IP address

  • LeaseTim, and LeaseNeg if you selected negotiable leases

  • DNSdmain and DNSserv, if DNS is configured

  • Hostname, which must not be assigned a value. The presence of this option indicates that the hostname must be obtained from the name service.

Network address macro, whose name is the same as the network address of client's network 

Contains options whose values were set using input from administrator configuring the DHCP server. Options should apply to all clients residing on the network matching the macro name. 

The following options:

  • Subnet

  • Router or RDiscvyF

  • Broadcst, if the network is a LAN

  • MTU

  • NISdmain and NISserv, if NIS is configured

  • NIS+dom and NIS+serv, if NIS+ is configured

Network table for the network. 

Empty table is created until you create IP address for the network. 

None, until you add IP addresses. 

Links to the DHCP service script, /etc/init.d/dhcp.

Enables the DHCP daemon to start automatically when the system boots. 

The following links are made:

  • /etc/rc0.d/K34dhcp

  • /etc/rc1.d/K34dhcp

  • /etc/rc2.d/K34dhcp

  • /etc/rc3.d/S34dhcp

How to Configure a DHCP Server (DHCP Manager)

  1. Select the system you want to use as a DHCP server.

    Use the guidelines in "Making Decisions for Server Configuration".

  2. Make decisions about your data store, lease policy, and router information.

    Use the guidelines in "Making Decisions for Server Configuration".

  3. Become superuser on the server system.

  4. Type the following command:


    #/usr/sadm/admin/bin/dhcpmgr &
    
  5. Choose the option Configure as DHCP Server.

    This starts the DHCP Configuration Wizard, which guides you in configuring your server.

  6. Select options or type requested information based on the decisions you made during the planning phase.

    If you have difficulty, click Help in the Wizard window to open your web browser and display help for the DHCP Configuration Wizard.

  7. Click Finish to complete the server configuration when you have finished entering the requested information.

  8. At the Start Address Wizard window, click Yes to begin configuring addresses for the server.

    The Address Wizard enables you to specify which addresses to place under control of DHCP.

  9. Answer the prompts based on decisions made during the planning phase.

    See "Making Decisions for IP Address Management" for more information. If you have difficulty, click Help in the Wizard window to open your web browser and display help for the Add Addresses Wizard.

  10. Review your selections, and click Finish to add the addresses to the network table.

    The network table is updated with records for each address in the range you specified.

You can add more networks to the DHCP server using the Network Wizard, as explained in "Adding DHCP Networks".

Configuring BOOTP Relay Agents

When you configure a BOOTP relay agent, DHCP Manager takes the following actions:

The following figure shows the screen displayed when you choose to configure a BOOTP relay agent.

Figure 10-3 Configure BOOTP Relay Dialog Box

Graphic

How to Configure a BOOTP Relay Agent (DHCP Manager)

  1. Select the system you want to use as a BOOTP relay agent.

    See "Selecting a Server for DHCP".

  2. Become superuser on the server system.

  3. Type the following:


    #/usr/sadm/admin/bin/dhcpmgr &
    

    If the system has not been configured as a DHCP server or BOOTP relay agent, the DHCP Configuration Wizard starts. If the system has already been configured as a DHCP server, you cannot configure it as a BOOTP relay agent unless you unconfigure the server first. See "Unconfiguring DHCP Servers and BOOTP Relay Agents".

  4. Select Configure as BOOTP Relay.

    The Configure BOOTP Relay dialog box opens.

  5. Type the IP address or hostname of one or more DHCP servers that are configured to handle BOOTP or DHCP requests received by this BOOTP relay agent, and click Add.

    After you click OK, notice that the DHCP Manager offers only the File menu to exit the application and the Service menu to manage the server. Other menu options are disabled because they are useful only on a DHCP server.

Unconfiguring DHCP Servers and BOOTP Relay Agents

When you unconfigure a DHCP server or BOOTP relay agent, DHCP Manager takes the following actions:

The following figure shows the screen that is displayed when you choose to unconfigure a DHCP server.

Figure 10-4 Unconfigure Service Dialog Box

Graphic

When you unconfigure a DHCP server you must decide what to do with the DHCP data files: dhcptab and the DHCP network tables. If the data is shared among servers, you should not remove the dhcptab and DHCP network tables because this could render DHCP unusable across your network. Data can be shared through NIS+ or on exported local file systems. The file /etc/default/dhcp records the data store used and its location.

You can unconfigure a DHCP server while leaving the data intact by not selecting any of the options to remove data. Unconfiguring while leaving the data intact in effect disables the DHCP server.

If you are certain that you want to remove the data, you can select an option to remove the dhcptab and network tables. If you had generated client names for the DHCP addresses, you can also elect to remove those entries from /etc/inet/hosts or the NIS+ hosts table.

Before you unconfigure a BOOTP relay agent, be sure that no clients rely on this agent to forward requests to a DHCP server.

How to Unconfigure a DHCP Server or BOOTP Relay Agent (DHCP Manager)

  1. Become superuser.

  2. Type the following:


    #/usr/sadm/admin/bin/dhcpmgr &
    
  3. From the Services menu, choose Unconfigure.

    The Unconfigure Service dialog box is displayed. If the server is a BOOTP relay agent, the dialog box enables you to confirm your intention to unconfigure the relay agent. If the server is a DHCP server, you must decide what to do with the DHCP data by making selections in the dialog box. See Figure 10-4.

  4. (Optional) Select options to remove data.

    If the server is using shared data (using NIS+ or files shared through NFS), do not select any options to remove the data. If the server is a DHCP server that is not using shared data, select one or both options to remove the data.

    See "Unconfiguring DHCP Servers and BOOTP Relay Agents" for more information about removing data.

  5. Click OK to confirm.

Configuring and Unconfiguring a DHCP Server Using dhcpconfig

This section includes procedures for configuring and unconfiguring a DHCP server or BOOTP relay agent using dhcpconfig. When you start dhcpconfig, the DHCP Configuration menu is displayed, as shown in the following figure.

Figure 10-5 dhcpconfig Menu


***         DHCP Configuration              ***
 
Would you like to:
 
        1) Configure DHCP Service
 
        2) Configure BOOTP Relay Agent
 
        3) Unconfigure DHCP or Relay Service
 
        4) Exit
  
Choice:  

How to Configure a DHCP Server (dhcpconfig)

  1. Select the system you want to use as a DHCP server.

    Use the guidelines in "Making Decisions for Server Configuration".

  2. Make decisions about your data store, lease policy, and router information.

    Use the guidelines in "Making Decisions for Server Configuration".

  3. Become superuser.

  4. Type the following:


    #/usr/sbin/dhcpconfig
    

    The text-based DHCP Configuration menu is displayed.

  5. Type 1 and press Return to select Configure DHCP Service.

  6. Answer the prompts listed below.

    Use the decisions you made after reading Chapter 9, Planning for DHCP Service. Note that the default value for each prompt is displayed in square brackets. If you want to use a default value, press Return at the prompt.


    Would you like to stop the DHCP service? (recommended) ([Y]/N)Y
    

    Type Y to stop the DHCP service. This ensures that the server does not attempt to send incomplete configuration information to clients.


    ###     DHCP Service Configuration      ###
    ###     Configure DHCP Database Type and  Location      ###
     
    Enter datastore (files or nisplus) [nisplus]:

    Type the name of the data store you have decided to use, either files or nisplus.

    See the guidelines in "Choosing the Data Store" if you need more information about the data store. Your choice is recorded in /etc/default/dhcp.


    Enter absolute path to datastore directory [/var/dhcp]:

    Type the path to the files or NIS+ directory that you want to use for the data store. The default location if you selected files for the data store is /var/dhcp. If you selected NIS+, the default listed is the location of the NIS+ directory that the server is already using, such as yourcompany.com.


    Would you like to specify nondefault daemon options (Y/[N]):

    You can successfully configure the server without specifying nondefault daemon options if you type N at this prompt.

    However, if you type Y here, the following prompts are displayed.


    Do you want to enable transaction logging? (Y/[N]):Y
     
    

    Type Y if you want to enable transaction logging. See the Administering DHCP chapter for information about transaction logging. The following prompt appears only if you enable transaction logging.


    Which syslog local facility [0-7] do you wish to log to? [0]:
     

    See the Administering DHCP chapter for information about the local facility for transaction logging.


    How long (in seconds) should the DHCP server keep outstanding OFFERs? [10]:

    Type the number of seconds the server should cache an IP address offer to a client. The default is 10 seconds, which is adequate for most networks. You can increase this time to compensate for slow network performance.


    How often (in minutes) should the DHCP server rescan the dhcptab? [Never]:

    By default, the DHCP server reads the dhcptab only at startup or if signalled by DHCP Manager to read it. DHCP Manager enables you to update the server by reloading the dhcptab after you make a change to the configuration data, so automatic rescanning is not necessary if you use DHCP Manager. Generally, you should use a rescan interval only under the following circumstances:

    • The data store is in NIS+ and you have more than one DHCP server on your network. Rescanning guarantees that all servers have the latest information.

    • You use dhtadm instead of DHCP Manager to make configuration changes. The dhtadm utility does not offer you the option of forcing a rescan of dhcptab after you make a change.

    If you decide to use the automatic rescan for dhcptab, type the interval in minutes that the server should wait to reload the client configuration information in the dhcptab file.


    Do you want to enable BOOTP compatibility mode? (Y/[N]):

    The default is to not enable BOOTP compatibility. See "Supporting BOOTP Clients with DHCP Service" if you want to enable BOOTP compatibility.

    After you finish entering information about nondefault daemon and server options, the following prompt is displayed:


    Enter default DHCP lease policy (in days) [3]:

    Type the number of days for the lease time. The default is three days. See "Setting a Lease Policy" for more information.


    Do you want to allow clients to renegotiate their leases? ([Y]/N):

    The default is Y to allow lease negotiation. See "Setting a Lease Policy" for more information about lease negotiation. If you type N, clients must give up their IP addresses when the lease expires, and then obtain a new lease and IP address.


    Enable DHCP/BOOTP support of networks you select? ([Y]/N):

    At this point, you can begin configuring the networks that should use DHCP. Refer to the decisions you made after reading "Making Decisions for IP Address Management". If you are not ready to configure IP addresses, type N; dhcpconfig prompts you to restart the DHCP service, and returns to the initial menu. Note that DHCP is not usable until you enable DHCP/BOOTP support of at least one network.

    If you are ready to configure IP addresses, type Y and continue to Step 4.

How to Configure a BOOTP Relay Agent (dhcpconfig)

  1. Become superuser on the system you want to configure.

  2. Type the following:


    # /usr/sbin/dhcpconfig
    

    The text-based DHCP Configuration menu is displayed.

  3. Type 2 and press Return to select Configure BOOTP Relay Agent.

  4. Answer the prompts as follows:


    Would you like to stop the DHCP service? (recommended) ([Y]/N):Y
    ###     BOOTP Relay Agent Configuration ###
     
    ###     Common daemon option setup      ###
     
    Would you like to specify nondefault daemon options (Y/[N]):Y
     
    

    You can successfully configure the server without specifying nondefault daemon options if you type N at this prompt.

    However, if you type Y here, the following prompts are displayed.


    Do you want to enable transaction logging? (Y/[N]):Y
     
    

    Type Y if you want to enable transaction logging. See the Administering DHCP chapter for information about transaction logging. The following prompt appears only if you enable transaction logging:


    Which syslog local facility [0-7] do you wish to log to? [0]:
     

    See the Administering DHCP chapter for information about the local facility for transaction logging.


    Enter destination BOOTP/DHCP servers. Type '.' when finished.
    IP address or Hostname: 

    Type one IP address or hostname for a BOOTP or DHCP server to which requests should be forwarded, and press Return. The prompt reappears to allow you to type more addresses or hostnames. Type a period and press Return when you are finished.


    Would you like to restart the DHCP service? (recommended) ([Y]/N):Y
    

    The DHCP Configuration menu is redisplayed.

  5. Type 4 to exit dhcpconfig.

Configuring Networks Using dhcpconfig

This section describes the procedures for placing a network under DHCP management using dhcpconfig. Each procedure assumes that the server configuration is complete and you are now adding new networks to the DHCP data store.

How to Configure the Local Network (dhcpconfig)

  1. Become superuser on the DHCP server system.

  2. Type the following command:


    # /usr/sbin/dhcpconfig
    

    The text-based DHCP Configuration menu is displayed.

  3. Answer the following prompts as shown to skip to the network configuration options.


    Would you like to stop the DHCP service? (recommended) ([Y]/N)Y
    Would you like to specify nondefault daemon options (Y/[N]):N
    Do you want to merge initialization data with the existing table? (Y/[N]):Y
    Enable DHCP/BOOTP support of networks you select? ([Y]/N):Y
    
  4. Answer the following prompt as shown to configure the local network.


    Configure BOOTP/DHCP on local LAN network: 172.21.0.0? ([Y]/N):Y
    
  5. Answer the following prompts about generating client names.


    Do you want hostnames generated and inserted in the files hosts table? (Y/[N]):

    The server can create host names and associate one with each IP address. See"Client Host Name Generation" for more information.

    If you type Y, answer the next prompt. If you type N, skip to step Step 6.


    What rootname do you want to use for generated names? [yourserver-]:

    The default prefix, or rootname, for generated client names is the name of the DHCP server. You can accept this, or change the name to anything you like.


    Is Rootname name_you_typed- correct? ([Y]/N):Y
    

    If you made an error, type N here to be prompted again for the rootname.


    What base number do you want to start with? [1]: 

    The base number indicates the first number appended to the rootname used to generate client names. For example, if you accept the default rootname and base number, the client names would be yourserver-1, yourserver-2, and so on.

  6. Answer the following prompts about the IP addresses in this network that you want to be placed under DHCP management.


    Enter starting IP address [172.21.0.0]:  

    The server must generate a range of IP addresses that it is to manage. Type the first address in the range that you want to be placed under DHCP management. See "Number and Ranges of IP Addresses" for more information.


    Enter the number of clients you want to add (x < 65535):

    The number of clients is the number of IP addresses you want to place under DHCP management. The dhcpconfig program uses this information and the base number to add a contiguous block of IP addresses to be managed by DHCP.


    The dhcp network table: 172.21.0.0 already exists.
    Do you want to add entries to it? ([Y]/N):  

    You see this prompt if you are adding a block of addresses in a network for which you have already configured addresses. Type Y to modify the network table and add the addresses.


    Would you like to configure BOOTP/DHCP service on remote networks? ([Y]/N):

    If you are finished adding networks, type N, and restart the server when prompted.

    If you want to place IP addresses on other networks under DHCP management, type Y at this prompt and continue with Step 5 in the following procedure.

How to Configure Remote Networks (dhcpconfig)

  1. Become superuser on the DHCP server system.

  2. Type the following command:


    # /usr/sbin/dhcpconfig
    

    The text-based DHCP Configuration menu is displayed.

  3. Type 1 and press Return to select Configure DHCP Service.

  4. Answer the following prompts as shown to skip to the remote network configuration options.


    Would you like to stop the DHCP service? (recommended) ([Y]/N)Y
    Would you like to specify nondefault daemon options (Y/[N]):N
    Do you want to merge initialization data with the existing table? (Y/[N]):Y
    Enable DHCP/BOOTP support of networks you select? ([Y]/N):Y
    Configure BOOTP/DHCP on local LAN network: 172.21.0.0? ([Y]/N):N
    
  5. Answer the following prompts as shown to configure a remote network.


    Would you like to configure BOOTP/DHCP service on remote networks? ([Y]/N):Y
    Enter Network Address of remote network, or <RETURN> if finished: 

    Type the IP address of the network you want to configure for DHCP. Remember that the network address uses 0 for the host portion of the IP address.


    Do clients access this remote network via LAN or PPP connection? ([L]/P): 

    Indicate whether the network is a local area network (LAN) or a point-to-point protocol network (PPP) by typing L or P.


    Do you want hostnames generated and inserted in the files hosts table? (Y/[N]):

    The server can create hostnames for each IP address and create entries in the /etc/inet/hosts file or NIS+ hosts table. See "Client Host Name Generation".


    Enter Router (From client's perspective), or <RETURN> if finished.
    IP address:

    Type the IP address of the router(s) the clients on this network should use. Note that you cannot specify that clients should use router discovery here.


    Optional: Enter Remote Network's MTU (e.g. ethernet == 1500):   

    If you know that the remote network uses a specific maximum transfer unit (MTU), type it here. Otherwise, just press Return to accept the default value.


    Enter starting IP address [172.21.0.0]   

    Type the first IP address in the range of addresses you want to place under DHCP management. The default value is the network address.


    Enter the number of clients you want to add (x < 65535):   

    Type the number of IP addresses you want to place under DHCP management. dhcpconfig uses this number and the starting IP address you entered previously to determine a block of IP addesses to place under DHCP control. The number you enter must be less than the value shown in the prompt, which is generated based on the netmask. In this example, the number must be less than 65535.


    dhcptab macro "172.21.0.0" already exists.
    Do you want to merge initialization data with the existing macro? ([Y]/N):   

    If you have already configured this network, this message is displayed. You should merge the data into the existing macro only if the information you provided applies to all clients on the network you are adding.


    Disable (ping) verification of 172.21.0.0 address(es)? (Y/[N]):   

    dhcpconfig pings the addresses you want to add to be sure they are not being used, and skips any addresses that are in use. If you type Y at this prompt, dhcpconfig does not ping the addresses.


    Network: 172.21.0.0 complete.
    Enter Network Address of remote network, or <RETURN>  if finished:
     

    If you want to configure another remote network, enter the network address and answer the prompts for the network. When you have no other remote networks to configure, press Return at this prompt.


    Would you like to restart the DHCP service? (recommended) ([Y]/N):   

    Type Y to restart the DHCP service.

Unconfiguring DHCP Servers and BOOTP Relay Agents Using dhcpconfig

Unconfiguring a DHCP server stops the server process and prevents it from starting automatically when the system reboots. It also removes the /etc/default/dhcp file, which records information about the data store location and server startup options. When you unconfigure a DHCP server you must decide what to do with the DHCP data files: dhcptab and the DHCP network tables. If the data is shared among servers, you should not remove the dhcptab and DHCP network tables because this could render DHCP unusable across your network. Data can be shared through NIS+ or on exported local file systems. You can unconfigure a DHCP server while leaving the data intact by declining to remove the tables when prompted to do so.

How to Unconfigure DHCP Servers or BOOTP Relay Agents (dhcpconfig)

  1. Become superuser on the server system.

  2. Type the following:


    # /usr/sbin/dhcpconfig
    

    The text-based DHCP Configuration menu is displayed.

  3. Type 3 and press Return to select Unconfigure DHCP or Relay Service.

  4. Answer the prompts as follows:


    Unconfigure will stop the DHCP service and remove /etc/default/dhcp.
    Are you SURE you want to disable the DHCP service? ([Y]/N):

    Type Y to unconfigure the server.


    Are you SURE you want to remove the DHCP tables? (Y/[N]):

    Type Y only if you are certain that the DHCP data is not shared with other DHCP servers. If you type N, the server is disabled while the data remains intact.

Configuring and Unconfiguring a Solaris DHCP Client

When you install the Solaris operating environment from CD-ROM, you are prompted to use DHCP to configure network interfaces. If you select yes, the DHCP client software is enabled on your system during Solaris installation. There is nothing further you need to do on the client machine to use DHCP.

If a client machine is already running the Solaris operating environment and not using DHCP, you must unconfigure the system and issue some commands to set up the system to use DHCP when it boots.

If you are using a non-Solaris client, please consult the documentation for that client for instructions on configuring the DHCP client.

How to Configure a Solaris DHCP Client

This procedure is necessary only if DHCP was not enabled during Solaris installation.

  1. Become superuser on the client machine.

  2. Unconfigure and shut down the system by typing the following command:


    # sys-unconfig
    

    See the sys-unconfig(1M) manual page for more information about what configuration information is removed by this command.

  3. Reboot the system when the PROM prompt appears.


    ok boot
    

    You are prompted for system configuration information by sysidtool programs when the system reboots. See the sysidtool(1M) manual page for more information.

  4. When prompted to use DHCP to configure network interfaces, specify Yes.

How to Unconfigure a Solaris DHCP Client

  1. Become superuser on the client machine.

  2. Unconfigure and shut down the system by typing the following command:


    # sys-unconfig
    

    See the sys-unconfig(1M) manual page for more information about what configuration information is removed by this command.

  3. Reboot the system when the PROM prompt appears.


    ok boot
    

    Because you unconfigured the system, you will be prompted for configuration information by sysidtool programs when the system reboots. See the sysidtool(1M) manual page for more information.

  4. When prompted to use DHCP to configure network interfaces, specify No.