I have a strange issue with some of my DHCP clients.
Their assigned lease expires almost immediately with no apparent reason.
This is an excerpt of my log a few hours ago ("sh[23391]" lines is the
output of my custom Samba-DNS-Update script).
As you can see client with MAC "38:60:77:38:57:99" was assigned IP
"10.0.0.99" at "Dec 18 08:56:43".
Then after 10mins it requires a lease update (still wondering why...)
and isc-dhcpd tries to reassign the previously assigned 10.0.0.99.
It pings that IP before assigning and, being it in use (by the same
client), the IP is not assigned and the client looses its IP.
At "Dec 18 09:07:14" that lease is marked as expired and not assigned
anymore to the same client.
I need to manually delete expired leases to let them be assignable again.
----------
Dec 18 08:56:43 srvdhcp dhcpd[23391]: Commit: IP: 10.0.0.99 DHCID:
1:38:60:77:38:57:99 Name: MYPC177
Dec 18 08:56:43 srvdhcp dhcpd[23391]: execute_statement argv[2] = 10.0.0.99
Dec 18 08:56:43 srvdhcp dhcpd[23391]: execute_statement argv[3] = MYPC177
Dec 18 08:56:43 srvdhcp sh[23391]: DHCP-DNS Update started: action: add,
IP: 10.0.0.99, name: mypc177, ptr: 99.0.0.10.in-addr.arpa, domain:
domain.local, realm: DOMAIN.LOCAL
Dec 18 08:56:43 srvdhcp sh[23391]: DHCP-DNS Update succeeded: 0000,
action: add, IP: 10.0.0.99, name: mypc177
Dec 18 08:56:43 srvdhcp dhcpd[23391]: DHCPREQUEST for 10.0.0.99 from
38:60:77:38:57:99 via eth_lan
Dec 18 08:56:43 srvdhcp dhcpd[23391]: DHCPACK on 10.0.0.99 to
38:60:77:38:57:99 (MYPC177) via eth_lan
Dec 18 08:56:43 srvdhcp dhcpd[23391]: reuse_lease: lease age 0 (secs)
under 25% threshold, reply with unaltered, existing lease for 10.0.0.99
Dec 18 08:56:43 srvdhcp dhcpd[23391]: DHCPDISCOVER from
38:60:77:38:57:99 (MYPC177) via eth_lan
Dec 18 08:56:43 srvdhcp dhcpd[23391]: DHCPOFFER on 10.0.0.99 to
38:60:77:38:57:99 (MYPC177) via eth_lan
Dec 18 08:56:43 srvdhcp dhcpd[23391]: reuse_lease: lease age 0 (secs)
under 25% threshold, reply with unaltered, existing lease for 10.0.0.99
Dec 18 08:56:43 srvdhcp dhcpd[23391]: DHCPDISCOVER from
38:60:77:38:57:99 (MYPC177) via eth_lan
Dec 18 08:56:43 srvdhcp dhcpd[23391]: DHCPOFFER on 10.0.0.99 to
38:60:77:38:57:99 (MYPC177) via eth_lan
Dec 18 08:56:43 srvdhcp dhcpd[23391]: reuse_lease: lease age 0 (secs)
under 25% threshold, reply with unaltered, existing lease for 10.0.0.99
Dec 18 08:56:43 srvdhcp dhcpd[23391]: DHCPDISCOVER from
38:60:77:38:57:99 (MYPC177) via eth_lan
Dec 18 08:56:43 srvdhcp dhcpd[23391]: DHCPOFFER on 10.0.0.99 to
38:60:77:38:57:99 (MYPC177) via eth_lan
Dec 18 09:07:14 srvdhcp dhcpd[23391]: reuse_lease: lease age 631 (secs)
under 25% threshold, reply with unaltered, existing lease for 10.0.0.99
Dec 18 09:07:14 srvdhcp dhcpd[23391]: DHCPDISCOVER from
38:60:77:38:57:99 (MYPC177) via eth_lan
Dec 18 09:07:14 srvdhcp dhcpd[23391]: ICMP Echo reply while lease
10.0.0.99 valid.
Dec 18 09:07:14 srvdhcp dhcpd[23391]: Abandoning IP address 10.0.0.99:
pinged before offer
Dec 18 09:07:14 srvdhcp dhcpd[23391]: Expired: IP: 10.0.0.99
Dec 18 09:07:14 srvdhcp dhcpd[23391]: execute_statement argv[2] = 10.0.0.99
Dec 18 09:07:14 srvdhcp sh[23391]: DHCP-DNS Update started: action:
delete, IP: 10.0.0.99, name: mypc177, ptr: 99.0.0.10.in-addr.arpa,
domain: domain.local, realm: DOMAIN.LOCAL
Dec 18 09:07:14 srvdhcp sh[23391]: DHCP-DNS Update succeeded: 0000,
action: delete, IP: 10.0.0.99, name: mypc177
----------
This is the relevant content of file /var/lib/dhcpd/dhcpd.leases.
We're on GMT+1 timezone so, AFAIK, the lease starts at 2018/12/18
08:56:43 and should be valid till the **next day** 2018/12/19 09:07:14,
but it expired at 09:07:14 of the same day (2018/12/18):
----------
lease 10.0.0.99 {
starts 2 2018/12/18 07:56:43;
ends 3 2018/12/19 08:07:14;
tstp 3 2018/12/19 08:07:14;
cltt 2 2018/12/18 07:56:43;
binding state abandoned;
next binding state free;
rewind binding state free;
set ClientIP = "10.0.0.99";
}
----------
My configuration files:
----------
~# dhcpd --version
isc-dhcpd-4.3.5
----------
~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04.1 LTS
Release: 18.04
Codename: bionic
----------
~# cat /etc/dhcp/dhcpd.conf
option domain-name "domain.local";
authoritative;
ddns-update-style none;
# option to disable NETBIOS
# see
http://www.bakarasse.de/pages/en/linux/disable-netbios-via-dhcp.php# save the vendor id in the lease db:
set vendor-id = option vendor-class-identifier;
# specifying the option space name:
option space MSFT;
option MSFT.nbt code 1 = unsigned integer 32;
subnet 10.0.0.0 netmask 255.255.0.0 {
range 10.0.0.10 10.0.0.239;
# 4 hours lease
default-lease-time 14400;
max-lease-time 14400;
ping-check true;
ping-timeout 3;
# options
option time-servers 10.0.0.1 , 10.0.0.2;
option subnet-mask 255.255.0.0;
option broadcast-address 10.0.0.255;
option time-offset 0;
option domain-name "domain.local";
option domain-name-servers 10.0.0.1 , 10.0.0.2;
option ntp-servers 10.0.0.1 , 10.0.0.2;
# routing
option routers 10.0.0.254;
# disable NETBIOS
if substring ( option vendor-class-identifier , 0 , 8 ) = "MSFT 5.0" {
vendor-option-space MSFT;
# 1 = enable,2 = disable NetBIOS over TCP/IP:
option MSFT.nbt 2;
}
}
# ======================================
# Scripts
# ======================================
on commit {
set noname = concat("dhcp-", binary-to-ascii(10, 8, "-",
leased-address));
set ClientIP = binary-to-ascii(10, 8, ".", leased-address);
set ClientDHCID = binary-to-ascii(16, 8, ":", hardware);
set ClientName = pick-first-value(option host-name,
config-option-host-name, client-name, noname);
log(concat("Commit: IP: ", ClientIP, " DHCID: ", ClientDHCID, " Name:
", ClientName));
execute("/etc/dhcp/dhcpd-dyndns.sh", "add", ClientIP, ClientName);
}
on release {
set ClientIP = binary-to-ascii(10, 8, ".", leased-address);
set ClientDHCID = binary-to-ascii(16, 8, ":", hardware);
log(concat("Release: IP: ", ClientIP, " DHCID: ", ClientDHCID));
execute("/etc/dhcp/dhcpd-dyndns.sh", "delete", ClientIP);
}
on expiry {
set ClientIP = binary-to-ascii(10, 8, ".", leased-address);
# cannot get a ClientMac here, apparently this only works when
actually receiving a packet
log(concat("Expired: IP: ", ClientIP));
# cannot get a ClientName here, for some reason that always fails
execute("/etc/dhcp/dhcpd-dyndns.sh", "delete", ClientIP);
}
# ====================================
# Reservations
# ====================================
# ...some more reservations here, all outside the configured range...
host reserved-hostname {
hardware ethernet aa:bb:cc:dd:ee:ff;
fixed-address 10.0.0.9;
}
----------
Is anyone able to tell me what's wrong on my side?
Thanks in advance for any suggestion.
Claudio
_______________________________________________
dhcp-users mailing list
[hidden email]
https://lists.isc.org/mailman/listinfo/dhcp-users