How do I set a static IP address in Raspbian "Jessie" using /etc/dhcpcd.conf?

raspbian

#1

Despite lots of confusing information out there, it is actually pretty straightforward to set a static address in Raspbian.

Being by editing the file (do not use /etc/network/interfaces anymore!)

sudo vi /etc/dhcpcd.conf

Then all you need to do is append this to the bottom of the file, substituting the correct IP address and interface identifier you want.

interface eth0
static ip_address=192.168.1.141/24
static routers=192.168.1.1
static domain_name_servers=192.168.1.1

Restart your Pi to apply the changes.


#2

Will the…

sudo vi /etc/dhcpcd.conf

command allow one to change/edit the static IP address or just view it?


#3

You can edit it with that command, but you’d need to know how to use it. Try nano instead.


#4

Adventures of VIM


#5

I had better luck setting a static IP for a WiFi connection by editing:

/etc/wpa_supplicant/wpa_supplicant.conf