combine two dhcpd.leases files together

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

combine two dhcpd.leases files together

Julie Xu

Hi,

 

If I move a subnet from dhcpd server A to dhcpd server B, and this subnet is a dynamic subnet. What will happen to the IPs?

 

I guess it will have some duplicated ip occurred, right? Because of dhcpd.leases file is different?

 

If any possible to to combine two dhcpd.leases file together? More if possible to only add one subnet’ entries of dhcpd.leases to another server?

 

Any comments will be appreciated

 

Thanks in advance

 

Julie

 


_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: combine two dhcpd.leases files together

Gregory Sloop
Re: combine two dhcpd.leases files together



Hi,

If I move a subnet from dhcpd server A to dhcpd server B, and this subnet is a dynamic subnet. What will happen to the IPs?

I guess it will have some duplicated ip occurred, right? Because of dhcpd.leases file is different?

If any possible to to combine two dhcpd.leases file together? More if possible to only add one subnet’ entries of dhcpd.leases to another server?

Any comments will be appreciated

Thanks in advance

Julie


Does the subnet you are moving from A to B already exist on B?
If it doesn't, then I *think* you could add/move the info in the leases file from A to B, add the subnet def and simply hup/restart dhcpd on B. [And obviously stop A before you grab A's leases file. Make SURE it doesn't come back after you move to B.]

---
If it DOES exist, then you will have to do some maneuvering to keep the problems as minimal as possible. I'd start with [provided your DHCP server can handle the additional load] shortening the lease times for the subnet you're moving/merging.  Shorten it as short as you can, while still being able to do steps 1-4 below in less than half the lease time selected.

You, could block out the ranges of IP's [allowed only certain IP's in the range] that are exclusive to A and B. Then, when you merge, there will be no "shared" addresses - in that Server A won't have assigned any clients to the IP's used by Server B and vice-versa.

Then, when you move;
1) Stop dhcpd for A and B.
2) merge the leases file of A into B
3) modify the scope of the subnet on B to allow assignment in the combined range of A & B,
4) Start dhcpd on B
5) then make sure B is available to all clients, and that A is NOT available to ANY.

[As noted above; Make sure you can do these steps in substantially less time than half the lease time. That should generally ensure that no clients' dhcp lease will expire while you are merging the two servers.]

Then Server B should know what assignments to renew for each client, double-assignment shouldn't happen, and any problems can go away quickly, since the lease is short.

I *think* this works, but someone better than I should check my work. :)
I should note, that I've never tried to do this myself - merging two different leases files - but I'm not aware of any reason it's not possible.

-Greg

_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: combine two dhcpd.leases files together

Gregory Sloop
Re: combine two dhcpd.leases files together








Hi,

If I move a subnet from dhcpd server A to dhcpd server B, and this subnet is a dynamic subnet. What will happen to the IPs?

I guess it will have some duplicated ip occurred, right? Because of dhcpd.leases file is different?

If any possible to to combine two dhcpd.leases file together? More if possible to only add one subnet’ entries of dhcpd.leases to another server?

Any comments will be appreciated

Thanks in advance

Julie



Does the subnet you are moving from A to B already exist on B?
If it doesn't, then I *think* you could add/move the info in the leases file from A to B, add the subnet def and simply hup/restart dhcpd on B. [And obviously stop A before you grab A's leases file. Make SURE it doesn't come back after you move to B.]

---
If it DOES exist, then you will have to do some maneuvering to keep the problems as minimal as possible. I'd start with [provided your DHCP server can handle the additional load] shortening the lease times for the subnet you're moving/merging.  Shorten it as short as you can, while still being able to do steps 1-4 below in less than half the lease time selected.

You, could block out the ranges of IP's [allowed only certain IP's in the range] that are exclusive to A and B. Then, when you merge, there will be no "shared" addresses - in that Server A won't have assigned any clients to the IP's used by Server B and vice-versa.

Then, when you move;
1) Stop dhcpd for A and B.
2) merge the leases file of A into B
3) modify the scope of the subnet on B to allow assignment in the combined range of A & B,
4) Start dhcpd on B
5) then make sure B is available to all clients, and that A is NOT available to ANY.

[As noted above; Make sure you can do these steps in substantially less time than half the lease time. That should generally ensure that no clients' dhcp lease will expire while you are merging the two servers.]

Then Server B should know what assignments to renew for each client, double-assignment shouldn't happen, and any problems can go away quickly, since the lease is short.

I *think* this works, but someone better than I should check my work. :)
I should note, that I've never tried to do this myself - merging two different leases files - but I'm not aware of any reason it's not possible.

-Greg


