Setting up Wi-Fi in Ubuntu: From Basic Connections to Troubleshooting

Connecting to Wi-Fi in Ubuntu seems like a simple task until you encounter networks missing from the list, constant connection drops, or authentication errors. Unlike Windows or macOSWhile drivers for most adapters are installed automatically, Linux distributions often require manual configuration. This article will help you figure out why your Ubuntu 22.04 or 24.04 LTS doesn't see the network, how to install proprietary drivers for Broadcom, Realtek or Intel, and what to do if the password is correct, but the connection still drops.

We will consider not only the standard method through the graphical interface NetworkManager, but also alternative methods: setting up via the terminal using nmcli, manual editing of configuration files in /etc/netplan/, as well as diagnosing problems with the help of iwconfig, dmesg And journalctlWe will pay special attention to typical errors such as "Activation of network connection failed" or "No Wi-Fi Adapter Found", and ways to eliminate them without reinstalling the system.

If you use Ubuntu Server If you don't have a graphical shell or encountered a problem after a kernel update, this article will provide solutions for these cases as well. And for those who prefer visual tools, we'll compare the capabilities of the standard NetworkManager and alternative Wicd — a network manager that sometimes copes better with unstable connections.

1. Checking hardware compatibility: identifying the Wi-Fi adapter

Before setting up a connection, you need to make sure that the system actually "sees" your Wi-Fi adapter. Ubuntu This is done through the terminal - no graphical utilities will provide such complete information.

Open Terminal (Ctrl+Alt+T) and run the command:

lspci -knn | grep -iA3 net

This command will list all network devices, including wired and wireless. Look for lines mentioning Network Controller or keywords like Wireless, Wi-Fi, 802.11For example, for the adapter Intel AX200 the output will be like this:

03:00.0 Network controller [0280]: Intel Corporation Wi-Fi 6 AX200 [8086:2723] (rev 1a)

Subsystem: Intel Corporation Wi-Fi 6 AX200NGW [8086:0024]

Kernel driver in use: iwlwifi

Kernel modules: iwlwifi

If there is no mention of Wi-Fi in the output, try a different command for USB adapters:

lsusb

Here you will find devices with names like Realtek RTL8188EU or TP-Link TL-WN725NPlease pay attention to the identifiers. ID (For example, 0bda:8179) - they will be useful for searching for drivers.

⚠️ Attention: If none of the commands show the Wi-Fi adapter, the problem may be with the physical connection (for example, a disconnected antenna in a laptop) or with the BIOS/UEFI, where the wireless module is disabled at the hardware level. Check the BIOS settings (section Advanced → Onboard Devices) and make sure the parameter is like Wireless LAN or WLAN Radio installed in Enabled.

For convenience, we'll summarize popular adapters and their drivers in a table:

Manufacturer Adapter model Driver in Ubuntu Requires manual installation?
Intel AX200, AX210, 8265, 7265 iwlwifi No (included in the kernel)
Broadcom BCM4313, BCM4322, BCM4352 b43 or wl Yes (proprietary) wl)
Realtek RTL8188EU, RTL8192EU, RTL8821CE rtl8xxxu or rtl8821ce Often yes (especially for RTL88x2)
Qualcomm Atheros AR9285, AR9485, QCA9377 ath9k or ath10k No (usually supported)
📊 What Wi-Fi adapter does your device use?
Intel
Broadcom
Realtek
Qualcomm Atheros
Other/I don't know

2. Installing drivers: from standard to proprietary

If your adapter is detected, but Wi-Fi does not work, the problem is most likely with the drivers. Ubuntu By default, it uses open-source drivers, which don't always work reliably with proprietary hardware (especially with Broadcom And Realtek). Let's consider two scenarios: installing drivers through repositories and manual compilation.

2.1. Drivers from official repositories

For most adapters, installing packages from standard sources is sufficient. Open a terminal and run:

sudo apt update

sudo apt install firmware-iwlwifi firmware-realtek firmware-b43-installer

This command will install the proprietary software for Intel, Realtek And BroadcomAfter installation, reboot the system:

