Solaris DHCP Administration Guide

Chapter 3 Configuring DHCP Service

When you configure DHCP service on your network, you configure and start the first DHCP server. Other servers can be added later, and may access the same data from a shared location if the data store supports shared data. This chapter includes procedures to enable you to configure the DHCP server and place networks and their associated IP addresses under DHCP management. It also explains how to unconfigure a server.

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

Configuring and Unconfiguring a DHCP Server Using DHCP Manager

This section includes procedures to help you configure and unconfigure a DHCP server with DHCP Manager. Note that you must be running an X Window system such as CDE to use DHCP Manager.

When you run DHCP Manager on a server not configured for DHCP, the following screen is displayed to allow you to specify whether you want to configure a DHCP server or a BOOTP relay agent.

Figure 3–1 Choose Server Configuration Dialog Box

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 3–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 3–1 Items Created During DHCP Server Configuration

Item 

Description 

Contents 

Service configuration file, /etc/inet/dhcpsvc.conf

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 table

DHCP Manager creates a dhcptab table 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 determined by input from the administrator who configured the DHCP server. Options apply to all clients that use 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 determined by input from the administrator who configured the DHCP server. Options apply to all clients that reside on the network specified by the macro name. 

The following options:

  • Subnet

  • Router or RDiscvyF

  • Broadcst, if the network is a LAN

  • MTU

  • NISdmain and NISservs, 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 addresses for the network. 

None, until you add IP addresses. 

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 helps you configure your server.

  6. Select options or type requested information based on the decisions you made in 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 configure addresses for the server.

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

  9. Answer the prompts based on decisions made in 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 with 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 3–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 command:


    #/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 host name of one or more DHCP servers that are configured to handle BOOTP or DHCP requests received by this BOOTP relay agent, and click Add.

  6. Click OK to exit the dialog box.

    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 3–4 Unconfigure Service Dialog Box

Graphic

DHCP Data on an Unconfigured Server

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

You can unconfigure a DHCP server but leave the data intact by not selecting any of the options to remove data. If you unconfigure the server and leave the data intact, you disable the DHCP server.

If you want another DHCP server to take ownership of the IP addresses belonging to the server you are unconfiguring, you must move the DHCP data to the other DHCP server before you unconfigure the current server. See Moving Configuration Data Between DHCP Servers for more information.

If you are certain 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 the hosts table (whether in DNS, /etc/inet/hosts, or NIS+).

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 command:


    #/usr/sadm/admin/bin/dhcpmgr &
    
  3. From the Service 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 and make selections in the dialog box. See Figure 3–4.

  4. (Optional) Select options to remove data.

    If the server uses shared data (through NIS+ or files shared through NFS), do not select any options to remove the data. If the server does not use shared data, select one or both options to remove the data.

    See DHCP Data on an Unconfigured Server for more information about removing data.

  5. Click OK to confirm.

Configuring and Unconfiguring a DHCP Server Using dhcpconfig Commands

This section includes procedures to help you configure and unconfigure a DHCP server or BOOTP relay agent by using dhcpconfig with command-line options.

How to Configure a DHCP Server (dhcpconfig -D)

  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 or a user assigned to the DHCP Management profile.

  4. Type a command of the following format:


    #/usr/sbin/dhcpconfig -D -r datastore -p location
    

    datastore is one of SUNWfiles, SUNWbinfiles, or SUNWnisplus.

    location is the data-store-dependent location where you want to store the DHCP data. For SUNWfiles and SUNWbinfiles, this must be a UNIX absolute path name. For SUNWnisplus, this must be a fully specified NIS+ directory.

    The dhcpconfig utility uses the server machine's system and network files to determine values used to configure the DHCP server. See the dhcpconfig man page for information about additional options to the dhcpconfig command that enable you to override the default values.

  5. Add one or more networks to the DHCP service.

    See How to Add a DHCP Network (dhcpconfig) for the procedure to add a network.

How to Configure a BOOTP Relay Agent (dhcpconfig -R )

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

    Use the guidelines in Making Decisions for Server Configuration.

  2. Become superuser or a user assigned to the DHCP Management profile.

  3. Type the following command:


    # /usr/sbin/dhcpconfig -R addresses
    

    addresses are the comma-separated IP addresses of DHCP servers to which you want requests to be forwarded.

How to Unconfigure a DHCP Server or BOOTP Relay Agent (dhcpconfig -U)

  1. Become superuser or a user assigned to the DHCP Management profile.

  2. Type the following on the system that acts as DHCP server or BOOTP relay agent:


    # /usr/sbin/dhcpconfig -U 
    

    If the server does not use shared data (through NIS+ or text files shared through NFS), you can also use the -x option to remove the dhcptab and network tables. If the server uses shared data, do not use the -x option. The -h option can be used to remove host names from the host table. See the dhcpconfig man page for more information about dhcpconfig options.

    See DHCP Data on an Unconfigured Server for more information about removing data.

Configuring and Unconfiguring a DHCP Server Using Interactive dhcpconfig

