Linux - NetworkingThis forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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:
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.
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.
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.