Home/Computers & IT/How to set a Static IP Address on your Raspberry Pi

There are a heap of articles out there which conflict with each other on how to set a Static IP Address on your Raspberry Pi.

This guide is for a Raspberry Pi running Rasbian.

In your SSH terminal put this command in to edit the interfaces config file.

sudo nano /etc/network/interfaces

You will want to setup your interfaces config file like mine.
Obviously you want to put in the IP Address you want & your networks settings.

RaspberryPi Static IP Address

Address = Static IP Address you want to set
netmask = Network Subnet Mask
network = network range starting address
broadcast = network range ending address
gateway = Gateway IP Address (normally your routers IP Address)

If your interfaces config file doesn’t look like this you may have a different version of raspbian installed.
For example the new Rasbian Jessie has dhcp packages installed & it no longer looks at the interfaces config for Static IP Address’s etc.
If this is the version you have you will see in the interfaces config file that it says:

*For static IP, consult /etc/dhcpcd.conf and ‘man dhcpcd.conf’

In this case exit the interfaces config file & put this command in.

sudo nano /etc/dhcpcd.conf

Scroll to the end of the file & add the following (making sure you put your network settings & desired Static IP Address)

# Custom static IP address for eth0.
interface eth0
static ip_address=
static routers=
static domain_name_servers=
static ip_address= static IP Address you wish to set /24 this is the subnet mask value. /24 is a short way of setting as the subnet mask.
static routers= your routers IP Address
static domain_name_servers= the DNS Server you wish to use (normally set as your routers IP Address)
Either one of these solutions will achieve a Static IP Address configuration for your raspberry pi
IF you have any questions or feedback feel free to comment below!
By | 2017-06-27T11:12:34+00:00 February 29th, 2016|Computers & IT|0 Comments

Leave A Comment