System Administration Guide, Volume 3

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.