- 1 1. Introduction
- 2 2. How Ubuntu Network Configuration Works
- 3 3. How to Connect to a Network on Ubuntu
- 4 4. How to Configure a Static IP Address
- 5 5. How to Change DNS Servers
- 6 6. How to Configure VPN Connections
- 7 7. Common Network Issues and Solutions
- 8 8. FAQ About Ubuntu Network Configuration
- 9 9. Summary
1. Introduction
When Do You Need Network Configuration on Ubuntu?
Ubuntu is a popular Linux distribution widely used for everything from desktop environments to server operations. In most cases, network settings are configured automatically, but there are many situations where manual network configuration is required.
For example:
- Setting a static IP address when operating as a server
- Manually specifying DNS servers
- Using special network configurations such as VPNs
- Configuring networks from the CLI in environments without a GUI
Is Ubuntu Network Configuration Complicated?
In older versions of Ubuntu, editing the /etc/network/interfaces file was common. Today, Netplan is the standard configuration method, and NetworkManager is widely used in GUI environments.
As a result, many users now wonder which configuration method they should use.
- Beginners who want easy GUI-based configuration
- Intermediate and advanced users who prefer command-line control
- Administrators who want minimal configurations for servers or cloud environments
Choosing the appropriate method based on your needs is essential.
What You Will Learn in This Article
This article provides a beginner-friendly yet comprehensive explanation of Ubuntu network configuration, covering:
- Both GUI (NetworkManager) and CLI (Netplan, nmcli) configuration methods
- Wired LAN and Wi-Fi connection procedures
- How to configure static IP addresses
- DNS server settings and VPN connections
- Common network troubleshooting techniques
- Frequently asked questions about network configuration
By reading this guide, you will eliminate uncertainty about Ubuntu network settings and gain the confidence to configure networks according to your specific use case.
2. How Ubuntu Network Configuration Works
Basic Network Management Architecture in Ubuntu
In Ubuntu, network configuration and management are handled through NetworkManager or Netplan. The tool used depends on the Ubuntu version and whether the system is a desktop or server environment.
NetworkManager Is Standard in Desktop Environments
GUI-enabled versions such as Ubuntu Desktop (e.g., Ubuntu 22.04 LTS) use NetworkManager to manage network settings. It provides a graphical interface that allows even beginners to configure networks intuitively.
NetworkManager offers features such as:
- Automatic wired and wireless connections
- Manual IP address configuration
- DNS and proxy management
- VPN connection management
CLI tools such as nmcli and nmtui are also available, allowing flexible configuration even when a GUI is not accessible.
Netplan Is Used for Server Environments
Ubuntu Server and other GUI-less configurations use Netplan, a modern network configuration system. Netplan stores configuration in YAML files and applies them using netplan apply.
Netplan was introduced for reasons such as:
- Centralized and manageable configuration files
- Excellent compatibility with automation tools like Ansible
- Strong integration with systemd for modern system architectures
Netplan can switch between underlying renderers such as NetworkManager and systemd-networkd, allowing flexible behavior depending on the environment.
/etc/network/interfaces Is Deprecated
The /etc/network/interfaces file previously used for network configuration is now deprecated in most Ubuntu environments.
It is only used in older versions (Ubuntu 16.04 and earlier) or in special cases. Today, Netplan YAML configuration files (e.g., /etc/netplan/01-netcfg.yaml) are the standard.
3. How to Connect to a Network on Ubuntu
There are two main ways to connect to the internet on Ubuntu: using GUI tools or using the command line (CLI). This section explains both methods for wired LAN and Wi-Fi connections.
Network Connections Using the GUI (NetworkManager)
Wired LAN Connection
Wired LAN connections are usually detected and connected automatically when a cable is plugged in. To manually configure the IP address, follow these steps:
- Click the network icon in the top-right corner
- Select “Wired Connected” → “Settings”
- Open the “IPv4” tab
- Change “Automatic (DHCP)” to “Manual”
- Enter the IP address, subnet, gateway, and DNS
- Save and apply the settings
Connecting to Wi-Fi
Connecting to Wi-Fi is straightforward:
- Click the network icon
- Select a Wi-Fi network from the available list
- Enter the password and connect
Network Connections Using the CLI
In server environments or when accessing systems via SSH, network configuration must be done from the command line. The primary tool used here is nmcli.
Checking and Enabling Wired Connections
nmcli device statusnmcli device connect enp0s3Connecting to Wi-Fi
nmcli device wifi list
nmcli device wifi connect "SSID" password "password"Checking Connection Status
nmcli connection show --activeKnowing both GUI and CLI methods allows you to handle any Ubuntu environment with confidence.
4. How to Configure a Static IP Address
When operating Ubuntu as a server or building a specific network environment, configuring a static IP address is often required. This section explains both GUI-based (NetworkManager) and CLI-based (Netplan) methods.
Configuring a Static IP Using the GUI (NetworkManager)
In Ubuntu desktop environments, you can change network settings graphically. Follow the steps below to configure a static IP address.
Steps
- Click the network icon in the top-right corner
- Select “Settings” or the connected network
- Switch to the “IPv4” tab
- Change “Automatic (DHCP)” to “Manual”
- Enter the following information in the “Addresses” section:
- IP Address (e.g., 192.168.1.100)
- Netmask (e.g., 255.255.255.0)
- Gateway (e.g., 192.168.1.1)
- If necessary, specify DNS servers (e.g., 8.8.8.8)
- Click “Save” and reconnect
To apply the settings, either turn the network connection off and on again or reboot the system.
Configuring a Static IP Using the CLI (Netplan)
In GUI-less environments such as Ubuntu Server, Netplan is used for configuration. You define the settings in a YAML file and apply them using a command.
1. Check the Configuration File Location
The configuration file is usually located at one of the following paths:
/etc/netplan/00-installer-config.yaml/etc/netplan/01-netcfg.yaml
2. Example YAML Configuration
network:
version: 2
renderer: networkd
ethernets:
enp0s3:
dhcp4: no
addresses:
- 192.168.1.100/24
gateway4: 192.168.1.1
nameservers:
addresses: [8.8.8.8, 1.1.1.1]Note:
enp0s3varies depending on the environment. Check it using theip acommand.
3. Apply the Configuration
sudo netplan applyVerification and Troubleshooting
After applying the configuration, verify it with the following command:
ip aIf the network does not connect, test connectivity to the gateway or external DNS using:
ping 8.8.8.85. How to Change DNS Servers
If your internet connection is unstable or name resolution is slow, reviewing your DNS settings can help. In corporate or privacy-focused environments, you may also need to specify custom DNS servers.
Specifying DNS Servers Using the GUI
Follow these steps in Ubuntu Desktop:
Steps
- Click the network icon in the top-right corner
- Open “Settings” or the connected Wi-Fi/Wired network
- Select the “IPv4” or “IPv6” tab
- Manually enter DNS addresses (e.g.,
8.8.8.8, 1.1.1.1) - Disable “Automatic DNS” if applicable
- Save and reconnect the network
After applying the settings, verify DNS resolution with:
dig www.google.comor
systemd-resolve --statusChanging DNS Using the CLI (Netplan)
1. Open the Configuration File
sudo nano /etc/netplan/01-netcfg.yaml2. Example DNS Configuration
network:
version: 2
renderer: networkd
ethernets:
enp0s3:
dhcp4: no
addresses:
- 192.168.1.100/24
gateway4: 192.168.1.1
nameservers:
addresses:
- 8.8.8.8
- 1.1.1.13. Apply the Settings
sudo netplan apply4. Verify DNS Status
resolvectl statusor
cat /etc/resolv.confNote: resolv.conf is a symbolic link. Direct editing is not recommended. Always configure DNS via Netplan or NetworkManager.

