Setting a static IP address on the Raspberry Pi running Jessie Lite


Jeff Geerling has discovered in his work on the Raspberry Pi Dramble cluster that Raspbian Jessie does networking a bit differently. Whereas before (with Wheezy) it was just a case of adding some lines to /etc/network/interfaces, now you need to add some lines to /etc/dhcpcd.conf to make dhcpcd5 set the static IP address. He’s blogged about it here but just for posterity (in case his blog disappears, as others have), here are the essentials for setting a static IP for your wired connection:

So, in /etc/network/interfaces, you add:

auto lo
iface lo inet loopback
iface eth0 inet static

And then to /etc/dhcpcd.conf you add:

interface eth0
static ip_address=
static routers=
static domain_name_servers=

This should give you a static IP of

He has some other tips on his blog, so head over there if you want to read more.

4 comments for “Setting a static IP address on the Raspberry Pi running Jessie Lite

  1. It’s just wrong! the DHCP client should have nothing to do with static IPs (except via DHCP server leases) and should honour an interface’s desire not to be controlled by DHCP.

  2. I will certainly try this, so that I can pin down a static IP for my Pi – and my Zero.
    A query before I start again on my quest for the elusive static IP: can I, and indeed should I, try to assign separate IP addresses for my Pi and my Zero?

    • It’s a good idea to set static IPs for all the Pis on your network. Remember, though: it’s essentially the SD card you’re setting the address on, so if you were to swap the SD cards of a couple of Pis, you would be swapping the IP addresses as well.

  3. Nothing needs to be added to /etc/network/interfaces when implementing a static IP on Raspbian Jessie. (this is somewhat counter-intuitive to other Linux distros, but it is what it is…)

    As it says at the head of the file:
    # Please note that this file is written to be used with dhcpcd
    # For static IP, consult /etc/dhcpcd.conf and ‘man dhcpcd.conf’

    The only file requiring an edit is /etc/dhcpcd.conf as shown in the article.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.