This section includes procedures to help you configure and unconfigure a DHCP server or BOOTP relay agent by using dhcpconfig interactively without command-line options. See How to Configure a DHCP Server (dhcpconfig -D) if you want to use dhcpconfig noninteractively.

When you start dhcpconfig without command-line options, the DHCP Configuration menu is displayed, as shown in the following figure.

Figure 3–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 (Interactive 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 or a user assigned to the DHCP Management profile.

  4. Type the following command:


    #/usr/sbin/dhcpconfig
    

    The text-based DHCP Configuration menu is displayed as shown in Figure 3–5.

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

  6. Answer the prompts as described in the following paragraphs.

    Use the decisions you made after you read Chapter 2, 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.


    ###     DHCP Service Configuration      ###
    ###     Configure DHCP Database Type and Location      ###
     
    Enter data store (SUNWbinfiles, SUNWfiles or SUNWnisplus) [SUNWnisplus]:

    Type the name of the data store you have decided to use: SUNWbinfiles, SUNWfiles, or SUNWnisplus.

    See the guidelines in Choosing the Data Store if you need more information about the data store.


    Enter full path to data location [default-for-data-store]:

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


    Enter location for hosts data (none, files, dns, or nisplus) [none]:

    Type the name service that you want DHCP to use to register the host names of DHCP clients. See Client Host Name Registration for more information. If you select none, you must add host names manually to a name service.


    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.


    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 Changing DHCP Logging Options 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 Changing DHCP Logging Options for information about the local facility for transaction logging.


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

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

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


    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 scheduled rescans are not necessary if you use DHCP Manager. Generally, you should use a rescan interval only under the following circumstances:

    • The data store is NIS+ and you have more than one DHCP server on your network. Scheduled rescans guarantee 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 before it reloads 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:


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

    At this point, you can configure the networks that should use DHCP. Refer to the decisions you made after you read Making Decisions for IP Address Management. If you are not ready to configure IP addresses, type N to return 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 (Interactive dhcpconfig)

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

  2. Type the following command:


    # /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:


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

    Type one IP address or host name for a BOOTP or DHCP server to which requests should be forwarded and press Return. The prompt appears again to allow you to type more addresses or host names. Type a period and press Return when you are finished.


    ###     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 Changing DHCP Logging Options 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 Changing DHCP Logging Options for information about the local facility for transaction logging.

    The DHCP Configuration menu is redisplayed.

  5. Type 4 to exit dhcpconfig.

Configuring Networks Using Interactive dhcpconfig

This section describes the procedures for placing a network under DHCP management with the dhcpconfig utility. Each procedure assumes that you have completed the server configuration and you now want to add networks to the DHCP service.

How to Configure the Local Network (Interactive 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 configure the local network.


    Enable DHCP/BOOTP support of networks you select? ([Y]/N):Y
    Configure BOOTP/DHCP on local LAN network: 102.31.0.0? ([Y]/N):Y
    
  5. Answer the following prompts about client host name generation.


    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. SeeClient 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 [102.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: 102.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.

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

How to Configure Remote Networks (Interactive 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 configure a remote network.


    Enable DHCP/BOOTP support of networks you select? ([Y]/N):Y
    Configure BOOTP/DHCP on local LAN network: 102.21.0.0? ([Y]/N):N
    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 host names 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.


    Enter starting IP address [102.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. The dhcpconfig utility uses this number and the starting IP address you entered previously to determine a block of IP addresses 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 "102.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 102.21.0.0 address(es)? (Y/[N]):

    The dhcpconfig utility 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: 102.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.

Unconfiguring DHCP Servers and BOOTP Relay Agents With Interactive dhcpconfig

When you unconfigure a DHCP server, the server daemon stops and does not start automatically when the system reboots. The server configuration file is deleted as well. Before 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 and leave the data intact if you do not remove the tables when prompted to do so.

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

  1. Become superuser on the server system.

  2. Type the following command:


    # /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/inet/dhcpsvc.conf.
    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. You do not need to do anything else on the Solaris client to use DHCP.

If a client system 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 your client is not a Solaris client, consult the client documentation for configuration instructions.

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

  2. If this system uses preconfiguration instead of interactive configuration, edit the sysidcfg file to add the dhcp subkey to the network_interface keyword.

    For example, network_interface=le0 {dhcp}. See the sysidcfg(4) man page for more information.

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


    # sys-unconfig
    

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

  4. Reboot the system after it has completely shut down.

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

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

    If you preconfigured the system by using a sysidcfg file, insert the network_interface keyword, and specify dhcp as a dependent keyword. For example, network_interface=le0 {dhcp}.

How to Unconfigure a Solaris DHCP Client

  1. Become superuser on the client system.

  2. If you use a sysidcfg file to preconfigure the client, remove the dhcp subkey from the network_interface keyword.

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


    # sys-unconfig
    

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

  4. Reboot the system after it has completely shut down.

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

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

    If you use sysidcfg to specify configuration, you will not be prompted.