Solved

WIN2008 R2 clients convert from static IP to dhcp

Posted on 2014-01-18
8
346 Views
Last Modified: 2014-01-24
Hello,
on a 800 winxp wks recently migrated to win 2008 R2 domain ( consists of 10 subnets ), is needed to change IP from static to dynamic but it is mandatory to keep the existing ip address.

Are there ways to import onto dhcp scopes ?

Changing from static to dhcp directly from tcp/ip setting will keep the existing IP ? ( if yes a script can be developed and configured in one GPO.

Thanks a lot!
0
Comment
Question by:pablito70
8 Comments
 
LVL 70

Expert Comment

by:KCTS
ID: 39791008
With DHCP there is no guarantee that machines will get the same IP address unless you specify reservations for IPs.
0
 
LVL 10

Expert Comment

by:Korbus
ID: 39791011
I'm not quite sure I understand your question.  I hope I'm not just stating what you already know.

You will need to specify in your DHCP reservations, both the mac address and IP address of each PC.   If you do this first, then yes, when you change the workstation to DHCP it will be assigned the same address.
0
 
LVL 25

Assisted Solution

by:Zephyr ICT
Zephyr ICT earned 50 total points
ID: 39791026
Like the other experts mentioned, you'll have to turn all the fixed IP-addresses into DHCP reservations...

There's some scripts out there on the Internet that could get you started with that if need be:

For example:

http://community.spiceworks.com/how_to/show/9060-import-dhcp-reservations-from-csv-via-powershell
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 
LVL 2

Author Comment

by:pablito70
ID: 39791034
Hello, thanks for quick reply.
Reservation is the deal, but considering 800 macadresses and related IP, adding manually from DHCP snap-in will takes a long long time ... Is there a way , through netsh for example, to import data ? Of course the lan administrators already have a plain text database with AD machine names, macaddress, ip addres, vlan.

So the input file is ready ( and can be modified as per needs ).

What is missing how to import ...
0
 
LVL 14

Accepted Solution

by:
Don Thomson earned 450 total points
ID: 39791098
You may be able to do this :

(from http://social.technet.microsoft.com/Forums/en-US/0d3e7bf1-632d-46e0-926b-db8b27d041ed/2008-r2-dhcp-importing-reservations


The commandline format for specifying Reservations is as follows:

NetSh Dhcp Server [DHCP_SERVER_IP] Scope [SCOPE] Add reservedip [RESERVED_IP] [MAC] "[RES_NAME]" "[DESCRIPTION]" "[BOOTP/DHCP/BOTH]"

example:

NetSh Dhcp Server 10.1.0.1 Scope 10.1.0.0 Add reservedip 10.1.0.10 00123456789A "PC1" "PC1-2008R2" "BOTH"

 

If you add all reservations in a text file, you can run (make sure you take the NetSh bit off the line if you put it into a file):

NetSh Exec [FOLDER_LOCATION\FILE.NAME]

 

You can also extract a current DHCP configuration by running:

NetSh DHCP Server Dump > [FOLDER_LOCATION\FILE.NAME]

 

On a side note, if you want to create reservations in 2008 / R2, you need to create a scope which covers the entire range you want to use, and then add an exclusion range for addresses you dont want to be issued by DHCP
0
 
LVL 70

Expert Comment

by:KCTS
ID: 39791527
Turning the question around a little - why is necessary for all machines to retain the same IP address ?
0
 
LVL 16

Expert Comment

by:vivigatt
ID: 39792879
I am not certain that the following will work, but I think it should:
Create temporary reservations for each client and use a long enough lease time.
Once a client has received a particular IP address from DHCP, it will usually try to get the same address again and again, especially if its dhcp lease has not expired.
This way, you should be reasonably sure that the client will get the "same" IP address and yet have the flexibility of a true dhcp, without reservations.

Creating reservations can be done with netsh, but I must admit that it would be better if it could be done from the client side (since they "know" their own IP and mac address). Yet, running netsh on a client so that it adds a dhcp reservation on a remote dhcp server is not an easy thing, if even doable. You could use psexec for that, but it may have some drawbacks.
0
 
LVL 14

Expert Comment

by:Don Thomson
ID: 39794123
If you created a batch file to create each reservation it could all be run right on the server - no need to run it at each workstation.   This is assuming that you currently have a file that contains all the current IPs and MAC addresses of all your users.
0

Featured Post

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The password reset disk is often mentioned as the best solution to deal with the lost Windows password problem. In Windows 2008, 7, Vista and XP, a password reset disk can be easily created. But besides Windows 7/Vista/XP, Windows Server 2008 and ot…
Restoring deleted objects in Active Directory has been a standard feature in Active Directory for many years, yet some admins may not know what is available.
This tutorial will show how to push an installation of Backup Exec to an additional server in both 2012 and 2014 versions of the software. Click on the Backup Exec button in the upper left corner. From here, select Installation and Licensing, then I…
This tutorial will walk an individual through the steps necessary to join and promote the first Windows Server 2012 domain controller into an Active Directory environment running on Windows Server 2008. Determine the location of the FSMO roles by lo…

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question