0

I have configured the wireless interface on my Raspberry Pi 3 as follows:

allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
wireless-power off
iface default inet dhcp

and have reserved an address (192.168.1.151) for the interface using its MAC address. This works fine and when I boot the Pi all the services start etc.

But after some amount of time (presumably when the DHCP lease expires) the Pi makes another request for the particular IP it was given after boot and it is rejected (my router is running the DHCP server at 192.168.1.1):

Aug 16 15:19:49 pirate1 dhclient[415]: DHCPREQUEST for 192.168.1.151 on wlan0 to 192.168.1.1 port 67
Aug 16 15:19:49 pirate1 dhclient[415]: DHCPNAK from 192.168.1.1
Aug 16 15:19:49 pirate1 dhcpcd[348]: wlan0: pid 6780 deleted IP address 192.168.1.151/24
Aug 16 15:19:49 pirate1 avahi-daemon[335]: Withdrawing address record for 192.168.1.151 on wlan0.

And I can no longer contact the Pi.

Other servers have their IPs reserved in this way and I do not see this issue so it appears to be Pi specific but not too sure what is going on - restarting the Pi and everything is good again.

# uname -a
Linux pirate1 4.19.58-v7+ #1245 SMP Fri Jul 12 17:25:51 BST 2019 armv7l GNU/Linux
# cat /etc/issue
HypriotOS (Debian GNU/Linux 10) \n \l
dippynark
  • 109
  • 1

1 Answers1

1

You are mixing up different networking systems. As far as I can see it is old style Debian ifupdown managed in /etc/network/interfaces and Raspbian default networking dhcpcd. From the log I see a DHCPREQUEST from dhclient so I assume that you also use isc-dhcp-client in addition to dhcpcd. If so you have two dhcp clients running on your RasPi. This cannot work.

You should also note that using ifupdown together with dhcpcd need some special attention. Look at Differences between /etc/dhcpcd.conf and /etc/network/interfaces? what's the issue here.

I would say you should decide what networking system do you want to use and only use that one not mixing up them. On Raspbian you have three networking systems out of the box. Look at three different networking systems on Raspbian about this. I prefer systemd-networkd.

Ingo
  • 42,961
  • 20
  • 87
  • 207