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 wlan0andallow-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 toeth0which gets a new IP via DHCP. Then you'rewlan0card comes back up and your connection changes. In other words: 192.168.1.105 is probablyeth0notwlan0. Trysudo ifconfigto check – kba Feb 18 '16 at 15:45iface default inet dhcpstand for? Do I need this? – Reto Feb 18 '16 at 19:40iface default inet dhcp? Or change it toiface default inet staticoriface default inet manual? – Reto Feb 18 '16 at 20:51