Network Configuration

Network Configuration

Bitnesia Aug 17, 2026 6 ID

After understanding how to view network configuration, now you will learn how to configure it. On Ubuntu 26.04 LTS and Fedora Workstation 44 desktops, network configuration is generally handled by NetworkManager, which can be accessed through both graphical and command‑line interfaces. This chapter covers NetworkManager, using nmcli and nmtui, network configuration files, and how to enable and disable interfaces.

NetworkManager: The Default Network Manager

NetworkManager is the default network manager on Ubuntu 26.04 LTS and Fedora Workstation 44. NetworkManager manages all network connections, whether Wi‑Fi, Ethernet, or VPN, and makes it easy to switch between networks.

Configuration via GUI (Settings > Network)

The easiest way to configure networking is through the Settings application. Open Settings, then select the Network panel. From there you can see the list of available connections, connect to Wi‑Fi, and configure Ethernet settings. To change connection settings, click the gear icon next to the desired connection.

nmcli: Configuration from the Terminal

nmcli is the command‑line interface for NetworkManager that allows you to manage connections without a GUI.

nmcli con show: List Connections

To see the list of saved connections, use nmcli con show.

nmcli con show

This command displays the names of all connections along with their status. con here is short for connection; both can be used interchangeably, for example nmcli connection show.

nmcli con up/down: Enable/Disable Connections

To bring a connection up or down, use nmcli con up and nmcli con down.

nmcli con up "Connection Name"
nmcli con down "Connection Name"

Replace Connection Name with the name shown by nmcli con show.

Setting a Static IP with nmcli

By default, computers obtain an IP address automatically via DHCP. To set a static IP, use nmcli con mod with the ipv4.addresses, ipv4.gateway, ipv4.dns, and ipv4.method options.

sudo nmcli con mod "Connection Name" ipv4.addresses 192.168.1.100/24 ipv4.gateway 192.168.1.1 ipv4.dns "8.8.8.8 1.1.1.1" ipv4.method manual

Note that the ipv4.dns option is included here because when ipv4.method is changed to manual, NetworkManager no longer accepts automatic DNS from DHCP, so the DNS servers must be specified yourself. After changing the configuration, bring the connection back up with nmcli con up "Connection Name" to apply the changes. Static IP is useful for devices that need a fixed address, such as servers or network printers.

nmtui: TUI (Text‑Based UI) Interface

If you are working in an environment without a graphical interface, NetworkManager provides nmtui, an interactive text‑based interface that is easy to use.

nmtui

This command opens a text‑based menu where you can edit connections (including setting a static IP without having to type nmcli options one by one), activate connections, or set the hostname, all using keyboard navigation.

Network Configuration Files

Besides being managed by NetworkManager, some aspects of networking are stored in configuration files that you can view.

/etc/hosts: Local Hostname Resolution

The /etc/hosts file maps hostnames to IP addresses locally, without needing to query a DNS server.

cat /etc/hosts

This file often contains a line mapping localhost to 127.0.0.1. You can add your own lines to map other devices on the local network, for example adding 192.168.1.50 file-server so that you can type file-server instead of the IP address every time you access it.

/etc/resolv.conf: DNS Configuration

The /etc/resolv.conf file traditionally contains the addresses of DNS servers that the system uses to resolve domain names. However, on Ubuntu 26.04 LTS and Fedora Workstation 44, both distributions run the systemd-resolved service as the DNS resolver, so the contents of this file are a little different from what you might expect.

cat /etc/resolv.conf

Instead of directly showing the DNS IP of your router or ISP, /etc/resolv.conf on both distributions is usually just a symbolic link to a file managed by systemd-resolved, and its content is only one line: nameserver 127.0.0.53. This address 127.0.0.53 is not your router, but a local stub resolver running on your own computer: all applications send DNS queries there, and systemd-resolved forwards them to the actual DNS servers while also caching. This is not a misconfiguration, so do not rush to change it manually. To see the actual DNS servers your system is using, use the following command.

resolvectl status

resolvectl status displays the actual DNS servers per interface, search domains, and supported protocols (such as DNSSEC and DNS‑over‑TLS). Because this file is automatically managed by systemd-resolved working together with NetworkManager, manual changes to /etc/resolv.conf can be overwritten when the network is updated; the correct way to change DNS is through nmcli, nmtui, or Settings, as discussed earlier in this chapter.

Additional Note: Netplan Behind the Scenes (Ubuntu‑Specific)

Specifically on Ubuntu, there is one more layer working behind the scenes called Netplan, a YAML‑based network configuration system from Canonical stored in /etc/netplan/. On Ubuntu Desktop, Netplan is configured to delegate all interfaces to NetworkManager (marked by the line renderer: NetworkManager in one of its YAML files). This means that when you change a connection via nmcli, nmtui, or Settings, NetworkManager will automatically rewrite the relevant Netplan file behind the scenes. Fedora does not use Netplan; NetworkManager on Fedora stores its own connection profiles in /etc/NetworkManager/system-connections/. You do not need to manually edit Netplan files on the desktop, as they may be overwritten by NetworkManager again; this point is only important to know when you later work with Ubuntu Server, which actually uses Netplan as the primary configuration method.

Enabling/Disabling Interfaces

You can enable or disable an interface using the ip link set command.

sudo ip link set dev enp3s0 down
sudo ip link set dev enp3s0 up

The first command disables the enp3s0 interface, while the second brings it back up. Replace enp3s0 with the appropriate interface name as you saw in the previous chapter.

Note that ip link set works at the kernel level, outside of NetworkManager's awareness. Because the interface is still marked as "managed" by NetworkManager, it is possible that NetworkManager will automatically bring it back up shortly after you disable it. If your goal is to disable the connection in a way that NetworkManager recognises (for example, so that it does not automatically reconnect), use the equivalent command on the NetworkManager side:

nmcli device disconnect enp3s0

Configuring networking on Linux becomes easy thanks to NetworkManager. You can do it through Settings, nmcli, or nmtui, as needed. Through an understanding of configuration files such as /etc/hosts and /etc/resolv.conf (along with the role of systemd-resolved behind them), and how to enable interfaces, you are now ready to handle daily networking needs. In the next chapter, you will learn how to test connectivity and perform basic network troubleshooting.