Configuring Static IP Address on Ubuntu 22.04

While DHCP automatically assigns IP addresses in most networks, certain scenarios like running servers or enabling port forwarding require a static IP configuration. This guide demonstrates how to set a static IP address on Ubuntu 22.04 using the graphical NetworkManager TUI tool.

Note: Ensure your virtual machine uses bridged networking mode for this configuration.

  1. Check Current Network Settings

First, verify your current IP address. If the ifconfig command is not available, install the network tools package:

sudo apt update && sudo apt install net-tools

Run ifconfig to view your current IP address. Note this address to avoid conflicts when setting a static IP.

  1. Identify Gateway and Subnet Mask

Use the following command to find your gateway and subnet mask:

route -n

The gateway appears under the "Gateway" column, and the subnet mask under "Genmask." A common subnet mask like 255.255.255.0 corresponds to a /24 prefix.

  1. Choose DNS Servers

Select DNS servers from the list below:

  • 114 DNS: 114.114.114.114, 114.114.115.115
  • AliDNS: 223.5.5.5, 223.6.6.6
  • Google DNS: 8.8.8.8, 8.8.4.4
  1. Configure Static IP via NetworkManager TUI

Launch the text-user interface with:

sudo nmtui

Navigate using arrow keys and Enter:

  1. Select Edit a connection
  2. Choose your network interface and press Edit
  3. Change IPv4 configuration from Automatic to Manual
  4. Fill in:
    • IP address (e.g., 192.168.1.100/24)
    • Gateway address
    • DNS servers (comma-separated)
  5. Select OK to save
  6. Exit nmtui and reboot the system

After reboot, your Ubuntu system will use the configured static IP address.

Tags: Ubuntu Static IP networkmanager Linux networking IP configuration

Posted on Sat, 27 Jun 2026 16:50:54 +0000 by Nolan