The Ubuntu operating system has long established itself as a stable and secure platform for daily work, but the initial network connection setup process can raise questions for users switching from other systems. Unlike Windows, where drivers are often installed automatically from Microsoft's extensive databases, Linux distributions sometimes require manual intervention or an understanding of the network manager architecture. This guide will help you quickly set up a wireless connection using both the graphical interface and the command line.
Modern versions of the distribution, such as 22.04 LTS or 24.04, feature powerful network management tools that make the connection process intuitive. However, specific hardware or remote server management require knowledge of console utilities. We'll cover all the nuances: from simply selecting a network in the menu to complex static IP address settings and troubleshooting wireless adapter driver issues.
Checking hardware and drivers
Before attempting to set up a connection, you need to ensure that the operating system physically detects your wireless module. Users often encounter a situation where the list of available networks is empty, and the cause is not the router, but the lack of a proprietary driver. Ubuntu uses open-source drivers by default, which support most devices, but some Broadcom chipsets or older Realtek models require additional packages.
To diagnose the hardware status, open a terminal and enter the command lspci | grep -i network for desktop PCs or lsusb For USB adapters. If the device appears in the list but the network isn't working, the problem is most likely software-related. In some cases, you may need to disable Secure Boot in the BIOS, as this security feature can block third-party kernel modules required for WiFi operation.
- 📡 Check if the physical WiFi switch on the laptop case or the Fn+F-key combination is turned on.
- 💻 Make sure that the wireless module is not disabled in the peripherals section of the BIOS/UEFI.
- 🔌 For USB adapters, try switching the device to a different port, preferably USB 2.0, if power issues occur.
⚠️ Note: If you're using a laptop with hybrid graphics or a specific mode, the system may power down the WiFi module to save power. Check your power settings if the connection is constantly dropping.
To install missing drivers, go to the applications menu and find the utility Programs and updatesIn the window that opens, you are interested in the tab Additional driversThe system will scan and offer available proprietary software versions for your hardware. After selecting the desired driver, click "Apply Changes" and be sure to restart your computer to activate the kernel module.
Connecting via the GNOME graphical interface
The default GNOME desktop environment in Ubuntu offers a very simple and intuitive way to connect to wireless networks. In the upper-right corner of the screen, in the system tray, there's a network icon that, when clicked, expands a menu of available connections. This is the fastest method for regular users, requiring no command-line knowledge.
Click on the network icon (usually looks like two triangles or a computer) and select Wi-FiMake sure the switch is in the "On" position. The system will automatically scan the air and after a few seconds, display a list of available access points sorted by signal strength. Find your network name (SSID) in the list and click it.
If authentication is successful, the network icon will change to an active connection symbol, and the signal strength will be displayed next to it. If the connection fails, the system will display an error message, prompting you to re-enter the password or stating that an IP address could not be obtained. In such situations, it may be helpful to try forgetting the network in the settings and reconnecting.
Configuring a network through the terminal using nmcli
For system administrators or users of server versions of Ubuntu without a graphical shell, the utility is an indispensable tool nmcli (Network Manager Command Line Interface). It allows for fine-grained management of network connections and is a standard tool in the NetworkManager ecosystem. Working with the terminal is often faster and more reliable, especially when accessing remotely via SSH.
The first step should always be to scan for available networks. Enter the command nmcli dev wifi listto see all nearby access points. You'll see a table with columns: DEVICE, SSID (network name), MODE, CHAN, RATE, SIGNAL, and SECURITY. Find your network by name and make sure the signal is strong enough (usually above 60-70%).
nmcli dev wifi connect "Your_Network_Name" password "Your_Password"
This command initiates the connection process. If the network is hidden (not broadcasting the SSID), add the flag hidden yes to the end of the command. After successful execution nmcli will create a connection profile that will automatically activate when this network appears within range. To check the connection status, use the command nmcli connection show --active.
- 🔧 To delete a network profile, use the command
nmcli connection delete "Network_Name". - 📶 To see detailed connection information, enter
nmcli device show wlan0(replace wlan0 with your interface). - 🔄 You can restart the network manager with the command
sudo systemctl restart NetworkManager.
⚠️ Note: nmcli commands are case-sensitive and quote-sensitive. If your network name contains spaces or special characters, be sure to enclose it in double quotes, otherwise the command will not execute correctly.
Manually setting a static IP address
In corporate networks or to provide access to specific resources (printers, NAS, servers), it is often necessary to use a static IP address instead of dynamically obtaining it via DHCP. In modern versions of Ubuntu (starting with 17.10), the network configuration utility Netplan, which uses YAML files to store settings. This makes configuration transparent and easily portable between systems.
Netplan configuration files are located in the directory /etc/netplan/. Usually there is a file there with a name like 01-network-manager-all.yaml or 50-cloud-init.yamlBefore making changes, create a backup copy of the file. Open the file for editing with superuser privileges using the editor. nano or vimThe YAML structure requires strict indentation (usually 2 or 4 spaces), otherwise, errors will occur when applying the configuration.
network:version: 2
renderer: NetworkManager
ethernets:
eth0:
dhcp4: no
addresses:
- 192.168.1.50/24
routes:
- to: default
via: 192.168.1.1
nameservers:
addresses: [8.8.8.8, 1.1.1.1]
In the example given we are setting a static address 192.168.1.50 with a mask /24 (which corresponds to 255.255.255.0), default gateway 192.168.1.1 and Google and Cloudflare DNS servers. Please note that for WiFi interfaces, the section may be called wifis instead of ethernets, and you must specify the SSID name and password in the corresponding fields if Netplan rather than NetworkManager takes control.
| Parameter | Value in the example | Description |
|---|---|---|
| addresses | 192.168.1.50/24 | Static IP and subnet mask |
| via | 192.168.1.1 | Gateway (router) IP address |
| nameservers | 8.8.8.8 | Primary DNS server |
| renderer | NetworkManager | Backend for network management |
After making changes, you need to apply the configuration with the command sudo netplan applyIf the file syntax is correct, the settings will take effect immediately. If you make a mistake in the indentation or values, the system will display an error message and the configuration will not be applied, allowing you to quickly correct the error without losing network access.
What should I do if I lose internet access after using Netplan Apply?
If you lose network access after applying the settings, check the /var/log/syslog log file or use the journalctl -u NetworkManager command. Most often, the error is caused by an incorrect gateway or a subnet mask that doesn't match the actual network structure. Return to editing the file and check the indentation.
Diagnosing and resolving connection problems
Even with proper configuration, situations may arise where the connection is unstable or completely lost. Log analysis should be your first diagnostic tool. In Ubuntu, the NetworkManager daemon stores the most basic information about network events. You can view its logs in real time using the command journalctl -u NetworkManager -f, starting the connection process in a separate window.
A common issue is an address conflict or incorrect DNS settings, where the network is formally connected, but websites don't open. Check the IP address with the command ip addr showIf the address starts with 169.254.x.x, this means the DHCP server didn't respond, and the system assigned itself an address from the APIPA range. In this case, you should check the cable (if it's an Ethernet modem), the router's status, or try manually setting the DNS in the connection settings.
- 🔍 Use the command
ping 8.8.8.8to check the physical presence of the Internet (ICMP packets). - 🌐 Complete
ping google.comto check the operation of DNS name resolution. - 📡 Team
iwconfigwill show the current connection speed and signal level in dBm.
⚠️ Note: If you see a message that the network requires you to log in via the web interface (Captive Portal), your browser may not open the authorization page automatically. Try going tohttp://neverssl.comorhttp://captive.apple.comto initiate a redirect to a password entry or terms and conditions acceptance page.
Another common cause of problems is power-saving settings that turn off the WiFi adapter when idle. To disable this feature, create a configuration file. /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf and set the value wifi.powersave V 2 (which means disabling power saving). This can significantly improve connection stability on some laptops.
☑️ WiFi Diagnostics
Wireless Security in Linux
Security is critical when using public WiFi networks. When connecting to open hotspots in cafes or airports, all your traffic can be intercepted by attackers. In Ubuntu, we recommend using a VPN connection to protect your data. The built-in NetworkManager supports OpenVPN, WireGuard, and IKEv2 protocols, allowing you to create a secure tunnel to your trusted server.
It is also worth paying attention to the firewall settings. UFW (Uncomplicated Firewall), which may not be enabled by default in Ubuntu. Enabling the firewall blocks unwanted incoming connections, leaving only the necessary ports open. This is less critical for a home network, but for working in public places, installing a profile public is a mandatory protective measure.
To enhance privacy, you can configure the use of random MAC addresses during scanning and connection. This prevents device movements from being tracked by the unique network card ID. This is configured in the NetworkManager configuration file /etc/NetworkManager/NetworkManager.conf or via the graphical interface in the WiFi connection properties on the "Privacy" tab.
Regular system updates ensure you receive the latest security patches for network stacks and drivers. Team sudo apt update && sudo apt upgrade should be performed regularly, as vulnerabilities in WPA2/WPA3 encryption protocols are discovered periodically, and developers promptly release patches.
Frequently Asked Questions (FAQ)
Why can't Ubuntu see my WiFi adapter?
Most likely, the driver for your wireless card model is missing. Check the command output. lspci or lsusbIf the device is detected but does not work, go to "Programs and Updates" -> "Additional Drivers" to install proprietary software. Some Broadcom models require a package. bcma or bcmwl-kernel-source.
How to save a WiFi password for automatic connection?
When connecting for the first time via the graphical interface, make sure the "Connect automatically" box is checked. In the terminal, enter the command nmcli Automatically saves your profile. Passwords are stored encrypted in the user's keyring and are only accessible after logging in.
Is it possible to share WiFi from an Ubuntu laptop?
Yes, Ubuntu supports hotspot mode. In the GUI, click the network icon, select "Wi-Fi settings," and enable "Use as hotspot." In the terminal, this can be done via nmcli device wifi hotspot.
Where can I find connection error logs?
The main NetworkManager event log is located in the system log. Use the command journalctl -u NetworkManager to view history or add a flag -f for real-time monitoring. Useful information can also be found in /var/log/syslog.
How to reset all network settings?
For a complete reset, you can delete the NetworkManager configuration files in the folder /etc/NetworkManager/system-connections/ (caution required) or simply forget all networks through the settings. Deleting the file also helps. /var/lib/NetworkManager/NetworkManager.state and restart the service.