How to Configure a Static IP Address on Ubuntu 26.04 Desktop

This guide explains how to static ip configure ubuntu 26.04 desktop using graphical and command-line methods. Assigning a static IP address ensures consistent network accessibility and simplifies firewall rules, DNS entries, and service configurations.

Ubuntu 26.04 Resolute Raccoon desktop installations use NetworkManager as the network configuration backend. This article provides working examples using both the nmcli command-line tool and the GNOME graphical interface, so you can configure your static IP regardless of your preferred workflow. For server installations using Netplan, see our dedicated guide on how to configure static IP with Netplan.

In this tutorial you will learn:

  • How to identify your network interface name
  • How to set a static IP with NetworkManager and nmcli
  • How to assign a static IP through the GNOME Settings GUI
  • How to verify your static IP configuration is working
Ubuntu 26.04 desktop static IP configuration using NetworkManager and GNOME Settings
Configuring a static IP address on Ubuntu 26.04 desktop using NetworkManager

Software Requirements

Software Requirements and Linux Command Line Conventions
Category Requirements, Conventions or Software Version Used
System Ubuntu 26.04 Resolute Raccoon
Software NetworkManager 1.x, GNOME Settings (gnome-control-center)
Other Privileged access to your Linux system as root or via the sudo command.
Conventions # – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command
$ – requires given linux commands to be executed as a regular non-privileged user
TL;DR
To static ip configure ubuntu 26.04 desktop, use NetworkManager via nmcli or the GNOME Settings GUI. Both methods provide persistent configurations that survive reboots.

Quick Steps to Configure Static IP
Step Command/Action
1. List connections nmcli connection show
2. Set static IP sudo nmcli connection modify "netplan-ens18" ipv4.addresses 172.16.1.165/24 ipv4.gateway 172.16.1.1 ipv4.method manual
3. Restart connection sudo nmcli connection up "netplan-ens18"

Identify Your Network Interface

Before configuring a static IP, you need to know your network interface name. Modern Ubuntu systems use predictable interface names like ens18 or enp0s3 for Ethernet or wlp2s0 for wireless, rather than the legacy eth0 naming convention.

Run the following command to list all network interfaces:

$ ip link show
Terminal output of ip link show command on Ubuntu 26.04 displaying lo loopback and ens18 Ethernet interfaces
Output of the ip link show command showing available network interfaces including ens18

Identify your Ethernet interface from the output (it will not be lo, which is the loopback interface). Note this name, as you will need it for the configuration steps below. To change your IP address from the command line, you will reference this interface name in your configuration.

Configure Static IP with nmcli on Ubuntu 26.04 Desktop

NetworkManager provides the nmcli command-line tool for network configuration. This method works well on Ubuntu desktop installations and offers immediate feedback. You can also use this approach to set a static IP without editing configuration files directly.

In this example, we configure the following static IP settings. Replace these values with settings appropriate for your network.

Example Static IP Configuration
Parameter Example Value
Interface ens18
Connection name netplan-ens18
Static IP 172.16.1.165/24
Gateway 172.16.1.1
DNS servers 8.8.8.8, 8.8.4.4
  1. List existing connections: Identify the connection name associated with your interface.
    $ nmcli connection show

    Terminal output of nmcli connection show command on Ubuntu 26.04 displaying netplan-ens18 ethernet connection
    Output of nmcli connection show displaying the connection name netplan-ens18 for the ens18 interface
  2. Modify the connection to use a static IP: Use nmcli to configure the IP address, gateway, and DNS settings.
    $ sudo nmcli connection modify "netplan-ens18" \
      ipv4.addresses 172.16.1.165/24 \
      ipv4.gateway 172.16.1.1 \
      ipv4.dns "8.8.8.8,8.8.4.4" \
      ipv4.method manual

    Replace netplan-ens18 with your actual connection name from step 1, and adjust the IP address, gateway, and DNS servers to match your network.

  3. Restart the connection: Deactivate and reactivate the connection to apply changes.
    $ sudo nmcli connection down "netplan-ens18"
    $ sudo nmcli connection up "netplan-ens18"

