Link to home
Avatar of old_hickory

asked on

Increase DHCP numbers

I have a current DHCP scope of 192.168.1.X with a subnet of I am planning to increase the DHCP capacity by changing the subnet to I recently moved the current DHCP server from a 2003 server to a 2008 server. I have already changed all the static devices. I think I need to unauthorize the current server. change the subnet and reauthorize. If I do this will I lose my reservations? Is there an easy way to do this? I am new to 2008. So far everything I have done has gone without a hitch. I want to keep it that way. Thanks in advance for your help and advice.
Avatar of jffrybauer

Here's the process I always use to move DHCP scope from an old server to new.  (2003 > 2003 -or- 2003 > 2008 -or-2008 > 2008).  This copies the entire DHCP database from old to new server.  It will keep all your scope and reservation settings.

On oldserver:
 run from command promp: netsh dhcpserver export C:\dhcp.txt all
Copy dhcp.txt to new server

On newserver:
netsh dhcp server import <path to dhcp.txt> all
Authorize new server

Stop DHCP on old server, set service to disabled

Update scope as needed to reflect new subnet and any other changes, for example change DNS to reflect newserver as primary, oldserver as secondary if new server is primary DNS

edit - the command on oldserver should be:

netsh dhcp server export C:\dhcp.txt all

space between dhcp and server...
Avatar of old_hickory


This is what I did to move the DHCP from the old server to the new server. I want to change the subnet to make more IP numbers available. Thanks for your comment.
Ah, I see what you mean.  As far as I know, you have to delete the scope and recreate it in order to change subnet.  This would also mean you have to recreate your reservations.

See this link for some other insight in how best to hand out the new scope by reducing lease time and minimize conflict by hforcing DHCP to check for IP's in use:
So there is not an option to export the reservations from a 2008 server and import them into the new scope?? They have to all be entered again manually?
Give this a shot:

Stop DHCP service on newserver
Dump config to a text file on oldserver : netsh dhcp server \\yourservername dump >c:\config.txt
Delete everything except the lines "under "Start Add ReservedIp to the Scope" towards the end
***Make sure to change the DHCP Server IP to reflect your newserver
Import the modified config.txt on new server : netsh dhcp server \\yourservername import config.txt
Restart the DHCP service.

OK. newserver and oldserver are the config before and after the new scope is created. I have not used netsh before. Is that at the command prompt? It looks like a good solution. I just need a little more help.
Yup, netsh is from the command line.  

Edit the steps in my last comment.  I think you can import the entire scope this way, and update the subnet while keeping your reservations.

Also note, the "import" command should be:
netsh exec c:\config.txt

You could try these modified steps:
- delete scope on the 2008 newserver
- stop DHCP service on 2008
- on 2003:  netsh dhcp server \\yourservername dump >c:\config.txt
- edit this dump file ---Search and replace 2003oldserver IP with 2008newserver IP, then find the "start Add Ipranges" line and change your submnet mask right there.
- Carefully look through the dump and make any other changes you need to.
- import edited config.txt onto 2008newserver: netsh exec c:\config.txt
- restart DHCP service

in theory this will bring your entire dhcp scope, with modified subnet, and all reservations.
I really appreciate the time you are taking to help me through ths. Currently here is only one DHCP server. I already moved to the 2008 server, so there is no 2003 server involved any longer. Would the dump command be different on 2008? I set my lease times to 8 hours. I will be doing this tomorrow.

Thanks again for helping me.
No problem.  Hopefully this will work for you.  Ok, I see.  You have DHCP on 2008 with the correct reservations, but want to change the subnet.  This scope was previously moved from 2003, and 2003 no longer exists.

I would do this:

1. backup existing DHCP database (current scope, reservations, and subnet):
       netsh dhcpserver export C:\dhcp.txt all
2. dump existing DHCP to file:
       netsh dhcp server \\yourservername dump >c:\config.txt
3. Edit the config.txt.
       - You shouldn't have to worry about the server IP fields since this is the same server.
       - Just update the subnet mask
4. Delete existing, active DHCP scope through DHCP MMC. (you have a full backup as taken in step 1 that will at least get you back to current status with the subnet if need be)
5. Stop DHCP Service
6. import edited dump file:
       netsh exec c:\config.txt
7. Restart DHCP

This should configure the scope with the new subnet and keep your reservations.

If that doesn't work, I'm out of ideas, and you'll probably have to recreate the scope and all the reservations.


edit - damn, the command in step 1 is:

netsh dhcp server export C:\dhcp.txt all

that damn space between dhcp and server gets me every time...
I ran step 1, but it is only partially readable. I can sort of see some of the info, but not enough to edit it.
step 1 is a full backup of the DHCP database - not editable.  Get that file and put it somewhere safe.

Step 2 is the file you want to create to edit and re-import in step 6
Here is the spot I think I should edit by changing the to Why does it not show, which is the current subnet?

# =====================================
#     Add Optiondef                    
# =====================================

Dhcp Server \\myserver Add Optiondef 121 "Classless Static Routes" BINARY 0 comment="Destination, mask and router IP addresses in priority order"
Dhcp Server \\myserver Add Optiondef 1 "Subnet Mask" IPADDRESS 0 comment="Subnet mask in network byte order"
Mine reads the same for that line.  I think you want to edit the subnet a few lines lower - here:

# =====================================
#     Add Scope                        
# =====================================

Dhcp Server add scope "FMB" "FMB Scope"
Dhcp Server Scope set state 1

Those are my IP's and FMB is my network and scope, so you should only have to change the to
Found it.. great.. I will try this tomorrow and let you know how it goes. Thanks agian
Well, it didn't work. I guess I will have to recreate everything. I got the message."Unable to determine the DHCP server version for the server Server may not function properly."

When I opened DHCP there was nothing there.

Thanks for all your efforts.

This is from an MS KB, and applies to 2003, but try the import with the DHCP service started.  If you don't get any errors, do a restart on th DHCP service.  

And make sure the account you are logging in with is a direct memeber of the Administrators group, not a member of a group that is in the Administrators group.

Sorry, I already created a new scope. It is working fine with one exception. I am trying to disable ipv6 in DHCP. I have found registry edits online to disable ipv6, but am not sure what that will do to DHCP. Or, should i go ahead and set it up. I know very little about ipv6. Remember this is 2008.

I thought I accepted your solution, but it doesn't show as accepted.
Avatar of jffrybauer

Blurred text
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
I really appreciate the help, but I ended up creating a new scope and adding the reservations manually.