Setting up a static IP address or Wifi on Raspberry PI 2 B

Reading Time: 1 minute
Setting up a static IP address or Wifi on Raspberry PI 2 B
5 (100%) 2 votes

Eth0 static IP address configuration

On the latest version of Raspbian (in my case, Raspbian GNU/Linux 8), you should not use /etc/network/interfaces to set up your networks.
All configuration has been offloaded to the dhcpcd client.

For a static IP address on the eth0 interface, you’ll need to edit file /etc/dhcpcd.conf

For a static IP address of, add the following lines at the end of the file (adjust the IP addresses to your own situation):

WiFi configuration

Also on the latest version of Raspbian, if you use another user than the PI user to set up a WiFi network from the desktop, you will get an error about access to the dhcpcd.conf file.

This is due to the file’s group permissions:

Solution #1: Add the user to the netdev group

Issue the command:

Logout after doing this, and log in again. Now you should be able to access the configuration dialog.

Solution #2: Add the network manually

Add the following to the file  /etc/wpa_supplicant/wpa_supplicant.conf

Replace the values between the double quotes with whatever value you need for your network.
Note that it also applies to WPA-PSK secured networks only, use a different value for key_mgmt if you use WEP or no security at all.