isc-dhclient keeps trying to renew lease in cache when interface now configured static
Using isc-dhclient-4.4.1 on armbian. The interface was previously configured for IPv4 DHCP in /etc/network/interfaces. This configuration was changed to static IPv4 with static and dynamic IPv6 and rebooted. The new IPv4 static address was seen to be configured correctly.
The network dhcp server then reported continual attempts to renew the previous IPv4 dhcp address. Stopping dhclient, deleting the dhclient lease files, and rebooting stopped the problem.
To Reproduce
- Configure client /etc/network/interfaces with
cat /etc/network/interfaces
source /etc/network/interfaces.d/*
auto lo
iface lo inet loopback
auto eth0
iface eth0 inet static
address 10.31.40.11/24
gateway 10.31.40.1
dns-nameservers 10.31.40.5 1.1.1.1
auto enxc0742bffdceb
iface enxc0742bffdceb inet dhcp
-
Reboot system and note dhcp address provided by server.
-
Change configuration to
cat /etc/network/interfaces
source /etc/network/interfaces.d/*
auto lo
iface lo inet loopback
auto enxc0742bffdceb
iface enxc0742bffdceb inet static
address 10.31.40.10/24
dns-nameservers 10.31.40.5 1.1.1.1
gateway 10.31.40.1
iface enxc0742bffdceb inet6 static
address 22001:0DB8::10/64
dns-nameservers 2606:4700:4700::1111
accept_ra 2
privext 2
autoconf 1
auto eth0
iface eth0 inet static
address 10.31.40.11/24
gateway 10.31.40.1
dns-nameservers 10.31.40.5 1.1.1.1
iface eth0 inet6 static
address 2001:0DB8::11/64
accept_ra 2
privext 2
autoconf 1
-
Reboot System. Use
ip a
to see correct static IPv4 addresses and static & dynamic IPv6 addresses. -
Note repeated dhcp requests for previous IPv4 address on dhcp server.
Apr 13 03:56:18 egde dhcpd[15258]: DHCPREQUEST for 10.31.40.241 from c0:74:2b:ff:dc:eb via lan0
Apr 13 03:56:18 egde dhcpd[11097]: DHCPREQUEST for 10.31.40.241 from c0:74:2b:ff:dc:eb via lan0
Apr 13 03:56:18 egde dhcpd[15258]: DHCPACK on 10.31.40.241 to c0:74:2b:ff:dc:eb via lan0
Apr 13 03:56:18 egde dhcpd[11097]: DHCPACK on 10.31.40.241 to c0:74:2b:ff:dc:eb via lan0
Apr 13 03:56:18 egde dhcpd[2993]: DHCPREQUEST for 10.31.40.241 from c0:74:2b:ff:dc:eb via lan0
Apr 13 03:56:18 egde dhcpd[2993]: DHCPACK on 10.31.40.241 to c0:74:2b:ff:dc:eb via lan0
Apr 13 03:56:18 egde dhcpd[11588]: DHCPREQUEST for 10.31.40.241 from c0:74:2b:ff:dc:eb via lan0
Apr 13 03:56:18 egde dhcpd[2922]: DHCPREQUEST for 10.31.40.241 from c0:74:2b:ff:dc:eb via lan0
Apr 13 03:56:18 egde dhcpd[2922]: DHCPACK on 10.31.40.241 to c0:74:2b:ff:dc:eb via lan0
Apr 13 03:56:18 egde dhcpd[11588]: DHCPACK on 10.31.40.241 to c0:74:2b:ff:dc:eb via lan0
Apr 13 03:56:18 egde dhcpd[11674]: DHCPREQUEST for 10.31.40.241 from c0:74:2b:ff:dc:eb via lan0
Apr 13 03:56:18 egde dhcpd[11674]: DHCPACK on 10.31.40.241 to c0:74:2b:ff:dc:eb via lan0
- On client
kill -9 <isc-dhclient process>
rm -f dhclient.enxc0742bffdceb.leases
rm -f dhclient.leases
reboot
- dhcp server stops seeing dhcp requests
Expected behavior
- Changing /etc/network/interfaces to static IPv4 only should prevent isc-dhclient from reading lease file and repeatedly requesting address but not using it.
Environment:
dhclient --version
isc-dhclient-4.4.1
cat /etc/os-release
PRETTY_NAME="Debian GNU/Linux 11 (bullseye)"
NAME="Debian GNU/Linux"
VERSION_ID="11"
VERSION="11 (bullseye)"
VERSION_CODENAME=bullseye
ID=debian
Contacting you
by my email address