1

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?

Jacobm001
  • 11,904
  • 7
  • 47
  • 58
Reto
  • 165
  • 1
  • 1
  • 5

1 Answers1

2

"My Pi is set to a static IP" - No it isn't! You have 2 different settings for wlan0. It is unpredictable what would happen.

See https://raspberrypi.stackexchange.com/a/37921/8697 for a tutorial on how to setup.

Milliways
  • 62,573
  • 32
  • 113
  • 225