OPNsense Forum

Archive => 17.7 Legacy Series => Topic started by: epoch on August 06, 2017, 03:56:35 pm

Title: Infinite DHCP lease?
Post by: epoch on August 06, 2017, 03:56:35 pm
I would like to set a few hosts with an infinite DHCP lease on the LAN.
In dnsmasq I would set "infinite" next to the host entry.
Although I don't use ISC DHCPD much, I've read (https://serverfault.com/questions/505300/isc-dhcp-infinite-lease-time) that setting the requested value to '-1' should do the trick.
In the web interface, -1 is not valid.

Is it possible to specify an infinite lease?
NB: Very minor issue for me. 1d is good enough and the target hosts will probably be set to static IP anyway --although not by me ;)

Edit. To be clear: my question is about lease infinite duration.
Title: Re: Infinite DHCP lease?
Post by: opnfwb on August 06, 2017, 04:21:56 pm
I use DHCP lease reservations to accomplish the same thing on my network. Ideally you'll need to know the MAC address of the systems that you want to set a static lease for. If you don't know the MAC and the systems already have a static IP set, you can use a faked MAC and just set the IPs that you want to reserve within the address pool.

Another option that you've probably also considered is just sizing the DHCP pool to only lease address outside of the range of systems that need a static address. However, this may not work if your network has grown and now needs both within the same lease pool range.