Knowledge Base

The AB Electronics UK Knowledge Base provides support solutions, tutorials and troubleshooting guides.

Knowledge Base

Raspberry Pi OS Static IP Setup

Static Network IP Address Setup on the Raspberry Pi
Created: 28/11/2015 | Last Updated: 17/02/2021

This page details how to setup a static network IP address on the Ethernet connection on the Raspberry Pi OS image from

For this demo we are going to give the Raspberry Pi a static IP address of and a subnet of 24.  The router/gateway address will be set at and the DNS server will also be set as

You can find the default gateway for your network with the following command.

netstat -nr

Step 1: Download the latest Raspberry Pi OS image image and burn to your SD Card following the instructions on

Step 2: Connect your network cable and boot the pi and login via the GUI or terminal.

Step 3: Now we need to edit /etc/dhcpcd.conf

sudo nano /etc/dhcpcd.conf

Step 4:  Add the following at the end of the file and save your changes:

interface eth0
static ip_address=
static routers=
static domain_name_servers=

Step 5: Reboot to apply the changes:

sudo reboot

Your Raspberry Pi will restart and be accessible on the new IP address

Was this article helpful? Yes / No