I know this is out there already in the Googlesphere, this post is more for me in the future than it is for you. I have a few Raspberry Pies and I like to run static IPs. It just makes things easier and I like having my network “all fancy”.
I went to setup a static IP the other day and it wasn’t working. I rebooted a few times until I figured out something was up. In my Googling I found out that the standard linux way of assigning a static IP address won’t work with the new version of Jessie for a Raspberry Pi. They made some updates and the old configuration now gets ignored. So editing the interfaces at /etc/network/interfaces is a no go. I mean you can, but it’s pointless. Not to worry the new way is just as easy as before it is just located in a different file now. Now you need to edit /etc/dhcpcd.conf, and the way you set the address is slightly different.
The old way of doing things:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 |
auto lo iface lo inet loopback iface eth0 inet static address 10.0.0.10/24 netmask 255.255.255.0 gateway 10.0.0.1 dns-nameservers 8.8.8.8 8.8.4.4 allow-hotplug wlan0 iface wlan0 inet manual wpa-roam /etc/wpa_supplicant/wpa_supplicant.conf iface default inet dhcp |
And the new way of doing things:
1 2 3 4 |
interface eth0 static ip_address=10.0.0.10/24 static routers=10.0.0.1 static domain_name_servers=8.8.8.8 8.8.4.4 |
It has become a little easier if you ask me, you just need to know where the new file to edit is.
All thanks to this page:
https://www.jeffgeerling.com/blog/2016/setting-static-ip-address-raspbian-jessie-lite-on-raspberry-pi