I need to migrate/convert a dhcp server from linux to active directory. It's currently running fine on a sles9 box.

There are 136 subnets defined and about 1200 fixed-address reservations. It would be nice if the existing dhcpd.conf could be scripted...

  • 3
    Yes, it can be scripted. The flavor of scripting on the Linux side is pretty flexible. Windows provides netsh for scripting the import. See this question. – jscott Jun 10 '11 at 1:38
  • 1
    That's a mighty-large dhcp environment. Do you have any plan to provide resiliency/failover? – ewwhite Jun 10 '11 at 12:05
  • that's a good question. most places i've seen have 2 linux boxes running and if one goes down the other picks up all the queries. in my initial reading on the windows way of doing this, it doesn't appear that simple. Fault-tolerance on Vmware is an option... – Richard Jun 11 '11 at 5:17
  • you can create redondancy with AD simply... it's in the forest specification (backup role If I recall good). Look at technet for more information, but it's possible, did that for a client with 4 AD redondancy – Anarko_Bizounours Aug 22 '12 at 12:53
  • 1
    serverfault.com/questions/27175/… This is what you want to do with your Windows DHCP servers – Joel E Salas Sep 7 '12 at 15:40

What version of Windows server are you running? Server 2012 has the ability to run in a failover cluster relationship. I have attached a blog post about it below. Unfortunately it is talking about migrating from an existing Windows DHCP environment. But it may have some useful info for you.

As for the importing the dhcpd.conf if you grep out your different subnets using something like cat /etc/dhcpd.conf | grep subnet you can create a list of your subnets and then script putting them in using something like:

netsh dhcp server add scope <ScopeAddress> <SubnetMask> <ScopeName> [ScopeComment]

Then for your reservations you could do something like cat /etc/dhcpd.conf | grep host this will get you a list of hosts then you will need to figure out some way to break them out by subnet and use the command:

netsh dhcp server scope add reservedip <ReservedIP> <MAC_Address> [ClientName] [ClientComment] [ClientType(DHCP | BOOTP | BOTH)]" 

to add the reservations to the database. If you want more information about netsh look here.


Migrating existing DHCP Server deployment to Windows Server 2012 DHCP Failover

  • One year later, you're unlikely to get a response to questions about the state of the system one year ago. – itsbruce Oct 24 '12 at 22:13
  • yeah, just saw this now - 4 months later. no real idea how it's running at the client but since they haven't called and complained... ;-) thanks for the update on 2012. – Richard Feb 17 '13 at 22:17

Install samba4 as the domain controller and it can then act as the Active directory server.

See http://wiki.samba.org/index.php/Samba4

leave the dhcp server where it is, or run this on the same server as samba4

  • This doesn't answer the question as asked. – Joel E Salas Sep 7 '12 at 15:41
  • I was trying to offers alternatives to the questioner that they may not have considered. That is not migrating to Windows Active Directory because the same functionally is available with Samba. – Stuart Sep 25 '13 at 9:25

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.