Score:0

ISC DHCP Server - Assign the same IP without static host config

in flag

Is there a way to configure the DHCP server to assign an IP to a client without the client being statically defined.

My main goal is to create an IP pool that will keep the IPs reserved for 30 days as an example. If there are no requests from the client within these 30 days, the IP will be released again. Otherwise, the one and the same IP should always be assigned beyond these 30 days.

Score:0
ru flag

To create a fixed IP, you will need the MAC address of the device to put into the DHCP config file.

sudo nano /etc/dhcp/dhcpd.conf

There are examples in the file. Basically add the following:

host your_machine_name {
  hardware ethernet the:MAC:Address;
  fixed-address the.fixed.IP;
}

and finally

sudo systemctl restart isc-dhcp-server.service


This will not release the IP after 30 days, though. For that, I would do as the other answer suggested and set the default-lease-time and max-lease-time to 30 days.

Edit the same config file but add these lines:

default-lease-time 14400;
max-lease-time 28800;

The time is specified in seconds. Remember to restart the DHCP service after making any changes.

Score:0
cn flag

You can try to increase the value of default-lease-time and max-lease-time

cn flag
For your information, there is a minimum reputation to have before you were able to push a comment :) . So you have the answer
NotTheDr01ds avatar
vn flag
Third reviewer (at least) here. I disagree with the others that reviewed this answer. I believe it's perfectly valid as an *answer* rather than a comment. Some people get thrown off by the "You can try", as meaning you don't *know* that this will resolve the problem. However, it's an *attempt* to resolve, and that counts as an answer. If people are sure it's not the right answer, they can downvote. If, for someone else, it's the right answer, they can upvote. But it is, IMHO, an answer. That said, additional detail on why you believe this might be the solution is definitely better.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.