• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 366
  • Last Modified:

WIN2008 R2 clients convert from static IP to dhcp

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
pablito70
Asked:
pablito70
2 Solutions
 
Brian PiercePhotographerCommented:
With DHCP there is no guarantee that machines will get the same IP address unless you specify reservations for IPs.
0
 
KorbusCommented:
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
 
Zephyr ICTCloud ArchitectCommented:
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
Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 
pablito70Author Commented:
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
 
Don ThomsonCommented:
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
 
Brian PiercePhotographerCommented:
Turning the question around a little - why is necessary for all machines to retain the same IP address ?
0
 
vivigattCommented:
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
 
Don ThomsonCommented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: CompTIA Healthcare IT Tech

This course will help prep you to earn the CompTIA Healthcare IT Technician certification showing that you have the knowledge and skills needed to succeed in installing, managing, and troubleshooting IT systems in medical and clinical settings.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now