I am trying to set a static ip address. The static ip is outside of my home dhcp range. But even after reboot, I can connect to the old dhcp ip address. Why does this happen? Take a look at the ip during login and in the ouput of ifconfig:

login as: pi
pi@'s password:

The programs included with the Debian GNU/Linux system are free software;
the exact distribution terms for each program are described in the
individual files in /usr/share/doc/*/copyright.

Debian GNU/Linux comes with ABSOLUTELY NO WARRANTY, to the extent
permitted by applicable law.
Last login: Tue Jan  5 20:54:59 2016 from flucky-pc.lan

pi@druckerpi:~ $ ifconfig

eth0      Link encap:Ethernet  Hardware Adresse b8:27:eb:7b:45:2b
          inet Adresse:  Bcast:  Maske:
          inet6-Adresse: fe80::ba27:ebff:fe7b:452b/64 Gültigkeitsbereich:Verbindung
          RX packets:11358 errors:0 dropped:0 overruns:0 frame:0
          TX packets:1300 errors:0 dropped:0 overruns:0 carrier:0
          Kollisionen:0 Sendewarteschlangenlänge:1000
          RX bytes:631413 (616.6 KiB)  TX bytes:133922 (130.7 KiB)

lo        Link encap:Lokale Schleife
          inet Adresse:  Maske:
          inet6-Adresse: ::1/128 Gültigkeitsbereich:Maschine
          UP LOOPBACK RUNNING  MTU:65536  Metrik:1
          RX packets:41 errors:0 dropped:0 overruns:0 frame:0
          TX packets:41 errors:0 dropped:0 overruns:0 carrier:0
          Kollisionen:0 Sendewarteschlangenlänge:0
          RX bytes:5671 (5.5 KiB)  TX bytes:5671 (5.5 KiB)

pi@druckerpi:~ $ cat /etc/network/interfaces

# interfaces(5) file used by ifup(8) and ifdown(8)

# Please note that this file is written to be used with dhcpcd
# For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf'

# Include files from /etc/network/interfaces.d:
source-directory /etc/network/interfaces.d

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet static

#allow-hotplug wlan0
#iface wlan0 inet manual
#    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf

#allow-hotplug wlan1
#iface wlan1 inet manual
#    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
pi@druckerpi:~ $

Is there something I am missing? I DONT want to be able to connect to and instead use the static ip (as set in /etc/network/interfaces)

  • I assume you are running Raspbian? What version are you running? Did you see this line For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf' in the /etc/network/interfaces file you included above? The method of configuring networking has changed. This forum thread raspberrypi.org/forums/viewtopic.php?f=63&t=110606has all the good/bad details. Note the title seems off topic, but the details of the new method of setting a static IP using /etc/dhcpcd.conf file are there. – Steve Robillard Jan 5 '16 at 22:52
  • 1
    Check whether there is some setting in your home router (e.g. dhcp with "fixed" ip address) if you find the Pi (or its former IP listed there) - try to delete it. – Ghanima Jan 5 '16 at 22:52

I assume that by now, your host computer ARP cache table no longer remember the IP Address.

arp -in eth0

Will show you the association between IP and MAC addresses. Unless someone else reuse the same IP with a new MAC, the ARP protocol will keep it alive for some time. You can also clear that table, O/S dependent, with commands like:

arp -d *  


ip -s -s neigh flush all
  • My raspberry is still running (over a year now) and today I was able to connect via ssh to the old (wrong) ip from my question from another laptop. Over a year in arp cache? – feedc0de Feb 14 '17 at 19:09

The method of setting a static IP has changed (this has rasied some questions and ire from the community, but it is what it is). Evidence of this can be seen in the comments of the /etc/network/interfaces file you included above, namely these two lines:

Please note that this file is written to be used with dhcpcd

For static IP, consult /etc/dhcpcd.conf and 'man dhcpcd.conf

To set up a static IP using the new dhcpd system edit your /etc/wpa_supplicant/wpa_supplicant.conf file so that it only contains the SSID and psk:


and the static IP details are in the /etc/dhcpcd.conf file:

# Static IP configuration
interface eth0
static ip_address=
static routers=
static domain_name_servers=

You will also have to edit your /etc/network/interfaces file so that the eth0 entry looks like this:

auto eth0
allow-hotplug eth0
iface eth0 inet manual

More info can be found in this forum thread. Despite the title of the thread it does include the details of the new setup as well as some of the anger this change has caused.

  • Hi is connecting to however, ifconfig shows (in German adresse) – fcm Jan 5 '16 at 23:14
  • @Fcm One of the problems the switch in network config has made is double IP address assignment the forum thread is actually titled /etc/network/interfaces changed,weird 2 LAN IPs instead of 1 – Steve Robillard Jan 5 '16 at 23:17
  • 1
    For a less passionate and easier to follow answer see raspberrypi.stackexchange.com/a/37921/8697 (I agree the actions of certain Foundation developers making fundamental changes without updating the documentation is irresponsible.) – Milliways Jan 5 '16 at 23:18
  • @Milliwaysmy personal favorite is that to set a static Ip you use a file called dhcpd, and set the mode as manual not the most intuitive naming scheme – Steve Robillard Jan 5 '16 at 23:20
  • @SteveRobillard I could not agree more! Of course my personal favourite (hobby horse) is to NOT use static, and let the computer do the work. – Milliways Jan 5 '16 at 23:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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