sudo reboot

For adapters Broadcom a proprietary driver may be required wl. Install it like this:

sudo apt install broadcom-sta-dkms

Then disable the conflicting modules:

sudo modprobe -r b44 b43 b43legacy ssb brcmsmac bcma

sudo modprobe wl

2.2. Manual driver installation (for advanced users)

If your adapter is not supported by standard packages (eg. Realtek RTL8821CE or new models Mediatek), you will have to compile the driver from source. Let's take this as an example. RTL8821CE:

  1. Install dependencies:

    sudo apt install git build-essential dkms linux-headers-$(uname -r)
  2. Clone the driver repository:

    git clone https://github.com/tomaspinho/rtl8821ce.git
  3. Compile and install:

    cd rtl8821ce
    

    chmod +x dkms-install.sh

    sudo ./dkms-install.sh

  4. Reboot the system.

⚠️ Attention: Manually compiling drivers may cause conflicts with future kernel updates. If Wi-Fi stops working after upgrading your system, repeat the driver installation process or use a tool. dkms for automatic recompilation when updating the kernel.

For adapters Mediatek (For example, MT7921) kernel version may be required 5.12+Check your version:

uname -r

If the version is lower 5.12, update the kernel via Mainline Kernel Installer or install Ubuntu 22.04.3+, where the default kernel is newer.

☑️ Checking driver installation

for mistakes
Completed: 0 / 5

3. Connecting to Wi-Fi via a graphical interface

If the driver is installed correctly, you can connect to the network via the standard NetworkManagerThis method is suitable for most users. Ubuntu Desktop.

  1. Click on the network icon in the upper right corner of the panel (next to the clock).

  2. Select the desired network from the list. If it is not there, click Wi-Fi Not ConnectedSelect Network.

  3. Enter your password and click Connect.

If the network is secure WPA3, and your adapter or router does not support it, try temporarily switching the router to WPA2-PSK (in the router settings, section Wireless Security).

For hidden networks (Hidden SSID):

  1. Click Wi-Fi Settings (or Edit Connections in older versions).

  2. Click Add → select Wi-Fi.

  3. In the field SSID enter the network name in Security Select the encryption type, enter the password.

  4. Save and connect.

⚠️ Attention: If an error appears after entering the password "Activation of network connection failed", check the password's case (Linux is case-sensitive!) and make sure the MAC address filter isn't enabled in your router settings. Also, try disabling IPv6 in the connection properties (in NetworkManager go to IPv6 SettingsDisabled).

To diagnose connection problems, use:

journalctl -u NetworkManager --no-pager | grep -i wifi

This command will show logs NetworkManager, where you can find the reason for the failure (for example, an incorrect password or problems with DHCP).

4. Setting up Wi-Fi via the terminal (nmcli and netplan)

The graphical interface is not always available (for example, on Ubuntu Server or with a remote connection). In such cases, the configuration is carried out through the terminal using nmcli or netplan.

4.1. Connecting using nmcli

nmcli - is a console tool for management NetworkManagerTo connect to the network:

  1. View the list of available networks:

    nmcli dev wifi list
  2. Connect to the network (replace SSID And password):

    nmcli dev wifi connect "SSID" password "password"
  3. For hidden networks, add a flag hidden yes:

    nmcli dev wifi connect "SSID" password "password" hidden yes

To save your connection to automatically connect on startup:

nmcli connection modify "SSID" connection.autoconnect yes

4.2. Configuration via netplan (for Ubuntu Server)

Netplan — a modern network configuration tool in Ubuntu, used by default in server editions. Configuration files are located in /etc/netplan/.

Sample file /etc/netplan/01-netcfg.yaml To connect to Wi-Fi:

network:

version: 2

renderer: networkd

wifis:

wlp3s0: # replace with your interface (you can find out via ip a)

dhcp4: true

access-points:

"your_ssid":

password: "your_password"

Apply changes:

sudo netplan apply
⚠️ Attention: If after application netplan If you have lost access to the server, please connect via cable or another channel (for example, IPMI) and correct the configuration. Errors in the YAML syntax (such as incorrect indentation) will cause the network to fail.

