Knowledge Base

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

Knowledge Base

Set a static IP Address on Raspberry Pi OS Buster

How to use a static network IP Address on the Raspberry Pi

This page details how to set up a static network IP address on the Ethernet connection on the Raspberry Pi OS Buster image from https://www.raspberrypi.org/software/operating-systems/.

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

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

netstat -nr

Step 1: Download the latest Raspberry Pi OS image and burn it to your SD Card following the instructions on http://elinux.org/RPi_Easy_SD_Card_Setup.

Step 2: Connect your network cable, boot the Raspberry Pi, and log in 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. Change the IP address, routers and domain name server to match your network.

interface eth0
static ip_address=10.0.0.220/24
static routers=10.0.0.1
static domain_name_servers=10.0.0.1

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

Please tell us how we can improve this article:

Submit
Created 12/10/2023 | Last Updated: 01/01/2024

Related Expansion Boards

Order a 1 Wire Pi Plus Photo of 1 Wire Pi Plus
1 Wire Pi Plus

1 Wire interface for the Raspberry Pi

£14.39 Ex VAT: £11.99
Add to Basket
Order a ADC Pi Photo of ADC Pi
ADC Pi

8 Channel 17-bit Single-Ended Analogue to Digital converter for the Raspberry Pi

£19.19 Ex VAT: £15.99
Add to Basket
Order a Breakout Pi Plus Photo of Breakout Pi Plus
Breakout Pi Plus

Prototyping board for Raspberry Pi

£4.79 Ex VAT: £3.99
Add to Basket
Order a IO Pi Plus Photo of IO Pi Plus
IO Pi Plus

32 channel MCP23017 digital I/O expander for the Raspberry Pi

£14.39 Ex VAT: £11.99
Add to Basket
Order a RS485 Pi Photo of RS485 Pi
RS485 Pi

RS485 serial interface for the Raspberry Pi

£14.39 Ex VAT: £11.99
Add to Basket
Order a Serial Pi Plus Photo of Serial Pi Plus
Serial Pi Plus

RS232 Serial Port for the Raspberry Pi

£13.19 Ex VAT: £10.99
Add to Basket

Related Articles

Raspberry Pi GPIO Pin Usage
Raspberry Pi GPIO Pin mapping and connections
PCB Header Assembly Jig
Using the PCB Header Assembly Jig
Samba Setup on Raspberry Pi
How to install and setup Samba on the Raspberry Pi
Set a static IP Address on Raspberry Pi OS Bookworm
How to use a static network IP Address on the Raspberry Pi
Set a static IP Address on Raspberry Pi OS Buster
How to use a static network IP Address on the Raspberry Pi
Set a static IP Address on Raspberry Pi OS Wheezy
Static Network IP Address Setup on the Raspberry Pi
I2C Part 1 - Introducing I2C
An introduction to the I²C protocol
I2C Part 2 - Enabling I2C on the Raspberry Pi
How to enable I2C on the Raspberry Pi
I2C Part 3 - I2C tools in Linux
An introduction to I²C tools in Linux
I2C Part 4 - Programming I2C with Python
How to get started with Programming I²C with Python
SPI and Python on Raspberry Pi OS
Enabling SPI on the Raspberry Pi and installing python py-spidev
Using Pythonpath with the Python Libraries
Adding the library path to startup
Connecting Expansion Boards to the Raspberry Pi 400
Expanding the Potential of Your Raspberry Pi 400