5

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...

Steven Monday
  • 13,019
  • 4
  • 35
  • 45
Richard
  • 51
  • 1
  • 3
  • 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](http://serverfault.com/questions/177074/can-i-set-dhcp-reservations-in-a-windows-dhcp-server-from-a-linux-node/177078). – jscott Jun 10 '11 at 01: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 05: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
  • In our environment we have two AD DHCP servers that are an active/passive MS Cluster. The DHCP databases lives on a secondary drive which is listed as a resource in the MS cluster. In so doing, if one server fails, the database migrates to the other node right before AD brings up DHCP services and transfers the cluster name and IP. However - if you were to do something of this nature - ensure that the shared drive lives on redundant storage as well. – Eli Aug 31 '12 at 01:51
  • 1
    http://serverfault.com/questions/27175/split-your-dhcp-scope-among-multiple-servers This is what you want to do with your Windows DHCP servers – Joel E Salas Sep 07 '12 at 15:40

2 Answers2

2

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 192.168.1.0 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.

Nick

Migrating existing DHCP Server deployment to Windows Server 2012 DHCP Failover

fboaventura
  • 1,125
  • 11
  • 16
Nick Pappin
  • 107
  • 5
  • 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
-5

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

Stuart
  • 101
  • 2
  • This doesn't answer the question as asked. – Joel E Salas Sep 07 '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 09:25