Raspberry pi with static ip

One of the first steps after installing your Raspberry pi with Raspbian would be setting up a static ip address. If you used to configure you static networking via /etc/network/interfaces… well this entry is for you!

Since Raspbian Jessie the way to configure a static ip address is via dhcpcd service. This service uses the file /etc/dhcpcd.conf, and to assign a static ip to a network interface you must edit the file, adding to the very end of the file:

interface eth0
static ip_address=xxx.xxx.xxx.xxx/xx 
static routers=xxx.xxx.xxx.xxx
static domain_name_servers=xxx.xxx.xxx.xxx

And that’s it. After the next reboot you will have the static ip assigned.