LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 05-21-2007, 06:54 AM   #1
trovatou
LQ Newbie
 
Registered: May 2007
Posts: 4

Rep: Reputation: 0
DHCP client and server configuration


Hello,

How are you?? I am fine thanks.

My question is that I have 16 linux computers that are connected to a linux server and they use DHCP to obtain their IPs. The problem is that now I want to use another server for this "cluster", and I want that the clients can also ask for their IPs to this new server, so I want to configure this DHCP service with several servers, to load balance.

The problem is that I am not really sure how can I configure the 16 clients of DHCP to select one of the both servers, so how can I configure them??

Can someone help me???

Thank you very much....
 
Old 05-21-2007, 07:11 AM   #2
Centinul
Member
 
Registered: Jun 2005
Distribution: Gentoo
Posts: 552

Rep: Reputation: 30
Check out this link: DHCP Failover/Load Balancing

HTH,

Centinul
 
Old 05-21-2007, 08:32 AM   #3
waelaltaqi
Member
 
Registered: Sep 2005
Location: USA, TN
Distribution: CentOS & Ubuntu for Desktop
Posts: 454

Rep: Reputation: 31
Here is a simple explanation of how DHCP works:
a client on the network will send DHCP Request broadcast packet and waits for a DHCP server to reply. If there is a DHCP server on the network, the server will reply back and says: Hey ..i'm here. then the client asks for IP configuration then the DHCP server send IP information back ... then the client writes the information to the adapter.

can you guess what happens if you had two DHCP servers on the same network subnet?.... the server that replies first gives out the infomration first ......which is a total mess. For that reason, you can't have two DHCP servers on the same network subnet. There is no option for a DHCP client to choose a DHCP server.
In your case, all you need to do is to configure your new DHCP server's scope with the right options then disconnect the old DHCP server.

Last edited by waelaltaqi; 05-21-2007 at 08:35 AM.
 
Old 05-21-2007, 09:58 AM   #4
farslayer
Guru
 
Registered: Oct 2005
Location: Willoughby, Ohio
Distribution: linuxdebian
Posts: 7,232
Blog Entries: 5

Rep: Reputation: 189Reputation: 189
Absolutely you CAN have two DHCP servers on the same subnet handing out addresses in the same subnet.

The key is not allocating the entire IP scope you are handing out to a single server.

DHCP Server A: 192.168.1.50-149

DHCP Server B: 912.168.1.150-249

Make all the other options the two servers hand out identical.
Works like a charm, I have setup several networks in this manner and have never had a problem.
 
Old 05-21-2007, 11:12 AM   #5
trovatou
LQ Newbie
 
Registered: May 2007
Posts: 4

Original Poster
Rep: Reputation: 0
More concrete

Thank you for all your answers,

But according with farslayer's answer the two DHCP Servers cannot deliver the same IP's to the clients.
And one question more, the clients need some special configuration??

Quote:
Originally Posted by farslayer
Absolutely you CAN have two DHCP servers on the same subnet handing out addresses in the same subnet.

The key is not allocating the entire IP scope you are handing out to a single server.

DHCP Server A: 192.168.1.50-149

DHCP Server B: 912.168.1.150-249

Make all the other options the two servers hand out identical.
Works like a charm, I have setup several networks in this manner and have never had a problem.
 
Old 05-21-2007, 11:36 AM   #6
waelaltaqi
Member
 
Registered: Sep 2005
Location: USA, TN
Distribution: CentOS & Ubuntu for Desktop
Posts: 454

Rep: Reputation: 31
farslayer is right. you can put two DHCP server's on the same network with different scope as a failover solution.for example, one server will hand out addresses from 192.168.0.1 to 190.168.0.150 and the other DHCP server will hand out from 192.168.0.151 to 192.168.0.254. In that example, two clients will never have the chance to get the same IP address because the server's scopes are different.
You still can't pick or choose what DHCP server you want. Who ever answers first gives out address. After the the client leases from the server, it will get stuck with until the lease expires.
We don't mean to confuse you here. but i still think that you will be better off shutting down the old server and turning on the new one.
The other thing is that you can leave both server's on with different scope options so if one DHCP server went down the network will still function.

