Raspbian Jessie or Stretch Static IP Setup
Created 28/11/2015 | Static IP Setup for Raspbian Jessie or Stretch
This page details how to setup a static IP address on the Ethernet connection on the Raspbian Jessie or Stretch image from http://www.raspberrypi.org/downloads
Step 1: Download the latest Raspbian image and burn to your SD Card following the instructions on http://elinux.org/RPi_Easy_SD_Card_Setup
Step 2: Connect your network cable and boot the pi and login via the GUI or terminal.
Step 3: Using the terminal run the following command to check your current network settings:
Information similar to the following will be returned:
Link encap:Ethernet HWaddr b8:27:eb:5d:cc:48
inet addr:10.0.0.24 Bcast:10.0.0.255 Mask:255.255.255.0
inet6 addr: fe80::cfc8:355f:f377:5a65/64 Scope:Link
Step 4: Take a note of the inet addr, bcast and Mask addresses as you will need these later.
Step 5: Now we need to run the following command to get the information from your router:
sudo route –n
Step 6: Take a note of the Gateway address which is needed for the static routers and static domain_name_servers address.
Step 7: Now we have all the data needed to setup your static IP address on your raspberry Pi. For this demo we are going to give the Raspberry Pi a static IP address of 10.0.0.220
Step 8: Now we need to edit /etc/dhcpcd.conf
sudo nano /etc/dhcpcd.conf
Step 9: Add the following at the end of the file and save your changes:
Step 10: You now need to reboot to apply the changes:
Your Raspberry Pi will restart and be accessible on the new IP address