An addendum:
I did a search, and a post from Simon H [From nearly 15 years ago! Dang man, you're the wise old wizard!] seems to indicate this does work - with one priviso - the leases files must be the same format. This is going to be the case as long as A & B are running the same version of DHCPd. If not, you need to make sure they use the same format.

See:
https://marc.info/?l=dhcp-server&m=102259890617062&w=2


I did
_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

RE: combine two dhcpd.leases files together

Julie Xu
Re: combine two dhcpd.leases files together

 

Thanks Greg.

 

From: Gregory Sloop [mailto:[hidden email]]
Sent: Tuesday, 19 December 2017 12:51 PM
To: Users of ISC DHCP <[hidden email]>; Julie Xu <[hidden email]>
Subject: Re: combine two dhcpd.leases files together

 






Hi,

If I move a subnet from dhcpd server A to dhcpd server B, and this subnet is a dynamic subnet. What will happen to the IPs?

I guess it will have some duplicated ip occurred, right? Because of dhcpd.leases file is different?

If any possible to to combine two dhcpd.leases file together? More if possible to only add one subnet’ entries of dhcpd.leases to another server?

Any comments will be appreciated

Thanks in advance

Julie




Does the subnet you are moving from A to B already exist on B?
If it doesn't, then I *think* you could add/move the info in the leases file from A to B, add the subnet def and simply hup/restart dhcpd on B. [And obviously stop A before you grab A's leases file. Make SURE it doesn't come back after you move to B.]

---
If it DOES exist, then you will have to do some maneuvering to keep the problems as minimal as possible. I'd start with [provided your DHCP server can handle the additional load] shortening the lease times for the subnet you're moving/merging.  Shorten it as short as you can, while still being able to do steps 1-4 below in less than half the lease time selected.

You, could block out the ranges of IP's [allowed only certain IP's in the range] that are exclusive to A and B. Then, when you merge, there will be no "shared" addresses - in that Server A won't have assigned any clients to the IP's used by Server B and vice-versa.

Then, when you move;
1) Stop dhcpd for A and B.
2) merge the leases file of A into B
3) modify the scope of the subnet on B to allow assignment in the combined range of A & B,
4) Start dhcpd on B
5) then make sure B is available to all clients, and that A is NOT available to ANY.

[As noted above; Make sure you can do these steps in substantially less time than half the lease time. That should generally ensure that no clients' dhcp lease will expire while you are merging the two servers.]

Then Server B should know what assignments to renew for each client, double-assignment shouldn't happen, and any problems can go away quickly, since the lease is short.

I *think* this works, but someone better than I should check my work. :)
I should note, that I've never tried to do this myself - merging two different leases files - but I'm not aware of any reason it's not possible.

-Greg



An addendum:
I did a search, and a post from Simon H [From nearly 15 years ago! Dang man, you're the wise old wizard!] seems to indicate this does work - with one priviso - the leases files must be the same format. This is going to be the case as long as A & B are running the same version of DHCPd. If not, you need to make sure they use the same format.

See:
https://marc.info/?l=dhcp-server&m=102259890617062&w=2


I did


_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users
Reply | Threaded
Open this post in threaded view
|

Re: combine two dhcpd.leases files together

Gregory Sloop
Re: combine two dhcpd.leases files together




Thanks Greg.

From: Gregory Sloop [mailto:[hidden email]]
Sent: Tuesday, 19 December 2017 12:51 PM
To: Users of ISC DHCP <[hidden email]>; Julie Xu <[hidden email]>
Subject: Re: combine two dhcpd.leases files together









Hi,

If I move a subnet from dhcpd server A to dhcpd server B, and this subnet is a dynamic subnet. What will happen to the IPs?

I guess it will have some duplicated ip occurred, right? Because of dhcpd.leases file is different?

If any possible to to combine two dhcpd.leases file together? More if possible to only add one subnet’ entries of dhcpd.leases to another server?

Any comments will be appreciated

Thanks in advance

Julie




Does the subnet you are moving from A to B already exist on B?
If it doesn't, then I *think* you could add/move the info in the leases file from A to B, add the subnet def and simply hup/restart dhcpd on B. [And obviously stop A before you grab A's leases file. Make SURE it doesn't come back after you move to B.]

---
If it DOES exist, then you will have to do some maneuvering to keep the problems as minimal as possible. I'd start with [provided your DHCP server can handle the additional load] shortening the lease times for the subnet you're moving/merging.  Shorten it as short as you can, while still being able to do steps 1-4 below in less than half the lease time selected.

You, could block out the ranges of IP's [allowed only certain IP's in the range] that are exclusive to A and B. Then, when you merge, there will be no "shared" addresses - in that Server A won't have assigned any clients to the IP's used by Server B and vice-versa.

Then, when you move;
1) Stop dhcpd for A and B.
2) merge the leases file of A into B
3) modify the scope of the subnet on B to allow assignment in the combined range of A & B,
4) Start dhcpd on B
5) then make sure B is available to all clients, and that A is NOT available to ANY.

[As noted above; Make sure you can do these steps in substantially less time than half the lease time. That should generally ensure that no clients' dhcp lease will expire while you are merging the two servers.]

Then Server B should know what assignments to renew for each client, double-assignment shouldn't happen, and any problems can go away quickly, since the lease is short.

I *think* this works, but someone better than I should check my work. :)
I should note, that I've never tried to do this myself - merging two different leases files - but I'm not aware of any reason it's not possible.

-Greg



An addendum:
I did a search, and a post from Simon H [From nearly 15 years ago! Dang man, you're the wise old wizard!] seems to indicate this does work - with one priviso - the leases files must be the same format. This is going to be the case as long as A & B are running the same version of DHCPd. If not, you need to make sure they use the same format.

See:
https://marc.info/?l=dhcp-server&m=102259890617062&w=2


I did


BTW, In that thread, Simon also has another great way of doing it. You might read the thread as it gives you yet another way to do it. You might find it more appropriate than the way I've described above...

-Greg


_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users