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

DHCP export

All, can I perform the following using the netsh command..?

I am VLAN'n my network (due to our current single subnet running our of IP adresses, and other reasons) I want to be able to take the reservations that I have on scope 90 and when I create a new scope, say 91, export the reservations and import them into 91, having first taken the export file and edited to ref the new scope, this way i wont lose the mac addresse assigments of the reservations I have set up...

Is this possible?

Cheers

0
credmood
Asked:
credmood
1 Solution
 
Jay_Jay70Commented:
Hi credmood,

i have never seen a way to import and export dhcp reservations in any way thats one of the problems with MAC address reservations in DHCP is that when you move scope you have to manually configure the whole lot again!

Cheers!
0
 
Jay_Jay70Commented:
credmood,

will be interested if there is a way though...
0
 
vsg375Commented:
Hi,

You can proceed as follows :

1. Dump config to a text file : netsh dhcp server \\yourservername dump >config.txt
2. Edit the file as needed
3. Import the modified conf : netsh dhcp server \\yourservername import config.txt
4. Restart the DHCP service.

HTH
Cheers
0
Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

 
credmoodAuthor Commented:
Thanks for this, 1 question, you say restart the dhcp service? does this mean (and I assume this is the case, im just asking for sanity sake) do you have to stop the dhcp service before attempting to dump it to a text file?
0
 
vsg375Commented:
not necessarily, but if you want to take into account the modifications you've made in the file, the service has to be restarted.

Cheers
0
 
vsg375Commented:
On the other hand, it's always good to stop the service prior to dumping. The main drawback of this is that new potential dhcp clients won't be able to get an address, but if you're quick enough, no one will notice... ;o)

HTH
Cheers
0
 
dvalentineCommented:
It would be nice if folks tested their solutions before publishing them.. the above solution, although good, is incorrect.  The correct method is as follows;

1. Dump config to a text file : netsh dhcp server \\yourservername dump >config.txt
2. Edit the file as needed
3. Import the modified conf : netsh exec config.txt
4. Restart the DHCP service.



0
 
brightcoveCommented:
In regards to dvalentine's correct method...

Can this be used to:
dump my existing config of my 255.255.252.0 network (including reservations)
delete my existing scope
modify txt in order to expand my network to a 255.255.248.0 network (including old reservations)
import modified conf
restart DHCP service

Enjoy all my old reservations and have a bunch more IP's??

0
 
moomee2Commented:
Brightcove,

did this work for you?
0
 
denisproulx3Commented:
I've just tested dvalentine's solution for brightcove' question and it's work perfect.

thanks!
0
 
ranwebCommented:
What command can or could be used to import the file into another scope.  I have a current production scope and want to migrate an edited config file into a new scope that has a new IP range.  I am changing the IP Scope of the entire network and don't want to re-type the reservation if possible!

Thanks
Randy
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

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