To diagnose problems with netplan use:

sudo netplan --debug apply

This command will show detailed logs of the configuration application.

How to find out the name of a network interface?

Run the command ip a or iwconfigLook for interfaces with names like wlp3s0, wlan0 or wlo1. The first two letters (wl) indicate the wireless adapter, and the numbers indicate the serial number of the device.

5. Solving common Wi-Fi problems

Even after proper setup, problems can still arise: slow speeds, frequent connection drops, or complete network failure. Let's look at common scenarios and their solutions.

5.1 Wi-Fi connects, but the internet doesn't work

  • 🔍 Check DNS: Do it ping 8.8.8.8If you have ping but can't access websites, the problem is with your DNS. Set your public DNS manually:
  • sudo nmcli connection modify "SSID" ipv4.dns "8.8.8.8,1.1.1.1"
  • 🔄 Flush your DNS cache: sudo systemd-resolve --flush-caches.
  • 📡 Check routing: ip route. If there is no default route (default via), add it:
  • sudo ip route add default via 192.168.1.1

5.2 Low speed or constant breaks

  • 📶 Change the channel on the router: In the router settings (usually 192.168.1.1) select the channel manually (for example, 6 or 11 for 2.4 GHz). Avoid automatic selection.
  • 🔗 Disable Wi-Fi power saving: Create a file /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf with the line:
  • [connection]
    

    wifi.powersave = 2

  • 🔄 Update driver: For Intel execute:
  • sudo apt install --reinstall linux-firmware

5.3. "No Wi-Fi Adapter Found" or the adapter is not detected

  • 🔧 Check RFKill blocking: Some laptops have a hardware Wi-Fi lock. Follow these steps:
  • rfkill list

    If the adapter is blocked (Soft blocked: yes), unlock:

    sudo rfkill unblock wifi
  • 🔄 Reload the kernel module: For Intel:
  • sudo modprobe -r iwlmvm iwlwifi
    

    sudo modprobe iwlwifi

  • 📥 Install firmware manually: Download the latest version from official repository and copy the files to /lib/firmware/.

If the problem persists, check if the driver conflicts with other modules. For example, for Realtek RTL8723DE may need to be disabled btcoexist:

sudo modprobe -r rtl8723de

sudo modprobe rtl8723de ant_sel=2

6. Alternative network managers: Wicd and iwd

If NetworkManager It works unstable, you can try alternative solutions: Wicd or iwd (from the developers Intel).

6.1. Installing and Configuring Wicd

Wicd — a lightweight network manager that sometimes handles unstable connections better.

  1. Delete NetworkManager (optional, but recommended to avoid conflicts):

    sudo apt purge network-manager
  2. Install Wicd:

    sudo apt install wicd wicd-gtk
  3. Launch it from the application menu or with the command:

    wicd-client

Wicd Allows you to flexibly configure connection parameters, including static routes and scripts executed upon connection.

6.2 Using iwd (for advanced users)

iwd (Wireless Daemon) - a modern replacement wpa_supplicant, optimized for working with Intel adapters. Install it like this:

sudo apt install iwd

Turn it off wpa_supplicant and turn it on iwd:

sudo systemctl disable wpa_supplicant

sudo systemctl enable iwd

sudo systemctl start iwd

To connect to the network:

sudo iwctl

station wlan0 scan

station wlan0 get-networks

station wlan0 connect "SSID"

iwd supports modern protocols like WPA3 And EAP-SIM, but may conflict with NetworkManagerUse it if you need maximum performance or work with corporate networks.

7. Optimize Wi-Fi for maximum speed

If your network is working but the speed is slower than expected, try the following settings to improve performance.

7.1 Choosing the Right Standard (802.11ac vs 802.11n)

Modern adapters support standards 802.11ac (Wi-Fi 5) and 802.11ax (Wi-Fi 6), but by default they can work in compatibility mode with 802.11nTo force it to turn on 802.11ac:

  1. Check the current mode:

    iw list | grep -A 10 "Supported interface modes"
  2. If the adapter supports AC, but it works in mode N, set the desired mode:

    sudo iw dev wlan0 set type managed
  3. Enable the mode in your router settings. 802.11ac only (if all devices support it).

