Changing static IP Address to DHCP and vice-versa over network

Microsoft has already published an article to change Static IP address to DHCP over the network. One day I had to fight with this situation. I had to change all static clients to DHCP-aware using the article published at Microsoft support site: http://support.microsoft.com/kb/q194407/

In deed, the above article is useful but it requires a lot of manual effort. You need to connect every computer through “Remote Registry API” and then change the required detail in regsitry for all computers – so the pain!

This is lengthy task when you need to do the manual work on more than 100 computers.

I have pointed out a solution for situation for network administrators who fight against manual process.

I have found the following ways to do so:

1. Using WININSTLE you find the registry keys for DHCP Client machine when they obtain IP Address automatically from DHCP Server.

2. Using PSEXEC (if you’re network is in Workgroup Security Model) or Group Policy (If you’re in Domain Security Model) to deploy DHCP Client settings remotely with a text file pre-configured which can be used to differenciate between IP addresses used by client machines.

You need to install and run WinInstLE on one of your client computer.

1. Goto a client machine.

2. Install WININSTLE. This utility is located at Windows 2000 CD.

3. Run WININSTLE. Perform *Before Snapshot* operation.

4. Give a path to save MSI file and registry informations.

5. Restart client computer.

6. Configure client machine to obtain IP address automatically from DHCP Server.

7. After restarting client computer, run *After Snapshot*. This will record any changes made during the operation DHCP Client contacted and got IP Addrss from DHCP Server.

8. Edit the *.REG file and delete the IP Address it got from DHCP Server. This will make sure that all the client computers use unique IP Address on network. Save this file.

9. Now you have two files to deploy either using PSEXEC or Group Policy.

MSI file
REG file

10. You can deploy this MSI file (that is the configuration of DHCP Client) using Group Policy Software Installation snap-in.

OR

You can deploy this MSI file or REG file using PSEXEC remotely on all client computers. By using PSEXEC you can specify a text file which keeps informations about the IP Address+Client computer name.

Now you need to put everything together to get things working. This is how you do it: –

NOTE: The only unique filed required in DHCP Configuration is IP Address.

1. You have got a REG file with you from WININSTLE. Edit this REG file and remove the IP Address value. I think you have already done in above steps.

2. Save this REG file.

3. Copy the full MSI folder to server from where you want to deploy DHCP settings.

4. Deploy this MSI file using Software Installation snap-in.

5. After deploy MSI file all configuration settings will be saved in all client computers except IP Address.

6. Next client computers will restart and obtain IP Address from DHCP Server.

NOTE: If you want to enable DHCP for other connection specify the name of connection in netsh command.

netsh interface ip set address “Local Area Connection” dhcp

This should work well.

SUMMARY: –

The following is required for client to be a DHCP Client when configuring manually

DHCP Client service should be started.

Client LAN connection should be set to *Obtain IP from DHCP Server*.

netsh interface ip set address “Local Area Connection” dhcp

DHCP Client must have a unique IP Address on network.

Some registry entries as described in the above article must be set.

HKLM\SYSTEM\CurrentControlSet\Services\XXXXXX\Parameters\TCPIP, where XXXXXX is the value of ServiceName found in the step 3 in the above article.

EnableDHCP = 1
IPAddress = 0.0.0.0
SubnetMask = 0.0.0.0
DHCPDefaultGateway = 192.168.0.1 — If you are using some other gateway then you need to put it in script or manually in registry.
DHCPIPAddress = 192.168.0.5 — IP got from DHCP server.
DHCPServer = 192.168.0.1 — IP Address of DHCP server.

You don’t need to restart workstation. Simply restart DHCP Client service on destination computer using a script.

One thought on “Changing static IP Address to DHCP and vice-versa over network”

Leave a Reply

Your email address will not be published. Required fields are marked *