My Pi is set to a static IP. But after a few hours or days it is suddenly no longer reachable on this IP. I now figured out that when this happens the wlan0 interface is no longer on this static IP but on a different one...
This is my interfaces file
auto lo
iface lo inet loopback
iface eth0 inet dhcp
allow-hotplug wlan0
iface wlan0 inet manual
wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf
iface default inet dhcp
auto wlan0
iface wlan0 inet static
address 192.168.1.100
gateway 192.168.1.2
netmask 255.255.255.0
network 192.168.1.0
broadcast 192.168.1.255
This morning it was on 192.168.1.100
, but now it is on 192.168.1.105
. How can this happen?
auto wlan0
andallow-hotplug wlan0
. Could it be that your usb draw too much power, the usb disconnects (maybe just for a few seconds). Then it falls back toeth0
which gets a new IP via DHCP. Then you'rewlan0
card comes back up and your connection changes. In other words: 192.168.1.105 is probablyeth0
notwlan0
. Trysudo ifconfig
to check