7.2. Configuring MTU and TCP/IP parameters

Sometimes low speed is due to packet fragmentation. The optimal value MTU for most networks - 1500, but in some cases (for example, when using a VPN) it needs to be reduced.

Check the current value:

ip link show wlan0

If you need to change (for example, to 1472):

sudo ip link set wlan0 mtu 1472

To make the change permanent, add the line to /etc/network/interfaces:

mtu 1472

7.3 Disabling IPv6 (if not used)

IPv6 can slow down your connection if your network doesn't support it. Disable it for Wi-Fi:

sudo nmcli connection modify "SSID" ipv6.method disabled

Or globally for all connections:

echo "net.ipv6.conf.all.disable_ipv6=1" | sudo tee -a /etc/sysctl.conf

echo "net.ipv6.conf.default.disable_ipv6=1" | sudo tee -a /etc/sysctl.conf

sudo sysctl -p

7.4 Prioritizing Wi-Fi over Ethernet

If your device is connected via both cable and Wi-Fi, Ubuntu may use Ethernet by default. To prioritize Wi-Fi:

sudo nmcli connection modify "Wi-Fi" connection.autoconnect-priority 10

sudo nmcli connection modify "Ethernet" connection.autoconnect-priority 5

8. Diagnostics and logs: where to look for the causes of problems

When standard methods fail, it's time to analyze the system logs. Here are the key commands and files for diagnostics.

8.1 Basic commands for diagnostics

  • 📡 Checking the adapter status: iwconfig or ip a.
  • 🔍 Kernel logs (drivers, firmware): dmesg | grep -i wifi or dmesg | grep -i firmware.
  • 📜 NetworkManager logs: journalctl -u NetworkManager --no-pager | grep -i error.
  • 🔗 Checking routing: ip route or route -n.
  • 📶 Network scan and signal strength: nmcli dev wifi list or iw dev wlan0 scan | grep SSID.

8.2. Analyzing logs for errors

Let's look at typical errors in logs and their meaning:

Error in the logs Possible cause Solution
firmware: failed to load iwlwifi-9000-pu-b0-jf-b0-XX.ucode The firmware file for the adapter is missing. Intel. Update the package linux-firmware or download the file manually from official repository.
Authentication with XX:XX:XX:XX:XX:XX timed out Incorrect password, incompatible security protocol, or MAC filtering. Check your password, change the encryption type on your router to WPA2-PSK, disable MAC filtering.
Failed to connect to nonglobal ctrl_ifname Conflict between wpa_supplicant And NetworkManager. Restart NetworkManager or remove conflicting services (sudo apt purge wpasupplicant).
Rate limited: disconnect excessive Too frequent connection attempts, the router blocks the device. Reboot your router and increase the reconnection interval in the settings. NetworkManager.

8.3. Saving logs for debugging

If the problem is complex, save the logs for further analysis:

mkdir ~/wifi_debug

dmesg > ~/wifi_debug/dmesg.log

journalctl -u NetworkManager > ~/wifi_debug/NetworkManager.log

iwconfig > ~/wifi_debug/iwconfig.log

ip a > ~/wifi_debug/ip_a.log

These files can be shared on support forums (e.g. Ask Ubuntu) to assist in diagnosis.

⚠️ Attention: If you see errors like this in the logs "regulatory domain mismatch", this means the Wi-Fi regulation country in the system settings doesn't match the actual region. Correct this by setting the correct country code:

sudo iw reg set RU # for Russia

sudo systemctl restart NetworkManager

The list of supported country codes can be viewed using the command iw reg get.

FAQ: Frequently asked questions about setting up Wi-Fi in Ubuntu

How to connect to Wi-Fi without a GUI (on the server)?

Use nmcli or netplanExample for . nmcli:

nmcli dev wifi connect "SSID" password "password"

For netplan edit the file in /etc/netplan/ and apply the changes with the command sudo netplan apply.