Home | Miscellaneous | Pi | Set Address
Charles Varvayanis
Computer and Communication Systems
Charles Varvayanis Logo
Since 1990
(209) 586-3782
charles@varvayanis.com

How to Set Raspberry Pi IP Address


Step-by-step instructions for setting the Raspberry Pi IP Address

These procedures apply to Raspberry Pi 5, 4 or 3 with Raspberry Pi OS (64-Bit), (32-Bit), (Legacy 64-Bit) or (Legacy 32-Bit).


General Notes


1. General:  The procedures below are optimized for setting the IP Address of a Raspberry Pi 5, 4 or 3 with Raspberry Pi OS (64-Bit), (32-Bit), (Legacy 64-Bit) or (Legacy 32-Bit).

2. Internet access:  Some of the steps below assume and require the Raspberry Pi is connected to a network with access to the Internet.



Notice about updates, upgrades and installations failing due to repository or network congestion or outages


Occasionally updates, upgrades and installations fail due to repository or network congestion or outages.  Sometimes there is an appropriate message saying as such, sometimes a missing file is reported, and sometimes there is just a failure message without an explanation.  When this occurs, simply run the command again.  If that does not solve the issues immediately, try again later.



Contents:


Raspberry Pi OS Documentation

Connect to the Raspberry Pi

Change the Raspberry Pi IP address and network settings







Raspberry Pi OS Documentation

https://www.raspberrypi.com/documentation/computers/os.html






Connect to the Raspberry Pi


Via Raspberry Pi Connect Remote shell or Raspberry Pi Connect Screen share


https://www.raspberrypi.com/software/connect

  - or -

Via a Display, Keyboard and Mouse


  - or -

Via SSH


Connect using the IP address or URL of the Raspberry Pi

Determine the Raspberry Pi IP Address:

Use the SSH command in your OS to connect to the Raspberry Pi or on Windows systems use a third party tool such as PuTTY

Note:  The first time a connection is made, a security warning may be displayed | Yes






Change the Raspberry Pi IP address and network settings


The Raspberry Pi IP address and network settings can be changed using the Raspberry Pi Desktop Interface (GUI), NetworkManager User Interface (UI), or Command Line Interface (CLI).


Notes:


While the steps below are specific to setting the IP Address of the Ethernet Port, they can be used for setting the IP Address of a Wi-Fi connection by substituting the references to "Wired Connection 1" with your Wi-Fi Connection.

nmtui manual page:  https://manpages.debian.org/trixie/network-manager/nmtui.1.en.html

nmcli manual page:  https://manpages.debian.org/trixie/network-manager/nmcli.1.en.html


Update Raspberry Pi OS and Components


Download the latest package lists

sudo apt update -y

Download and install the updated packages listed in the package lists

sudo apt full-upgrade -y



Enable NetworkManager on Raspberry Pi OS (Legacy 64-Bit) and (Legacy 32-Bit).  Note:  NetworkManager is enabled by default on Raspberry Pi OS (64-bit) and (32-Bit).


Enable NetworkManager

sudo raspi-config

Advance Options | [Enter] | Network Config | [Enter] | NetworkManager | [Enter] | OK | [Enter] | Finish | [Enter] | Would you like to reboot now? | Yes | [Enter]

Note 1:  The DHCP assigned IP Address of the Raspberry Pi may change and need to be located again.

Note 2:  The TeamViewer ID of the Raspberry Pi may change and need to be obtained again.



Note:  The Subnetwork Mask is expressed in Slash Notation along with an IP Address in certain areas of this section.


Network Subnetwork Mask and Slash Notation Relationships


Class  Mask                      Slash  Nodes
A255.000.000.000/816777214
B255.255.000.000/1665534
B255.255.128.000/1732766
B255.255.192.000/1816382
B255.255.224.000/198190
B255.255.240.000/204094
B255.255.248.000/212046
B255.255.252.000/221022
B255.255.254.000/23510
C255.255.255.000/24254
C255.255.255.128/25126
C255.255.255.192/2662
C255.255.255.224/2730
C255.255.255.240/2814
C255.255.255.248/296
C255.255.255.252/302
C255.255.255.254/310
C255.255.255.255/320


Change the Raspberry Pi IP address and network settings using the Raspberry Pi GUI (Desktop)


Note:  "Wired connection 1" is the default Ethernet connection name and is assumed in the following commands.

