Koozali.org: home of the SME Server

DHCP Release

Offline john56

  • ***
  • 143
  • +0/-0
DHCP Release
« on: November 12, 2020, 09:22:36 AM »
Bonjour, voici ma config DHCP.
J'ai des adresses ip attribuées qui restent en "cache" malgré une durée du bail à 24h.
Une idée ?
Merci.
https://pasteboard.co/JzZoCaP.png
https://pasteboard.co/JzZq1pQ.png
« Last Edit: November 12, 2020, 09:26:47 AM by john56 »

Offline ReetP

  • *
  • 3,722
  • +5/-0
Re: DHCP Release
« Reply #1 on: November 18, 2020, 04:40:42 PM »
Bonjour, voici ma config DHCP.
J'ai des adresses ip attribuées qui restent en "cache" malgré une durée du bail à 24h.
Une idée ?
Merci.
https://pasteboard.co/JzZoCaP.png
https://pasteboard.co/JzZq1pQ.png

Please explain why it is a problem?

https://wiki.contribs.org/Dhcpd_lease_time

The configuration file is here:
Code: [Select]
cat /etc/dhcpd.conf
You can adjust the default-lease-time via a config entry but NOT the max-lease-time.

Code: [Select]
config show dhcpd
This is the template where the maximum time is set:

Code: [Select]
cat /etc/e-smith/templates/etc/dhcpd.conf/25LeaseTimeMax
Code: [Select]
    max-lease-time              { 7*86400 };
You could create a custom-template, or create your own DHCP key and add it to the template.

With the dhcpd contrib it has some custom templates so that when you set the default-lease-time it will calculate a new max-lease-time.

See:

Code: [Select]
cat /etc/e-smith/templates-custom/etc/dhcpd.conf/25LeaseTimeDefault
Code: [Select]
{
 my $dhcpleasetime = $DB->get_prop('dhcpd', 'leasetime') || 86400;
 $OUT .= "    default-lease-time          $dhcpleasetime;";
}

Code: [Select]
cat /etc/e-smith/templates-custom/etc/dhcpd.conf/25LeaseTimeMax
Code: [Select]
{
    my $leasetime = $DB->get_prop('dhcpd', 'leasetime') || 86400;
    my $maxleasetime = 7 * $leasetime;
    $OUT .= "    max-lease-time          $maxleasetime;";
}

So with these template when you change the default lease time it will generate a new Max time.

However, unless you have a real need to modify this then it is probably better left alone.

If you are short of IPs it will probably be easier to just increase your local subnet range.

...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation

Offline john56

  • ***
  • 143
  • +0/-0
Re: DHCP Release
« Reply #2 on: November 26, 2020, 12:16:15 AM »
Thanks reetP
Quote
If you are short of IPs it will probably be easier to just increase your local subnet range.
It's done, more easy ;)

Offline ReetP

  • *
  • 3,722
  • +5/-0
Re: DHCP Release
« Reply #3 on: November 26, 2020, 02:38:25 AM »
...
1. Read the Manual
2. Read the Wiki
3. Don't ask for support on Unsupported versions of software
4. I have a job, wife, and kids and do this in my spare time. If you want something fixed, please help.

Bugs are easier than you think: http://wiki.contribs.org/Bugzilla_Help

If you love SME and don't want to lose it, join in: http://wiki.contribs.org/Koozali_Foundation