Ubuntu — one of the most popular operating systems based on Linux, but the setting Wi-Fi it sometimes causes difficulties, especially for users accustomed to Windows or macOS. Unlike proprietary systems, where drivers and utilities are often installed automatically, Ubuntu Manual configuration may be required, from selecting the correct network manager to installing missing drivers for the adapter.
This article will help you understand all the nuances: from basic network connection to diagnosing signal problems or hardware compatibility. We'll look at how graphical tools (NetworkManager), and console commands (nmcli, iwconfig), and we'll also give recommendations for optimizing connection speed and stability. We'll pay special attention to common errors, such as when the network is visible but doesn't connect, or when Ubuntu does not detect the adapter at all Wi-Fi.
1. Checking the presence of a Wi-Fi adapter in the system
Before setting up your connection, make sure that your Wi-Fi adapter recognized by the system. In Ubuntu This can be done in several ways:
- 🔍 Through Terminal: enter the command
lspci | grep -i networkfor wired andPCI-adapters orlsusbFor USB-modules. If the output contains lines withNetwork ControllerorWireless— adapter detected. - 🖥️ Through Graphical interface: open
Settings → About → Hardware. In the section Net Your adapter should be displayed. - 📋 Through
dmesg: teamdmesg | grep -i wifiwill show driver loading logs. Look for error messages (for example,firmware missing).
If the adapter is not displayed, the problem may be due to missing drivers or a blockage RF-kill (hardware switch Wi-Fi on a laptop). Check the lock status with the command:
rfkill list
If there is a line in the output Soft blocked: yes or Hard blocked: yes, unlock the adapter:
sudo rfkill unblock wifi
2. Connecting to Wi-Fi via the graphical interface
The easiest way to connect to the network is to use the built-in NetworkManagerThe instruction is valid for Ubuntu 22.04 LTS and newer:
- Click on the network icon in the upper right corner of the panel (the icon looks like triangle or waves).
- Select the desired network from the list. If it is not there, click
Connect to hidden network.... - Enter your password (if required) and click
Connect.
If the network is secure WPA3, and your adapter does not support it, try changing the security type on the router to WPA2-PSK (in the router settings, section Wireless Security).
Disable VPN (if used) | Make sure the router is turned on and distributing the network | Check that the password is entered correctly (case sensitive!) | Restart the adapter with the command sudo systemctl restart NetworkManager
-->
IN Ubuntu 24.04 Support for quickly switching between networks via the context menu of the network icon has been added—just click on the current connection and select another from the list without re-entering the password (if it is saved).
3. Setting up Wi-Fi via the terminal (nmcli)
If the graphical interface is not available (for example, on the server version Ubuntu), use the utility nmcliBasic commands:
- 📡 View available networks:
nmcli dev wifi list - 🔗 Network connection:
nmcli dev wifi connect "Network_Name" password "password" - 🔄 Reconnect:
nmcli con up "NetworkName" - ❌ Deleting a saved network:
nmcli con delete "NetworkName"
Network connection example MyWiFi with a password 12345678:
nmcli dev wifi connect "MyWiFi" password "12345678" ifname wlan0
To save your settings for future use, add the parameter --ask (the system will ask for confirmation to save the password).
4. Troubleshooting Wi-Fi drivers
One of the most common problems is the lack of drivers for Wi-Fi adapterSymptoms: Network not detected, adapter not showing up in lspci or marked as UNCLAIMED.
First, check your adapter model:
lspci -knn | grep -iA3 network
In the output, look for lines with Kernel driver in use And Kernel modulesIf the driver is not loaded, install it:
| Adapter manufacturer | Required driver | Installation command |
|---|---|---|
| Broadcom | bcmwl-kernel-source |
sudo apt install bcmwl-kernel-source |
| Realtek (RTL8188EU, RTL8821CE) | rtl8xxxu-dkms |
sudo apt install rtl8xxxu-dkms |
| Intel (AX200, AX210) | firmware-iwlwifi |
sudo apt install firmware-iwlwifi |
| Mediatek (MT7921) | firmware-misc-nonfree |
sudo apt install firmware-misc-nonfree |
After installation, reboot the system or restart NetworkManager:
sudo systemctl restart NetworkManager
What to do if the driver is not installed?
If the package is not in the repositories, download the driver from the manufacturer's website (for example, for Realtek from [GitHub](https://github.com)) and compile it manually. This will require the kernel headers:
sudo apt install linux-headers-$(uname -r) build-essential dkms
Afterwards, unzip the archive with the driver and follow the instructions. README (usually these are commands make And make install).
⚠️ Attention: Drivers for some adapters (for example, Broadcom BCM4313) may conflict with open alternatives (b43). Before installing the proprietary driver, remove old versions:sudo apt purge b43-fwcutter firmware-b43-installer
5. Optimize Wi-Fi speed and stability
If Wi-Fi If the app is running slowly or crashing frequently, try the following settings:
- 📶 Change the channel on your router: use
5 GHzfor less interference (but smaller coverage area) or2.4 GHzfor better penetration through walls. Channels1,6,11on2.4 GHzleast overloaded. - 🔧 Disable adapter power saving: create a file
/etc/NetworkManager/conf.d/default-wifi-powersave-on.confwith a line[connection] wifi.powersave = 2and restartNetworkManager. - 🔄 Update your router firmware: outdated firmware may cause compatibility issues with Ubuntu.
- 🛡️ Check your settings
MTU: If packets are fragmented, reduceMTUto1400:sudo ifconfig wlan0 mtu 1400
To diagnose speed use iwconfig And ping:
iwconfig wlan0 | grep "Bit Rate"
ping -c 10 8.8.8.8
If your ping is high (>100 ms) or packets are being lost, the problem may be interference or a weak signal. Use the utility wavemon to analyze the signal level:
sudo apt install wavemon
sudo wavemon
6. Setting up automatic connection and network priorities
To Ubuntu automatically connect to the preferred network, adjust the priorities in NetworkManager:
- Open the network settings via the icon in the panel.
- Select
Network Settings → Wi-Fi. - Click on the gear next to the desired network.
- Enable the option
Automatically connect to this network. - To change the priority, drag the network to the top of the list in the section
Well-known networks.
The priority is set via the terminal using the command:
nmcli con mod "NetworkName" connection.autoconnect-priority 10
The higher the number, the higher the priority. To disable auto-connection:
nmcli con mod "Network_Name" connection.autoconnect no
⚠️ Warning: If you usenetplan(for example, in Ubuntu Server), automatic connection is configured in the file/etc/netplan/01-netcfg.yaml. Add parameteraccess-pointswith indicationpasswordAndhidden: truefor hidden networks.
7. Diagnostics and troubleshooting
If Wi-Fi If it doesn't work despite all your efforts, please follow the diagnostic steps below:
- Check the physical connection: Make sure that the adapter (especially USB) is tightly connected. For PCIe- check if the card module has come out of the slot.
- Restart the network:
sudo systemctl restart systemd-networkdsudo systemctl restart NetworkManager - Check the logs:
journalctl -u NetworkManager --no-pager | grep -i wifiLook for errors like
authentication failedorassociation rejected. - Reset network settings:
sudo nmcli networking offsudo nmcli networking on
Typical errors and solutions:
| Error | Possible cause | Solution |
|---|---|---|
Device not managed |
NetworkManager does not manage the interface. | Edit /etc/NetworkManager/NetworkManager.conf, add [ifupdown] managed=true |
No Wi-Fi Adapter Found |
The driver is not loaded or the adapter is disabled. | Check it out rfkill and install the driver (see section 4) |
Connection activated, but no IP address |
DHCP issues on router | Set up a static IP or restart DHCP: sudo dhclient -r wlan0; sudo dhclient wlan0 |
What should I do if Wi-Fi stops working after updating the kernel?
After updating the kernel (sudo apt upgrade) it may be necessary to recompile the drivers (for example, for Realtek). Perform:
sudo dkms install -m {driver_name} -v {version}
If it doesn't help, roll back to the previous kernel via GRUB (select it in the boot menu Advanced options for Ubuntu).
FAQ: Frequently asked questions about setting up Wi-Fi in Ubuntu
Why can't Ubuntu see my Wi-Fi network, even though other devices can?
Possible reasons:
- The adapter does not support the network standard (for example, the router only works in the mode
802.11ax, and your adapter is802.11n). - The router settings have a filter enabled.
MAC address. - The network channel is higher
11(in some countries channels12-14prohibited).
Solution: Check your router settings or update your adapter driver.
How to connect to a hidden Wi-Fi network in Ubuntu?
Via the graphical interface:
- Click on the network icon →
Connect to hidden network.... - Enter the network name (
SSID) and password.
Via terminal:
nmcli dev wifi connect "Network_Name" password "password" hidden yes
Can Ubuntu be used as a Wi-Fi hotspot?
Yes, for this you need to install ap-hotspot:
sudo apt install ap-hotspot
sudo ap-hotspot start
Or use create_ap:
git clone https://github.com/oblique/create_apcd create_ap
sudo make install
sudo create_ap wlan0 eth0 MyHotspot MyPassPhrase
Where wlan0 — interface Wi-Fi, eth0 — an interface with Internet access (if an Internet gateway is needed).
How to reset all network settings in Ubuntu?
Delete all saved connections and reset NetworkManager:
sudo rm /etc/NetworkManager/system-connections/*
sudo systemctl restart NetworkManager
For a complete reset (including netplan):
sudo apt purge network-manager netplan.iosudo apt install network-manager netplan.io
sudo systemctl restart systemd-networkd
Why is Wi-Fi slow only in Ubuntu, but fine in Windows?
Possible reasons:
- Driver in Ubuntu uses an outdated firmware version.
- Adapter power saving is enabled (see section 5).
- Conflict with
IPv6(disable it in connection settings).
Solution: Update the driver and firmware, check the settings MTU.