Click on the two arrows facing up and down on the right side of the Task Bar at the top of the Raspberry Pi desktop

Click on "Advanced Options" | "Edit Connections..."

Doubke Click on "Ethernet" | "Wired connection 1"

Click on the "IPv4 Settings" Tab


Click on these fields to edit them:

"Method" | Manual

"Address"
(Your Rspbrry Pi IP Address)
Example:
192.168.0.25

"Netmask"
(See the section above "The Subnetwork Mask is expressed in Slash Notation...")
Example:
/24

"Gateway"
(Typicaly the network router LAN IP Address)
Example:
192.168.0.1

"DNS servers"
(Use commas to seperate multiple domain name server addresses)
Example:
8.8.8.8,8.8.4.4

Click on the "Save" Button

X out of the "Network Connections" window

  - or -

Change the Raspberry Pi IP address and network settings using the NetworkManager User Interface (UI)


Note:  "Wired connection 1" is the default Ethernet connection name and is assumed in the following commands.

Open the NetworkManager User Interface (UI)

sudo nmtui

Edit a connection | [Enter] | Wired Connection 1 | [Enter]

Change these fields  (Note:  Use [Tab] to move around the window, [Enter] to select, and [Esc] to back out of a window):

IPv4 CONFIGURATION | <Automatic> | [Enter] | Manual | [Enter] | <Show> | [Enter]

Addresses | <Add...> | [Enter] | <YourRaspberryPiIPAddress>/<YourNetworkSubnetworkMask> (The Subnetwork Mask is expressed in Slash Notation along with the IP Address) - Example:  192.168.0.25/24 | [Enter]

Gateway | <YourNetworkDefaultGatewayIPAddress> (Typicaly the network router LAN IP Address) - Example:  192.168.0.1 | [Enter]

DNS Servers | <Add...> | [Enter] | <DNSServer1> - Example:  8.8.8.8 | [Enter]

DNS Servers | <Add...> | [Enter] | <DNSServer2> - Example:  8.8.4.4 | [Enter]

OK | [Enter]  (Note:  [Tab] to bottom of the window)

[Esc] | [Esc]

Restart the connection to begin using the new settings

sudo nmcli con up "Wired connection 1"

  - or -

Change the Raspberry Pi IP address and network settings using NetworkManager Command Line Interface (CLI)


Show all network connections

sudo nmcli con show

Note:  "Wired connection 1" is the default Ethernet connection name and is assumed in the following commands.

Set IP Address

(Note:  The Subnetwork Mask is expressed in Slash Notation along with the IP Address)
sudo nmcli con mod "Wired connection 1" ipv4.addresses <YourRaspberryPiIPAddress>/<YourNetworkSubnetworkMask>
Example:
sudo nmcli con mod "Wired connection 1" ipv4.addresses 192.168.0.25/24

Set the Gateway Address

(Note:  Typicaly the Gateway Address is network router LAN IP Address)
sudo nmcli con mod "Wired connection 1" ipv4.gateway <YourNetworkDefaultGatewayIPAddress>
Example:
sudo nmcli con mod "Wired connection 1" ipv4.gateway 192.168.0.1

Set the DNS Servers

(Note:  Use spaces to seperate multiple domain name server addresses)
sudo nmcli con mod "Wired connection 1" ipv4.dns" <DNSServer1> <DNSServer2> <DNSServer...>"
Example:
sudo nmcli con mod "Wired connection 1" ipv4.dns "8.8.8.8 8.8.4.4"

Set the Addressing Mode to Manual (Static)

sudo nmcli con mod "Wired connection 1" ipv4.method manual

Restart the connection to begin using the new settings

sudo nmcli con up "Wired connection 1"


Diagnostics and verification (Optional)


Display the IP Address, Gateway, DNS Servers and Addressing Mode (Short version)

sudo nmcli -g ip4.address,ipv4.gateway,ip4.dns,ipv4.method connection show "Wired connection 1"

Display the profile so all parameters can be reviewed (Long version)

sudo nmcli -p con show "Wired connection 1"



Charles Varvayanis
Sonora, CA  95370
e-mail:  charles@varvayanis.com
Phone:  (209) 586-3782
Business Card (PDF 153 KB) PDF
www.varvayanis.com
www.varvayanis.com

© 2026 Charles Varvayanis
All rights reserved