Koozali.org: home of the SME Server

Other Languages => Français => Topic started by: john56 on November 12, 2020, 09:22:36 AM

Title: DHCP Release
Post by: john56 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/JzZoCaP.png)
https://pasteboard.co/JzZq1pQ.png (https://pasteboard.co/JzZq1pQ.png)
Title: Re: DHCP Release
Post by: ReetP 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/JzZoCaP.png)
https://pasteboard.co/JzZq1pQ.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.

Title: Re: DHCP Release
Post by: john56 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 ;)
Title: Re: DHCP Release
Post by: ReetP on November 26, 2020, 02:38:25 AM
Thanks reetP It's done, more easy ;)

:hammer:

:pint:

:lol: