Multiple DHCP servers on same host???!!!

Jason Gerfen jason.gerfen at scl.utah.edu
Tue Aug 12 13:21:10 UTC 2008


Glenn Satchell wrote:
>> Subject: Multiple DHCP servers on same host???!!!
>> Date: Tue, 12 Aug 2008 18:12:14 +0530
>> To: <dhcp-users at isc.org>
>>
>> Hi,
>> Is it possible to run multiple DHCP servers on same host? 
>> Iam trying to have a single machine ( with 3 network cards) and I want
>> to run 3 ISC DHCPV4 servers. These DHCP servers would be having
>> different conf files and lease files. 
>>
>> I started the servers with the following commands
>>
>> ./dhcpd -cf dhcpd.conf -lf dhcpd.leases eth0
>> ./dhcpd -cf dhcpd1.conf -lf dhcpd1.leases eth1
>> ./dhcpd -cf dhcpd2.conf -lf dhcpd2.leases eth2
>>
>> When I tried this with DHCP server 3.07, I got an error saying " An
>> instance is already running " for the second command. First server was
>> running successfully.
>>
>> Thanks in advance for your response.
>>
>> Regards,
>> Vidhya
> 
> The pid files are clashing, so you also need -pf pid-file on the
> command line too. Try  man dhcpd
> 
> BTW you can specify lease-file and pid-file in the dhcpd.conf which
> means it's less likely to get confused. The exact syntax is in the
> dhcpd.conf man page.
> 
> But the question you should really ask is why do you want three
> instances of dhcpd?
> 
> You can have three subnet declarations in dhcpd.conf, different lease
> times, routers, and any other parameters per subnet. In fact there are
> people om this list (not me) who have thousands of subnets.
> 
> regards,
> -glenn
> 
> 

Yeah enable some aliased interfaces (one per subnet)
http://www.linuxhomenetworking.com/wiki/index.php/Quick_HOWTO_:_Ch03_:_Linux_Networking

Then configure dhcpd like this:

### GLOBAL DHCP CONFIGURATION ###

option domain-name="domain";
default-lease-time 900;
max-lease-time 1800;
ddns-update-style none;
authoritative;
allow bootp;

### SUBNETS CONFIGURATION ###

subnet 155.97.241.0
netmask 255.255.255.0 {
         option domain-name-servers 155.97.15.2, 155.97.18.2;
         option routers 155.97.241.1;
         range 155.97.241.3 155.97.243.255;
}

subnet 155.97.14.0
netmask 255.255.255.0 {
         option domain-name-servers 155.101.115.10, 155.101.201.10;
         option routers 155.97.14.1;
         range 155.97.14.3 155.97.14.255;
}

subnet 155.97.15.0
netmask 255.255.255.0 {
         option domain-name-servers 155.97.15.2, 155.97.18.2;
         option routers 155.97.15.1;
         range 155.97.15.3 155.97.15.255;
}

....


-- 
Jason Gerfen
"Tomorrow isn't promised so we live for today"


More information about the dhcp-users mailing list