How to set a Static IP Address on the Raspberry Pi running Raspbian Jessie+
About: With the release of Raspbian Jessie made all older methods of setting a static IP Address on the Raspberry Pi obsolete. You no longer need to edit /etc/network/interfaces . You will now need to edit /etc/dhcpcd.conf to set your static IP address on the Raspberry Pi. Setting a static IP address is easy and useful if you are running something that requires the IP address to remain the same after a reboot. This is useful is you are using your Raspberry Pi as a web server or a DNS server.
Objective: To set a Static IP Address on our Raspberry Pi running Raspbian Jessie or newer
Material: You will need the following:
- Raspberry Pi (Click the link to check out the price on Amazon. Usually around $37 with free shipping)
Instructions: Let’s start off by going into your terminal on your Pi.
Make sure you do not edit your /etc/network/interfaces and if have already edited it make sure to change everything back to the way it was.
Type the following command to edit /etc/dhcpcd.conf. This is the file we now need to edit when running Jessie or any newer versions of Raspbian
sudo nano /etc/dhcpcd.conf
Now simply scroll all the way down and add the following to set your static IP Address:
Your /etc/dhcpcd.conf file should look similar to this now:
Now simply hit CTRL+X then Y and ENTER to save the file. Now just do a reboot and your should be good to go.
Let me explain what we are doing. The first line “interface” sets what interface we will be configuring. In this case I used eth0 for the Ethernet port. You can use wlan0 if you have a WiFi card attached. To see a list of the interfaces you can use type:
The second line sets our Static IP Address. In my example I am using 192.168.1.26.
The third line is the IP address of our router and the forth line is the IP address for DNS servers. Your router is usually configured to point to your ISP’s DNS servers. If you are not sure you can use 22.214.171.124 which are the DNS servers for Google.
As always if you have any questions just leave a comment below.