The configuration persists across reboots. NetworkManager stores connection profiles in /etc/NetworkManager/system-connections/ as keyfile-format files.

Terminal showing nmcli commands to configure static IP 172.16.1.165 on Ubuntu 26.04 and ip addr show verification output
Complete nmcli workflow: modifying connection settings, restarting the connection, and verifying the static IP assignment

Configure Static IP via GNOME GUI

Ubuntu 26.04 desktop users can configure a static IP through the GNOME Settings application without touching the command line.

  1. Open Network Settings: Click the system menu in the top-right corner, then click the gear icon to open Settings. Navigate to Network (for wired) or Wi-Fi (for wireless connections).
  2. Access connection settings: Click the gear icon next to your active connection to open its settings dialog.
  3. Configure IPv4 settings: Select the IPv4 tab and change the Method from “Automatic (DHCP)” to “Manual”. Click Add and enter your desired IP address (e.g., 172.16.1.165), netmask (e.g., 255.255.255.0), and gateway (e.g., 172.16.1.1). Enter DNS servers in the DNS field, separated by commas (e.g., 8.8.8.8, 8.8.4.4).
  4. Apply the configuration: Click Apply. You may need to toggle the connection off and on, or disconnect and reconnect for changes to take effect.
GNOME Settings Network panel on Ubuntu 26.04 showing IPv4 manual configuration with static IP 172.16.1.165, netmask 255.255.255.0, and gateway 172.16.1.1
GNOME Settings Network panel with IPv4 Method set to Manual and static IP configuration fields completed

Verify Your Configuration

After configuring your static IP using any method, verify the settings are correctly applied.

  1. Check the assigned IP address: Confirm your interface has the expected IP.
    $ ip addr show ens18

    Look for the inet line showing your static IP address. The absence of the word dynamic confirms this is a static assignment.

  2. Verify the default gateway: Ensure the routing table includes your gateway.
    $ ip route show

    You should see a line starting with default via followed by your gateway address.

  3. Test network connectivity: Ping an external host to confirm internet access.
    $ ping -c 4 8.8.8.8
  4. Test DNS resolution: Verify name resolution is working.
    $ ping -c 4 google.com

    If this fails but the previous ping succeeded, check your DNS configuration.

For more details on managing network connections, see the official NetworkManager documentation.

Terminal output verifying static IP configuration on Ubuntu 26.04 with ip addr show, ip route show, and successful ping tests to 8.8.8.8 and google.com
Verification commands confirming static IP 172.16.1.165, default gateway 172.16.1.1, and successful network connectivity

Conclusion

You have learned how to static ip configure ubuntu 26.04 desktop using two methods: nmcli for command-line network management and the GNOME GUI for a graphical approach. Both methods use NetworkManager as the backend and create persistent configurations that survive reboots.

Command-line users may prefer nmcli for its scriptability and precision, while the GNOME interface offers an intuitive point-and-click experience. Regardless of your choice, always verify your configuration and test connectivity after making changes. For server installations, see our guide on how to configure static IP with Netplan.

Frequently Asked Questions

  1. What happens if I configure the wrong static IP address? If you assign an IP that conflicts with another device or is outside your network range, you may lose network connectivity. You can always access GNOME Settings or use nmcli from a local terminal to correct the configuration. If you lose GUI access, boot into recovery mode or use a live USB to fix the settings.
  2. Where does NetworkManager store connection profiles? NetworkManager stores connection profiles in /etc/NetworkManager/system-connections/ as keyfile-format files. You can view and edit these files directly, though using nmcli or the GUI is recommended to avoid syntax errors.
  3. How do I revert to DHCP after setting a static IP? Using nmcli, run sudo nmcli connection modify "netplan-ens18" ipv4.method auto and then sudo nmcli connection up "netplan-ens18" (replace with your connection name). In GNOME Settings, simply change the IPv4 method back to “Automatic (DHCP)” and click Apply.
  4. Can I assign multiple static IP addresses to one interface? Yes. With nmcli, use a comma-separated list in the ipv4.addresses field or use the +ipv4.addresses syntax to append additional addresses. This is useful for hosting multiple services or virtual hosts on the same machine.