thanks farslayer for the correction.

Last edited by waelaltaqi; 05-21-2007 at 11:37 AM.
 
Old 05-21-2007, 03:31 PM   #7
farslayer
Guru
 
Registered: Oct 2005
Location: Willoughby, Ohio
Distribution: linuxdebian
Posts: 7,232
Blog Entries: 5

Rep: Reputation: 189Reputation: 189
I'm actually interested in looking closer at the solution posted by Centinul as that looks to be a true failover/load balancing DHCP configuration, unlike my ugly workaround hack.

Definitely different than what I've been doing, but currently my DHCP servers are stuck in the Windows AD world, and as far as I know, windows DHCP does NOT support any sort of failover/load balancing which is why I split the pool.
 
Old 05-24-2007, 05:42 AM   #8
p_s_shah
Member
 
Registered: Mar 2005
Location: India
Distribution: RHEL 3/4, Solaris 8/9/10, Fedora 4/8, Redhat Linux 9
Posts: 228
Blog Entries: 1

Rep: Reputation: 34
Hello all,
This may help you...
Some Notes :

When a server starts that has not previously communicated with its failover peer, it must establish communications with its failover peer and synchronize with it before it can serve clients. This can happen either because you have just configured your DHCP servers to perform failover for the first time or because one of your failover servers has failed catastrophically and lost its database.

The initial recovery process is designed to ensure that when one failover peer loses its database and then resynchronizes, any leases that the failed server gave out before it failed will be honored. When the failed server starts up, it notices that it has no saved failover state, and attempts to contact its peer.

When it has established contact, it asks the peer for a complete copy its peer’s lease database. The peer then sends its complete database, and sends a message indicating that it is done. The failed server then waits until MCLT (the length of time for which a lease may be renewed by either failover peer without contacting the other) has passed, and once MCLT has passed both servers make the transition back into normal operation. This waiting period ensures that any leases the failed server may have given out while out of contact with its partner will have expired.

While the failed server is recovering, its partner remains in the partner-down state, which means that it is serving all clients. The failed server provides no service at all to DHCP clients until it has made the transition into normal operation.

In the case where both servers detect that they have never before communicated with their partner, they both come up in this recovery state and follow the procedure. In this case, no service will be provided to DHCP clients until MCLT has expired.


Following is the sample config that worked for me :

Sample /etc/dhcpd.conf on LinuxServer1

failover peer "ltsp" {
primary;
address 192.168.1.1;
port 519;
peer address 192.168.1.2;
peer port 520;
mclt 3600;
max-response-delay 30;
max-unacked-updates 10;
load balance max seconds 3;
split 128;
hba ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:ff:
00:00:00:00:00:00:00:00:00:00:00:00:00:00:00:00;
}

pool {
failover peer "robotics";
max-lease-time 7200;
deny dynamic bootp clients;
range 192.168.1.25 192.168.1.200;
}


Sample /etc/dhcpd.conf on LinuxServer2

failover peer "ltsp" {
secondary;
address 192.168.1.2;
port 520;
peer address 192.168.1.1;
peer port 519;
max-response-delay 30;
max-unacked-updates 10;
load balance max seconds 3;
}

pool {
failover peer "ltsp";
max-lease-time 7200;
deny dynamic bootp clients;
range 192.168.1.25 192.168.1.200
}


Last edited by p_s_shah; 05-24-2007 at 05:44 AM.
 
  


Reply

Tags
client, configuration, dhcp, server


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 server and DHCP client in same box Eicos Linux - Networking 3 03-03-2007 02:28 PM
DHCP client configuration TaNeK Linux - Newbie 1 12-12-2004 07:23 AM
DHCP Client Configuration jpr9898 Linux - Networking 2 12-05-2004 01:54 AM
DHCP client configuration - debian pe2338 Linux - Networking 8 08-15-2003 01:11 PM
XP Pro Build 2600/sp1 v.1105 DHCP Client to Redhat 8.0 DHCP Server - Problems atomant Linux - Networking 5 06-28-2003 12:24 PM


All times are GMT -5. The time now is 04:07 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration