LinuxQuestions.org
Review your favorite Linux distribution.
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 04-13-2010, 08:21 AM   #1
slacky
Member
 
Registered: Feb 2004
Location: USA
Distribution: Debian
Posts: 174

Rep: Reputation: 16
Caveats in moving dhcpd to a different server


Hello,

Are there any caveats in moving dhcpd from one server to another? I am thinking dhcpd.leases or dhcpd.leases~ would need to be copied from the old to the new server (in addition to dhcpd.conf). Would dhcpd 3.0.1 care if the dhcpd.leases was from dhcpd 3.1.1?

Thanks,
slacky
 
Old 04-13-2010, 10:00 AM   #2
deadeyes
Member
 
Registered: Aug 2006
Posts: 609

Rep: Reputation: 79
Quote:
Originally Posted by slacky View Post
Hello,

Are there any caveats in moving dhcpd from one server to another? I am thinking dhcpd.leases or dhcpd.leases~ would need to be copied from the old to the new server (in addition to dhcpd.conf). Would dhcpd 3.0.1 care if the dhcpd.leases was from dhcpd 3.1.1?

Thanks,
slacky
If I am correct you can just copy the config to your new server and start dhcpd there. Make sure the interface you want to assign dhcp addresses is configured correct.
There is no need to copy the dhcpd.leases file as these are dynamically assigned addresses. When they expire they will get a new one. If you want static IPs, then just use something like:
Code:
host yourdhcpclient {
 hardware ethernet 00:00:00:00:00:00;
 fixed-address 10.15.14.13;
}
 
Old 04-13-2010, 11:34 AM   #3
slacky
Member
 
Registered: Feb 2004
Location: USA
Distribution: Debian
Posts: 174

Original Poster
Rep: Reputation: 16
Quote:
Originally Posted by deadeyes View Post
If I am correct you can just copy the config to your new server and start dhcpd there. Make sure the interface you want to assign dhcp addresses is configured correct.
There is no need to copy the dhcpd.leases file as these are dynamically assigned addresses. When they expire they will get a new one. If you want static IPs, then just use something like:
If I do not preserve the leases from the old server to the new server, how the new server know which addresses were assigned by the old server and are still in use until the lease expires? Example, the DHCP range is 192.168.1.100 to 192.168.1.200 and there's about 50 pingable hosts in that range. My concern is the new server will start assigning ip addresses starting from 192.168.1.100 again and will have ip collisions with clients who haven't renewed their leases yet.

Thanks,
slacky
 
Old 04-14-2010, 04:46 AM   #4
deadeyes
Member
 
Registered: Aug 2006
Posts: 609

Rep: Reputation: 79
Quote:
Originally Posted by slacky View Post
If I do not preserve the leases from the old server to the new server, how the new server know which addresses were assigned by the old server and are still in use until the lease expires? Example, the DHCP range is 192.168.1.100 to 192.168.1.200 and there's about 50 pingable hosts in that range. My concern is the new server will start assigning ip addresses starting from 192.168.1.100 again and will have ip collisions with clients who haven't renewed their leases yet.

Thanks,
slacky
It won't know the addresses assigned. But that doesn't matter as static IPs should be configured in the config.
The other would just get a new address.
IIRC dhcpd first checks if the IP is in use.

Taken from the man page (I love em ):
Quote:
IP ADDRESS CONFLICT PREVENTION
The DHCP server checks IP addresses to see if they are in use before
allocating them to clients. It does this by sending an ICMP Echo
request message to the IP address being allocated. If no ICMP Echo
reply is received within a second, the address is assumed to be free.
This is only done for leases that have been specified in range state-
ments, and only when the lease is thought by the DHCP server to be free
- i.e., the DHCP server or its failover peer has not listed the lease
as in use.

If a response is received to an ICMP Echo request, the DHCP server
assumes that there is a configuration error - the IP address is in use
by some host on the network that is not a DHCP client. It marks the
address as abandoned, and will not assign it to clients.

If a DHCP client tries to get an IP address, but none are available,
but there are abandoned IP addresses, then the DHCP server will attempt
to reclaim an abandoned IP address. It marks one IP address as free,
and then does the same ICMP Echo request check described previously.
If there is no answer to the ICMP Echo request, the address is assigned
to the client.

The DHCP server does not cycle through abandoned IP addresses if the
first IP address it tries to reclaim is free. Rather, when the next
DHCPDISCOVER comes in from the client, it will attempt a new allocation
using the same method described here, and will typically try a new IP
address.
 
Old 04-14-2010, 09:22 AM   #5
slacky
Member
 
Registered: Feb 2004
Location: USA
Distribution: Debian
Posts: 174

Original Poster
Rep: Reputation: 16
Thanks, deadeyes - I missed that, it was in the manpage of dhcpd.conf and I was looking at dhcpd and dhcpd.leases. For what its worth, I went ahead and copied dhcpd.conf and dhcpd.leases to the new server and so far it is working fine - the log shows its sending DHCPACK to the clients and letting them keep their leases.
 
  


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
How can I test the DHCPD server? huntkey Linux - Server 4 12-31-2008 02:01 PM
LAN DHCPD server cr9c1 Linux - General 0 06-29-2007 12:17 PM
Running Ubuntu as fileserver: any caveats before sharing /home dirtree over local lan isync Linux - Server 1 03-19-2007 01:31 PM
dhcpd-server problem kafnir Linux - Networking 1 05-27-2004 08:25 PM

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

All times are GMT -5. The time now is 07:20 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