The Relationship Between systemd-resolved and DNS
Ubuntu uses systemd-resolved to handle DNS resolution, and /etc/resolv.conf is generated by this service.
You can restart it with:
sudo systemctl restart systemd-resolved6. How to Configure VPN Connections
VPN connections are often required for secure access to corporate networks, protection on public Wi-Fi, or bypassing regional restrictions.
Configuring OpenVPN via the GUI (NetworkManager)
Install Required Packages
sudo apt update
sudo apt install network-manager-openvpn-gnomeRebooting after installation is recommended.
Configuration Steps
- Click the network icon → “VPN Settings” or “Add VPN”
- Select “OpenVPN” and click “Create”
- Enter the provided VPN details:
- Server address
- Authentication method
- Certificates and keys if required
- Configure proxy or DNS if needed
- Save and activate the connection
A key icon appears when the VPN is successfully connected.
Configuring L2TP/IPsec via the GUI
Install Additional Packages
sudo apt install network-manager-l2tp-gnomeReboot to enable the L2TP option.
Steps
- Add a VPN and select “L2TP”
- Enter the server address, username, and password
- Open “IPsec Settings” and enter the pre-shared key
- Review advanced options such as MPPE
- Save and connect
Configuring OpenVPN via the CLI
1. Install OpenVPN
sudo apt install openvpn2. Connect Using a Configuration File
sudo openvpn --config your-config.ovpnTroubleshooting VPN Connections
- Verify server address and port
- Check firewall settings (
ufw) and ISP restrictions - Ensure certificates are correctly placed
- Review logs using
journalctl -xeor/var/log/syslog
7. Common Network Issues and Solutions
Even with proper configuration, issues such as no internet access or missing Wi-Fi networks can occur.
Basic Connectivity Checks
1. Hardware Verification
- Ensure LAN cables are connected
- Confirm wireless adapters are enabled
nmcli device status2. IP Address Assignment
ip a3. Connectivity Testing
ping 192.168.1.1ping 8.8.8.8Wi-Fi Not Detected or SSID Missing
lshw -C networksudo ubuntu-drivers devicessudo apt install [recommended-driver]DNS Resolution Issues
If IP connectivity works but domain names fail, DNS settings are likely misconfigured.
Changes Not Applied
sudo netplan applysudo systemctl restart NetworkManager8. FAQ About Ubuntu Network Configuration
Q1: Wi-Fi Does Not Appear on Ubuntu. What Should I Do?
A: Check device recognition and install the recommended driver using ubuntu-drivers.
Q2: I Configured a Static IP but Cannot Connect to the Internet.
A: Verify gateway, DNS, subnet prefix, and ensure netplan apply was executed.
Q3: Can Network Configuration Be Done Using CLI Only?
A: Yes. Use nmcli and netplan depending on the environment.
Q4: Is Reboot Required to Apply Changes?
A: Not necessarily. Reconnect the network or use netplan apply.
Q5: How Can I Reset Network Settings?
nmcli connection show
nmcli connection delete <connection-name>9. Summary
Ubuntu network configuration offers multiple approaches depending on your environment and use case.
Key Takeaways
- GUI-based configuration using NetworkManager
- CLI-based configuration using nmcli and Netplan
- Static IP and DNS customization
- VPN setup and troubleshooting
- Practical diagnostics and FAQs
Choose the Right Method for Your Environment
| Use Case | Recommended Method |
|---|---|
| Desktop usage | GUI (NetworkManager) |
| Server / Cloud | CLI (Netplan) |
| Remote management | SSH + nmcli / YAML |
| Security-focused setups | VPN + Manual DNS |
Stable Networking Improves Productivity
Ubuntu’s flexibility allows powerful customization, but incorrect settings can cause connectivity issues. Use this guide to eliminate uncertainty and confidently manage your network.
This concludes the complete guide to Ubuntu network configuration.



