9.2 DHCP Installation and Configuration

9.2.1 Prerequisites

  • Novell Cluster Services 1.8.8

  • DHCP must be installed on every server that will run it.

Novell Cluster Services 1.8 provides a DHCP resource template, which facilitates configuring DHCP with a shared Linux POSIX volume in a cluster environment. Use the instructions in Creating Linux POSIX Volumes on Shared Devices in the OES 2 SP3: Novell Cluster Services 1.8.8 Administration Guide for Linux. Afterwards, cluster-enable the shared volume by using the DHCP template.

For details on installing the DHCP server, see Section 6.0, Installing and Configuring DHCP.

For details on Cluster Services, see Overview of Novell Cluster Services.

9.2.2 Configuring DHCP on the Shared Disk

To configure DHCP to use shared storage, you need to create a shared directory (file system or disk) on the shared disk system and create mount points to that shared file system on each cluster server that will run DHCP.

  1. Use EVMS to create a file system on the shared disk system.

    Enter evmsgui at the Linux server to start the EVMSGUI utility.

    For instructions, see Configuring Cluster Resources for Shared NSS Pools and Volumes in the OES 2 SP3: Novell Cluster Services 1.8.8 Administration Guide for Linux.

  2. On each cluster node that runs DHCP, create the directory path that is used as the mount point. At a terminal console prompt, log in as the root user, then enter mkdir /mnt/dhcp.

  3. Log in as the root user and mount the shared disk (file system) that was created in Step 1.

    For example, depending on the mount point and directory names, you could enter a command similar to the following to mount the shared disk:

    mount /dev/evms/dhcp /mnt/dhcp

  4. At the root of the shared disk you just created (/mnt/dhcp), enter the following commands to create the directories specified:

    mkdir etc

    mkdir -p var/lib/dhcp/db

    The db directory must be owned by the user that is used in /etc/sysconfig/dhcpd in the parameter DHCPD_RUN_AS="dhcpd". Also, all the four directories must have permissions of drwxr-xr-x.

9.2.3 Configuring the dhcpd.conf File

  1. Copy the dhcpd.conf file from the /etc directory on one of the OES 2 Linux cluster servers to the etc directory you created on the shared disk in Step 4.

    This would be the /mnt/dhcp/etc directory if you used the same directory names as those given in the example above.

  2. Modify the LDAP attributes as required. For example, ldap-server 192.168.0.1; ldap-dhcp-server-cn DHCP_acme;

9.2.4 Creating a dhcpd.leases File

A dhcpd.leases file is necessary for DHCP to function. The DHCP daemon requires this file before it starts. The file can be empty, and it must reside in the var/lib/dhcp/db directory you created in Step 4.

One way to create the empty file is to use the touch command. For example, if you used the directory names listed in the example above, you could enter the following to create an empty dhcpd.leases file:

touch /mnt/dhcp/var/lib/dhcp/db/dhcpd.leases

9.2.5 Novell Cluster Services Configuration and Setup

After DHCP is properly installed and configured, you must create and configure a DHCP resource in Novell Cluster Services. This includes configuring DHCP load and unload scripts, setting DHCP start, failover, and failback modes, and assigning the DHCP resource to specific servers in your cluster.

Creating a DHCP Cluster Resource

Novell Cluster Services includes a DHCP resource template, which greatly simplifies the process for creating a DHCP cluster resource. Much of the DHCP cluster resource configuration is performed automatically by the DHCP resource template.

To create a DHCP cluster resource:

  1. Ensure that the shared disk (file system) you created and mounted in Step 2 is unmounted.

    If you used the directory names specified in the example, you can enter unmount /mnt/dhcp to unmount the shared disk.

  2. Open your Internet browser and enter the URL for iManager.

    The URL is http://server_ip_address/nps/iManager.html. Replace server_ip_address with the IP address or DNS name of a server in the cluster or with the IP address for Apache-based services.

  3. Enter your username and password.

  4. In the left column, locate Clusters and then click the Cluster Options link.

    iManager displays three links under Clusters that you can use to configure and manage your cluster.

  5. Specify the cluster name, or browse and select it, then click the New link.

  6. Specify Resource as the resource type you want to create by clicking the Resource radio button, then click Next.

  7. Specify a name for the DHCP resource.

    Do not use periods in cluster resource names. Novell clients interpret periods as delimiters. If you use a space in a cluster resource name, that space is converted to an underscore.

  8. Type the DHCP template name in the Inherit From Template field, or browse and select it from the list.

  9. Select the Define Additional Properties check box, click Next, then continue with Configuring DHCP Load and Unload Scripts.

    The DHCP resource template configures the DHCP resource by automatically creating DHCP load and unload scripts, setting failover and failback modes, and assigning DHCP as a resource to all nodes in the cluster.

Configuring DHCP Load and Unload Scripts

Table 9-1 Sample Values for DHCP Load and Unload Scripts

Variable

Template Value

Description

Resource_IP

a.b.c.d

IP address of the virtual cluster server for this cluster resource.

MOUNT_FS

reiserfs

The file system type you made on the EVMS volume.

container_name

name

The name you gave to the cluster segment manager.

MOUNT_POINT

/mnt/dhcp

The mount location for the EVMS volume you created. This example shows a mount location with a directory named the same as the EVMS volume name. You can mount the EVMS volume anywhere.

MOUNT_DEV

/dev/evms/$container_name/dhcp

The Linux path for the EVMS volume you created.

Load Script Configuration

