DHCP Client for NetWare
Articles and Tips: tip
01 Apr 2000
Contributed by Ken Nielson
Software Engineer, Novell, Inc.
NetWare 5.1 ships with a DHCP (Dynamic Host Configuration Protocol) Client for the server, which is known as the DHCPCLNT.NLM. This program will allow a server to obtain an IP address dynamically, as it initially boots or even after the server has been up and running. While most servers will be configured with a static IP address through the BIND statement in the AUTOEXEC.NCF file (or through the INETCFG utility), there are some situations where using DHCP Client to get an IP address for the server is more convenient, and sometimes it may be necessary. This NetNote gives an overview of DHCP, how the DHCPCLNT.NLM works, and explains the syntax of DHCPCLNT.NLM.
DHCP is a protocol used by nodes on a network to dynamically obtain IP addresses. IP addresses are placed in a table (pool) which can then be allocated to network nodes as they are requested. By using DHCP, network administrators don't need to statically allocate addresses each time a new node is added to the network, or when a node moves to a different subnet.
DHCP also helps to better deploy IP addresses, since not all nodes are active on a network all of the time. When a node is active, it obtains an IP address. When that node is no longer active, it returns the IP address to the pool and makes it available for other nodes.
Traditionally, server nodes have used static IP addresses. It is important for clients to know where servers and located and which are available, so clients can log on and get to the services they need. However, with the use of dynamic DNS and SLP, having just a name can be sufficient to find the address of a server. Servers can now obtain addresses dynamically from an ISP on a modem connection. IS departments can more easily accommodate new servers without the need to manually allocate IP addresses.
One danger of this approach in a NetWare environment is the need for Novell Directory Services (NDS) to be able to find servers in the same tree. NDS allows servers to change IP addresses, but when a server does change its address, that server needs to update the directory tree so that everyone else in the tree knows of the new address. When several servers change their IP addresses simultaneously, it may become impossible for each server to get a reference to other servers in the tree. This needs to be avoided. If you wish to use the DHCP Client to obtain IP addresses for some servers in a multi-server tree, you will need to manage the risk of two or more servers rebooting with new IP addresses.
When the DHCPCLNT.NLM starts, it checks to see if an IP address has previously been obtained for that server through the use of DHCP. If the server has, the DHCP Client utility tries to renew the lease for that address. If no address has existed previously or if the DHCP Client utility cannot renew the last lease, it begins the discover process to obtain a new IP address through DHCP.
If no IP address can be obtained, the DHCP Client utility will use ARP to see if the last IP address it successfully used is currently being used anywhere else on the network. If not, the DHCP Client utility will then bind IP to the last IP address used. This allows the server to still operate in instances where a DHCP server is not currently available.
Syntax for the DHCP Client Utility
To get help on the syntax, options, and flags that are available for the DHCPCLNT.NLM type DHCPCLNT /help (or -help) at the NetWare console prompt and a screen of information similar to the following will appear:
DHCPCLNT -HELP --- Display this help screen
DHCPCLNT NAME=<logical board name> [options] [-|/][flags]
HOST = <Host Name> Update SYS:ETC\HOSTS file for <Host Name>
LEASE=seconds Minimum lease in seconds
RS=<Address> Release the assigned DHCP Secondary Address
TIMEOUT=seconds DHCP wait for reply timeout in seconds
-HELP Display this help Screen
-INETCFG Update inetcfg
-RELEASE Release the primary DHCP Address
This will also release all secondary addresses.
-SECONDARY Get a secondary IP address for this board
-INFO Display DHCP address, gateway address, subnet mask, lease length, lease expiration time, etc.
DHCPCLNT NAME=<logical board name> - This is a required field for all DHCPCLNT.NLM operations, except for the help flag, and is how the DHCPCLNT.NLM knows with which network board to work. The logical board name is the name assigned to the LAN driver when it was loaded. For example:
LOAD E100B.LAN SLOT=2 FRAME=ETHERNET_II NAME=E100B_1_EII
In this example, E100B_1_EII is the logical board name as it is defined in the AUTOEXEC.NCF file. To have DHCPCLNT.NLM obtain an address for this board, at the console prompt you would type:
The Options Portion of the Help Screen
HOST=<Host Name> This option allows you to specify a host name that is different than the server name. By default the host name will use the server's name in this field. DHCPCLNT.NLM will update the SYS:ETC\HOSTS file with the newly obtained address. If a different DNS name is needed, other than the server name, this option allows the administrator to designate that name in the <Host Name> field. An example of using this option follows:
DHCPCLNT NAME=CE100B_1_EII HOST=PRV-KAYLEE.PROVO.NOVELL.COM
LEASE=<seconds> This allows the administrator to set a minimum lease time to accept as DHCPCLNT.NLM reviews the offers of IP addresses that it receives from the DHCP servers. This value is in seconds. A value of -1 designates that a permanent lease is wanted. By default, DHCPCLNT.NLM will accept the first offer it receives. An example of using this option follows:
DHCPCLNT NAME=CE100B_1_EII LEASE=120000
RS=<Address> RS stands for Release Secondary and allows the administrator to release a secondary IP address.
TIMEOUT=<seconds> This parameter allows the administrator to configure how long to wait for a DHCP server reply before timing out in between retries. The default is two seconds with three retries. On a network with slow response times, it might be necessary to increase the amount of time to wait for the DHCP server to respond.
DHCPCLNT NAME=CE100B_1_EII TIMEOUT=6
Flags [-|/] - Flags are denoted by preceding the flag with either a `-` or a `/'; flags are as follows:
HELP This option displays the help screen which we are presently explaining. An example of using this option follows:
INETCFG If a server is using INETCFG to configure the IP information of a server, it becomes necessary to update INETCFG when the IP addresses change. The INETCFG flag directs DHCPCLNT.NLM to update INETCFG data file with the new IP information. If a network address translator (NAT) has been configured with INETCFG, the NAT will also be updated, but INETCFG may not show the updated information. An example of using this option follows:
RELEASE This option manually releases all addresses obtained by DHCP for this board. The first IP address obtained using DHCPCLNT.NLM is always the primary address. All other addresses are secondary. The RELEASE flag is the only way to release the primary address. Because secondary IP addresses cannot exist without a primary address, when this flag is used, all IP addresses are released. An example of this option:
SECONDARY This option directs DHCPCLNT.NLM to get a secondary address. An example of this option:
INFO This option displays all current IP addresses assigned by DHCP to this server. It also displays the subnet mask, the gateway address, the length of leases obtained, how long they have been held, as well as how long until the leases will be renewed, and when the leases will expire. An example of this option:
The DHCP Client utility gives network administrators an additional tool in managing the distribution of IP addresses on their networks. It can also be used to save money by allowing servers to obtain addresses dynamically from ISPs, eliminating the need to pay for a static address.
* Originally published in Novell AppNotes
The origin of this information may be internal or external to Novell. While Novell makes all reasonable efforts to verify this information, Novell does not make explicit or implied claims to its validity.