i have configured both eth0 and wlan with static ip according to this post:

Setting up WiFi and Ethernet

It works fine. But if I reboot The pi; Eth0 gets the assined ip even without the cable plugged in. Similar thing happen when I reboot with the Ethernet cable plugged in; Now I get a functional ip but if I unplug it, ifconfig still show the static ip.

What is wrong?


auto lo
iface lo inet loopback

allow-hotplugin eth0
iface eth0 inet static

auto wlan0
iface wlan0 inet static
wpa-ssid MYWIFI
wpa-psk *** 

iface default inet dhcp


ARGS="-q -f -u0 -d10 -w -I"
  • 2
    The IP address is statically defined on the adapter. When you plug the cable in you then get functional networking. So irrespective of network availability the static IP address will always be shown.
    – albal
    Aug 4, 2015 at 8:41
  • Maybe a dynamic IP is what you're looking for? Then you would only get it, when the cable is plugged in.
    – Swiss Dev
    Aug 4, 2015 at 18:56

1 Answer 1


Nothing is wrong.

You have asked for a static IP address and that's what you have got.

If you don't want a static IP address then use dynamic, that way an IP address will be assigned when the ethernet cable is plugged in.

  • it makes sense but I got 4 pi's. The former three are clones of the first one [master]. on the master when i unplug the cable the ip vanish from ifconfig but not the interface itself. I cant figure out why I like it that way because it makes more sense on my head. I have been fiddling around with ifplugd with no success. I am gonna edit my question to include the interfaces file I have been using. Do you know any ifconfig flag to show only RUNNING interfaces? a quick google only showed me some creepy grep stuff.
    – CESCO
    Aug 4, 2015 at 17:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.