The DHCP load script page should already be displayed. The load script contains commands to start the DHCP service. You must customize some commands for your specific DHCP configuration.

NOTE:The scripts in this section are based on the template values in Table 9-1. Make sure to substitute the sample values with the ones you used in your solution.

The load script appears similar to the following example:

#!/bin/bash
. /opt/novell/ncs/lib/ncsfuncs

# Template for clustering the ISC DHCP daemon.
# You should not configure failover within the DHCP server itself.
# Instead, let NCS manage the failover.

# define the IP address
RESOURCE_IP=a.b.c.d
# define the file system type
MOUNT_FS=reiserfs
#define the container name
container_name=name
# define the device
MOUNT_DEV=/dev/evms/$container_name/dhcp
# define the mount point
MOUNT_POINT=/mnt/dhcp

#activate the container
exit_on_error activate_evms_container $container_name $MOUNT_DEV
$NCS_TIMEOUT

# mount the file system
exit_on_error mount_fs $MOUNT_DEV $MOUNT_POINT $MOUNT_FS

# add the IP address
exit_on_error add_secondary_ipaddress $RESOURCE_IP

# invoke DHCP load script
exit_on_error /opt/novell/dhcp/bin/cluster_dhcpd.sh -m <$MOUNT_POINT>

# return status
exit 0

To customize the DHCP load script for your specific configuration:

  1. View and, if necessary, edit the following lines for your specific container name, device, and mount point:

    #define the container name
    container_name=name
    # define the device
    MOUNT_DEV=/dev/evms/$container_name/dhcp
    # define the mount point
    MOUNT_POINT=/mnt/dhcp
    
  2. Edit the following line to assign a unique IP address to the DHCP cluster resource:

    RESOURCE_IP=a.b.c.d
    

    Replace <a.b.c.d> with the IP address you want to assign to the DHCP cluster resource.

    The IP address for the DHCP cluster resource allows clients to reconnect to that address regardless of which server is hosting it.

  3. Click Next and continue with the Unload Script Configuration.

Unload Script Configuration

The DHCP unload script page should now be displayed. The unload script contains commands to stop the DHCP service. You must customize some commands for your specific DHCP configuration.

NOTE:The scripts in this section are based on the template values in Table 9-1. Make sure to substitute the sample values with the ones you used in your solution.

The unload script appears similar to the following example:

#!/bin/bash
. /opt/novell/ncs/lib/ncsfuncs

# define the IP address
RESOURCE_IP=a.b.c.d
# define the file system type
MOUNT_FS=reiserfs
#define the container name
container_name=name
# define the device
MOUNT_DEV=/dev/evms/$container_name/dhcp
# define the mount point
MOUNT_POINT=/mnt/dhcp

# request dhcpd stop
ignore_error killproc -p /var/run/dhcpd.pid -TERM /usr/sbin/dhcpd

# del the IP address
ignore_error del_secondary_ipaddress $RESOURCE_IP

# umount the file system
sleep 10 # if not using SMS for backup, please comment out this line
exit_on_error umount_fs $MOUNT_DEV $MOUNT_POINT $MOUNT_FS

#deactivate the container
exit_on_error deactivate_evms_container $container_name $NCS_TIMEOUT

# return status
exit 0
  1. View and, if necessary edit the container name, device, and mount point in the applicable lines of the unload script.

  2. Replace <a.b.c.d> with the same IP address you specified in the load script, then click Next.

    The page to set Start, Failover, and Failback modes is now displayed

  3. Continue with Setting DHCP Start, Failover, and Failback Modes

Setting DHCP Start, Failover, and Failback Modes

  1. The DHCP resource template sets the DHCP resource Start mode and Failover mode to Auto and the Failback Mode to Disable.

    • If the DHCP resource Start mode is set to Auto, the DHCP server automatically loads on a designated server when the cluster is first brought up. If the DHCP Start mode is set to Manual, you can manually start DHCP on a specific server when you want, instead of having it automatically start when servers in the cluster are brought up.

    • If the DHCP Failover mode is set to Auto, the DHCP server automatically moves to the next server in the Assigned Nodes list in the event of a hardware or software failure. If the DHCP Failover mode is set to Manual, you can intervene after a failure occurs and before the DHCP server is started on another node.

    • If the DHCP Failback mode is set to Disable, the DHCP server continues running on the node it has failed to. If the DHCP Failback Mode is set to Auto, the DHCP server automatically moves back to its preferred node when the preferred node is brought back online. Set the DHCP Failback mode to Manual to prevent the DHCP server from moving back to its preferred node when that node is brought back online, until you are ready to allow it to happen.x

  2. View or change the DHCP resource Start, Failover, and Failback modes, then click Next and continue with View or Edit DHCP Resource Server Assignments.

View or Edit DHCP Resource Server Assignments

The page to view or change DHCP resource server assignments should now be displayed. The DHCP resource template automatically assigns the DHCP resource to all nodes in the cluster. The order of assignment is the order the nodes appear in the resource list.

To view or edit DHCP resource node assignments or change the server failover order:

  1. From the list of unassigned nodes, select the server you want the resource assigned to, then click the right-arrow button to move the selected server to the Assigned Nodes list.

    Repeat this step for all servers you want assigned to the resource. You can also use the left-arrow button to unassign servers from the resource.

  2. Click the up-arrow and down-arrow buttons to change the failover order of the servers assigned to the resource or volume.

  3. Click Apply or Finish to save node assignment changes.