If you futz with multiple nics on a raspberry pi, at some point you will have to deal with disabling dhcp on a specific NIC. Here is some quick guidance on what to do:
Configure dhcpcd to ignore wlan0
dhcpcd is the linux dhcp client. dnsmasq is commonly used as a dhcp server. If you are doing something with both on the same client, you might have weird conditions where you are trying to set a static ip on the interface that is vending dhcp addresses. You’ll want to disable that interface from listening to the dhcp server.
Check /etc/network/interfaces
; this should be empty except for an include from /etc/network/interfaces.d
(which is in turn empty).
Edit /etc/dhcpcd.conf
:
denyinterfaces wlan0
sudo systemctl restart dhcpcd
.