LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 01-11-2010, 05:13 PM   #1
jjinno
LQ Newbie
 
Registered: Sep 2009
Posts: 23

Rep: Reputation: 16
What is so bad about running multiple identical DHCP servers?


If you have a cluster of statically-addressed DHCP-server nodes, and a cluster of dynamically-addressed PXE-boot nodes that from those DHCP nodes, and a cluster of statically-addressed PXE-boot nodes that boot from those DHCP nodes...

Given the precondition that the DHCP-server nodes should (at all times) contain the exact same PXE image and the exact same DHCP configuration (including static leases & dynamic ranges), is there any reason to not have all the DHCP servers running at once?

The way I figure, the worst case scenario is this (all DHCP servers running with identical configurations):
- DynamicClient#1 gets IP/lease randomly from Server#1
- Server#1 goes down
- DynamicClient#1 needs to renew/replace its lease, but cant find Server#1
- DynamicClient#1 gets new IP (maybe) and lease randomly from Server#2
- Server#1 comes back up (with old lease for DynamicClient#1)
- Some time later Server#1 scrubs the leases

For static clients, there is no issue, because even if the lease is handed out by a different server, it is always guaranteed to be the same IP.

I have seen numerous people say "this is bad" but never has one of them really given many details... and as far as theory goes, I personally haven't found the hole... in fact, it would seem that "homogeneous DHCP" would offer premium fail-over protection.

Am I missing something?

Last edited by jjinno; 01-11-2010 at 05:25 PM.
 
Old 01-11-2010, 05:48 PM   #2
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
As each DHCP server would not know what addresses the others had handed out there is nothing stopping them from handing out the same address if requested resulting in an ip conflict.

The way around this SPOF is to use contiguous address ranges with enough capacity to absorb the leases of a failed DHCP server node

eg.
dhcpserver01 - [192.168.0.1-192.168.0.80]
dhcpserver02 - [192.168.0.81-192.168.0.160]
dhcpserver03 - [192.168.0.161-192.168.0.240]

In this configuration, the loss of a single dhcp server would result in - maximum number of addresses = (n-1)*80 = 160

If you have more than this many dhcp clients then you can increase the number of servers to 4 ( inefficient) -
maximum number of addresses = (n-1)*60 = 180

or change the subnet to a supernet and increase the ranges for a maximum > 254

The second option is to use active/passive clustering where the loss of a single node (dhcp server) has no impact on the number of available addresses.

cheers

Last edited by kbp; 01-11-2010 at 05:49 PM.
 
Old 01-12-2010, 03:58 PM   #3
jjinno
LQ Newbie
 
Registered: Sep 2009
Posts: 23

Original Poster
Rep: Reputation: 16
Ahh, interesting... so are you saying DHCP has a non-resolved race condition?
I mean, why is the DHCP-client not required to ARP-test the set address? (ala Link-Local Addressing - aka APIPA)

This would mean, set the address on both clients... ARP for duplicate address... re-pick both on "duplicates found"
It just seems strange that a protocol like DHCP would allow for a (albeit impossibly rare) use-case that delivers all dynamic clients the exact same address... ok, ok, ok, granted DHCP preceded clustering by just a bit...

Is there a DHCP-client out there that employs this ARP test?


Anyway, I think I have been personally avoiding this given some "likelihoods", and "really short leases"...
- If there is a conflict, then on re-lease, the conflict will be discovered due to the client asking for address X and the duplicate server responding that X is already taken by a different MAC.
- If the client has a valid lease, then it will continually renew that lease, instead of re-IPing. (Static clients are guaranteed of this even if the lease-expire case - dynamic clients should be robust enough to handle IP switching anyway)


Given that DHCP-lease traffic is relatively benign, what (besides lots of log messages) do I have to loose with my personal approach?
 
Old 01-12-2010, 04:49 PM   #4
kbp
Senior Member
 
Registered: Aug 2009
Posts: 3,790

Rep: Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653Reputation: 653
It's not a race condition as such, the dhcp process is just very simple - a client sends a dhcp discover packet, and any dhcp servers that receive it respond with an offer. The client will accept the first one it receives by responding back to that server.

This is why rogue dhcp servers on the network can cause so much trouble, handing out wrong subnet masks, default gateways, conflicting addresses etc

You'd have to check the rfc's to see what changes are in the pipeline -
http://www.ietf.org/dyn/wg/charter/dhc-charter.html

cheers
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
DHCP with several servers trovatou Linux - Server 3 05-10-2007 03:58 AM
DHCP on, Servers Off ? energiza Linux - Networking 4 08-08-2006 03:48 PM
Rebooting Linux servers bad idea? dippelw Linux - General 4 11-30-2005 03:50 PM
Two DHCP Servers mesh2005 Linux - Networking 3 10-16-2005 05:26 AM
DHCP problems - multiple DHCP servers sat86 Linux - Networking 4 10-02-2005 05:43 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:49 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration