Raspberry & Static IP address - Caronte Consulting

Raspberry & Static IP address

Here’s how to set a static IP address on Raspbian without going crazy!

In this tutorial we will show you how to set a static IP address on your Raspberry Pi, on which is installed a new Raspbian Jessie release.

The old method: edit / etc / network / interfaces

Let’s start by saying that in the new releases of Raspbian Jessie (from 2016-2-09 onwards) the method of setting static IP addresses by editing the file /etc/network/interfaces is no longer working.

We are tech Pirates

We design and build software, App, Remote Terminal Unit (RTU), Innovative Low Power Solutions (ILPS), SCADA systems, artificial vision systems,…

The new method: change the file /etc/dhcpcd.conf

1) Edit the following file:

sudo pico /etc/dhcpcd.conf

2) Go to the end of the file and add the following lines:

(To set a static IP on the Ethernet)
interface eth0
static ip_address = 192.168.1.10 / 24
static routers = 192.168.1.1
static domain_name_servers = 192.168.1.1

(To set the static ip on WiFi)
interface wlan0
static ip_address = 192.168.1.10 / 24
static routers = 192.168.1.1
static domain_name_servers = 192.168.1.1

3) Exit the editor by pressing CTRL+X.

4) Save the changes by pressing Y and then ENTER.

5) Reboot your Raspberry Pi:

sudo reboot

Share your thoughts