Assign a Specific IP Address to Each Compute Node (Create DHCP Reservations)
Updated: June 17, 2009
Applies To: Windows HPC Server 2008
In certain scenarios, you may want to have specific IP addresses for each compute node in your Windows HPC Server 2008 cluster. For example, you may have an application running on your cluster for which you need to specify the IP addresses of your compute nodes. An efficient way to accomplish this is to create reservations of IP addresses on the Dynamic Host Configuration Protocol (DHCP) server, so that when each node is turned on and requests an IP address from the DHCP server, it is assigned the IP address that you specify.
DHCP reservations of IP addresses are based on Media Access Control (MAC) addresses. Each reserved IP address is linked to the MAC address of the network adapter to which that IP address will be assigned. For this reason, you will need a list of the MAC address of each network adapter in your compute nodes. After you have compiled a list with the MAC addresses, you can write a script that creates the DHCP reservations.
If you have enabled DHCP server on the head node of your cluster, you can use in your script the
add reservedip command of the
netsh command-line tool. The following is the syntax for this command:
netsh DHCP server scope <Scope> add reservedip <IPaddress> <MACaddress> [ClientName] [ClientComment]
<Scope>is the DHCP scope of the cluster network for which you want to create IP address reservations. For example,
10.1.0.0. You can see a list of available scopes by running on the head node the following command from a Command Prompt window:
netsh DHCP server show scope
<IPaddress>is the IP address that you want to assign to the compute node. The IP address that you specify must be within the range of the scope that you specify for
<MACaddress>is the MAC address of the network adapter for which you want to specify the IP address.
[ClientName]is an optional parameter that you might want to use to specify the name of the compute node.
[ClientComment]is an optional parameter that you might want to use to specify information about the location of the compute node, or to specify similar information about the compute node. If the value that you specify for this parameter contains blank spaces, you have to enclose the value in quotation marks.
For more information about the
add reservedip command of the
netsh command-line tool, see “Netsh DHCP server scope” in Netsh commands for DHCP (http://go.microsoft.com/fwlink/?LinkID=154295).
The script that you write to create the DHCP reservations can be a simple batch file with a
netsh command for each reservation, or it could be a more complex script that parses a file that contains the list of MAC addresses and then runs the
netsh command for each MAC address. The following is an example of a simple batch file script that includes a
netsh command for each reservation for ten compute nodes:
netsh DHCP server scope 10.0.0.0 add reservedip 10.0.1.1 001E0BDAE564 netsh DHCP server scope 10.0.0.0 add reservedip 10.0.1.2 001E0BDAD950 netsh DHCP server scope 10.0.0.0 add reservedip 10.0.1.3 001E0B70530A netsh DHCP server scope 10.0.0.0 add reservedip 10.0.1.4 001E0BDADA23 netsh DHCP server scope 10.0.0.0 add reservedip 10.0.1.5 001E0BDB047E netsh DHCP server scope 10.0.0.0 add reservedip 10.0.2.1 001E0BDB15A1 netsh DHCP server scope 10.0.0.0 add reservedip 10.0.2.2 001E0BDAC478 netsh DHCP server scope 10.0.0.0 add reservedip 10.0.2.3 001E0BDAF7FC netsh DHCP server scope 10.0.0.0 add reservedip 10.0.2.4 001E0BD5DA35 netsh DHCP server scope 10.0.0.0 add reservedip 10.0.2.5 001E0BDAFA3D