Configure static IP on Raspberry

Initial checkup

List the network interface we currently have available:

The line
iface eth0 inet dhcp
means that we’re currently getting out IP address via DHCP, meaning it’s being dynamically registered by the router. This is what we want to change!

Get info about raspberry:

keep note the following information:
inet addr – (Pi’s Current IP Address)
Bcast – (The Broadcast IP Range)
Mask – (Subnet Mask Address)

Get info about router:

(N.B. even route -n return the same info)

keep note the following information:
Gateway Address –
Destination Address –

Edit Network Configuration

edit /etc/network/interfaces

change the line:
iface eth0 inet dhcp
iface eth0 inet static

now, directly below this line, configure the following:

Brief explanation of paramenters:
address – The address you want to give your Pi, this can be any IP in the network range, but it’s usually advisable to go higher rather than lower, or you could end up logging different devices to the same IP! I’ve selected, as we’re already registered to that address (denoted by ‘inet addr’), but this can be any IP address from the range192.168.1.1 to
netmask – The ‘Mask’ address we wrote down earlier.
network – The router IP address, this is the ‘Destination’ Address was found earlier. You can also grab this off your router, it will say on the side somewhere.
broadcast – The ‘Bcast’ address we wrote down earlier.
gateway – This is the ‘Gateway’ address we found earlier.

now, restart raspberry


Leave a Reply

Your email address will not be published. Required fields are marked *