How to Install and Configure Wi-Fi on Linux: A Complete Guide for Beginners and Advanced Users

Connecting to Wi-Fi on Linux is often the first challenge for newcomers switching from Windows or macOS. Unlike proprietary systems, where drivers are installed automatically, in the world of open source software, manual steps are sometimes required. But don't rush back to your familiar operating system: properly setting up Wi-Fi on Linux not only solves internet problems but also opens up powerful network diagnostic tools unavailable on other systems.

This article covers all scenarios, from basic GUI connections to manual driver installation for rare adapters. We'll explain why. Some chipsets require proprietary drivers.How to bypass MAC address blocking on public networks, and what to do if the network is visible but the connection keeps dropping. Special attention is paid to troubleshooting: you'll learn how to read system logs and test connection speed without third-party utilities.

Important: The instructions are valid for all modern distributions - Ubuntu 24.04, Debian 12, Fedora 40, Arch Linux and their derivatives (Mint, Manjaro, Pop!_OS). If you're using specialized builds for servers or embedded systems, some steps may differ.

1. Check hardware compatibility: identify your Wi-Fi adapter

Before setting up a connection, you need to make sure that your Wi-Fi adapter is supported by Linux. Most modern chipsets (Intel AX200, Qualcomm Atheros, Mediatek MT7921) work "out of the box", but some models from Broadcom or Realtek require manual installation of drivers.

To find out the adapter model, run the following in the terminal:

lspci -knn | grep -iA3 net

Or for USB adapters:

lsusb

In the output, look for lines mentioning Network controller or Wireless. For example:

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

Compare the found device ID (eg. 8086:2723 For Intel AX200) with a database of supported devices on the website Linux WirelessIf your chipset isn't there, you'll have to search for the driver manually.

2. Connecting to Wi-Fi via a graphical user interface (GUI)

The easiest way is to use the built-in desktop tools. In most distributions, this is done through NetworkManager (GNOME, KDE, XFCE) or connman (in some lightweight environments).

Instructions for Ubuntu/Linux Mint/Fedora:

  1. Click on the network icon in the taskbar (usually in the upper right corner).
  2. Select the desired network from the list.
  3. Enter your password and click Connect.

If there is no network icon or it is crossed out:

  • 🔄 Check if Wi-Fi is enabled by the hardware switch (some laptops have a separate button or combination) Fn + F2/F12).
  • ⚙️ Make sure the NetworkManager service is running:
    sudo systemctl status NetworkManager
  • 🔌 If the service is not active, start it:
    sudo systemctl start NetworkManager

The adapter is detected in the system|The NetworkManager service is running|Wi-Fi is enabled by a hardware switch|The network is visible in the list of available ones-->

For KDE Plasma the path may differ slightly: System settings → Network connections → Add new connection → Wi-FiHere you can also set up automatic connection upon boot.

3. Connecting via Terminal: Commands for Advanced Users

If the graphical interface is unavailable (for example, on a server or in a minimal installation), you can connect to Wi-Fi via the terminal. This requires utilities. iw, wpa_supplicant And dhclient.

Step 1: Check your wireless interface name:

ip a

Usually it is wlan0, wlp3s0 or something similar. Remember it.

Step 2: Enable the interface (if it is disabled):

sudo ip link set wlan0 up

Step 3: Scan available networks:

sudo iw dev wlan0 scan | grep SSID

Step 4: Connect to the network. For open networks:

sudo iw dev wlan0 connect "network_name"

For secured networks (WPA/WPA2), create a config for wpa_supplicant:

wpa_passphrase "network_name" "password" | sudo tee /etc/wpa_supplicant.conf

Then connect:

sudo wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant.conf

sudo dhclient wlan0

What should I do if dhclient doesn't provide an IP address?

If after execution dhclient wlan0 IP address is not assigned, please check:

1. Is DHCP working on the router (sometimes public networks require manual IP configuration).

2. Is there a MAC address block (try cloning the MAC of another device).

3. Is the interface name specified correctly (make sure it is wlan0, and not wlp2s0).

If the problem persists, try setting the IP manually:

sudo ip addr add 192.168.1.100/24 dev wlan0

sudo ip route add default via 192.168.1.1

(replace the addresses with those relevant to your network).

4. Installing drivers for unsupported adapters

If your Wi-Fi adapter is not detected or is unstable, the problem is most likely a missing driver. Let's consider two scenarios: proprietary drivers (e.g., for Broadcom) and open source drivers.

For Ubuntu/Debian:

  1. Update package information:
    sudo apt update
  2. Install proprietary drivers (if available for your adapter):
    sudo ubuntu-drivers autoinstall
  3. For manual installation, find the package by adapter model. For example, for Broadcom BCM43142:
    sudo apt install firmware-b43-installer

For Arch Linux/Manjaro:

sudo pacman -S linux-firmware

sudo pacman -S broadcom-wl-dkms # for Broadcom

For Fedora:

sudo dnf install broadcom-wl

After installing the driver, reboot the system or restart the kernel module:

sudo modprobe -r b43 && sudo modprobe b43

Intel|Broadcom|Realtek|Qualcomm Atheros|Mediatek|Other-->

5. Troubleshooting: Why Wi-Fi Isn't Working

If the connection is not established or is frequently disconnected, use these commands to diagnose it:

Problem Team for diagnostics What to do
The network is not visible sudo iwlist wlan0 scan Check if the adapter is turned on (rfkill list). If there is no network in the output, there is a problem with the driver or antenna.
The connection is broken dmesg | grep wlan0 Look for errors like firmware crashed - this indicates a problem with the driver.
Low speed iw dev wlan0 link Check the parameter tx bitrateIf it's below 100 Mbps, try changing the channel on your router.
IP address is not assigned sudo dhclient -v wlan0 If DHCP does not respond, check your router settings or assign an IP manually.

Common causes of problems:

  • 🚫 MAC address blocking On the router (especially on public networks). Solution: Clone the MAC address of another device or contact the administrator.
  • 🔋 Energy saving Disables the adapter. Check the settings:
    iwconfig wlan0 | grep "Power Management"

    Turn off savings:

    sudo iwconfig wlan0 power off
  • 📡 Interference on the channel. Use sudo iwlist wlan0 scanning | grep Frequencyto find a less crowded channel and change it in the router settings.

6. Setting up automatic connection at boot

To avoid entering a password every time after a reboot, set up automatic connection.

For NetworkManager:

nmcli connection modify "network_name" connection.autoconnect yes

For systemd-networkd (used in some server distributions):

  1. Create a config:
    sudo nano /etc/systemd/network/25-wireless.network
  2. Add the following (replace the details with your own):
    [Match]
    

    Name=wlan0

    [Network]

    DHCP=yes

    [Route]

    Gateway=192.168.1.1

    Metric=100

  3. Create a config for Wi-Fi:
    sudo nano /etc/wpa_supplicant/wpa_supplicant-wlan0.conf

    With contents:

    network={
    

    ssid="network_name"

    psk="password"

    }

  4. Enable and start the services:
    sudo systemctl enable wpa_supplicant@wlan0
    

    sudo systemctl start wpa_supplicant@wlan0

    sudo systemctl enable systemd-networkd

    sudo systemctl start systemd-networkd

To check automatic connection, reboot the system and run:

ping -c 4 google.com

7. Security: How to protect your connection

Wi-Fi in Linux can be configured to minimize the risk of data interception or network attacks. Here are the key recommendations:

  • 🔒 Use WPA3 Instead of WPA2, if your router supports it. Check your current protocol:
    sudo iw dev wlan0 link | grep "RSN"
  • 🕵️ Turn it off WPS on the router - this protocol is vulnerable to brute-force attacks.
  • 🔄 Change your Wi-Fi password regularly (you can automate this via cron).
  • 🛡️ Set up firewall To block unwanted connections:
    sudo ufw allow from 192.168.1.0/24 to any port 22 # Allow SSH only for the local network
    

    sudo ufw deny 111,135,137,138,139,445/tcp # Block SMB

For additional traffic protection, use VPNIn Linux it is easiest to set up WireGuard:

sudo apt install wireguard resolvconf

wg-quick up wg0 # after config setup

sudo nmap -sn 192.168.1.0/24

This command will display all active IP addresses in your subnet. Compare them to the list of known devices.

8. Alternative connection methods

If the standard methods don't work, try these options:

  • 📱 USB tethering from your smartphone. Enable modem mode on your phone and connect it via USB. In Linux, it will be detected as a network interface (usb0 or enp0s20u1).
  • 🔌 Ethernet via USB adapterIf the Wi-Fi adapter is faulty, temporarily use a wired connection via USB-to-Ethernet adapter.
  • 🔄 Bridge mode (If you have two network interfaces). Configure Wi-Fi over Ethernet or vice versa:
    sudo nmcli connection add type bridge ifname br0
    

    sudo nmcli connection add type bridge-slave ifname wlan0 master br0

    sudo nmcli connection add type bridge-slave ifname eth0 master br0

For emergency situations when you need to quickly access the Internet, you can use Bluetooth tethering. Install packages:

sudo apt install blueman bluez

Then connect your phone via Bluetooth and turn on Internet sharing.

FAQ: Frequently Asked Questions about Setting Up Wi-Fi on Linux

Why did Wi-Fi stop working after updating the kernel?

This is a typical problem with proprietary drivers (eg. Broadcom wl), which need to be recompiled after updating the kernel. Solution:

  1. Remove the old driver:
    sudo dkms remove -m broadcom-wl -v 6.30.223.271 --all
  2. Reinstall it:
    sudo dkms install -m broadcom-wl -v 6.30.223.271
  3. Reboot the system.

For Arch Linux use:

sudo pacman -S broadcom-wl-dkms

How to connect to a hidden Wi-Fi network?

Hidden networks do not broadcast their SSID, but you can connect to them manually. NetworkManager:

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

Or via the graphical interface: when adding a new connection, check the box "Connect even if the network is not broadcast."

Can you use Wi-Fi 6 (802.11ax) on Linux?

Yes, but with some caveats. Full support. Wi-Fi 6 appeared in the kernel 5.4+For stable operation:

  • Update your kernel to the latest version (eg. 6.5+).
  • Make sure your adapter supports HE (High Efficiency) - check through
    iw list | grep "HE"
  • Turn on the mode on your router 802.11ax (sometimes called Wi-Fi 6 or AX).

Please note: Some adapters (eg. Intel AX200) require firmware version iwlwifi-cc-a0-72.ucode or newer for full Wi-Fi 6 support.

How to share Wi-Fi with Linux (access point)?

To create an access point, use hostapd And dnsmasq:

  1. Install packages:
    sudo apt install hostapd dnsmasq
  2. Set up hostapd (/etc/hostapd/hostapd.conf):
    interface=wlan0
    

    driver=nl80211

    ssid=MyLinuxHotspot

    hw_mode=g

    channel=6

    wpa=2

    wpa_passphrase=mypassword

    wpa_key_mgmt=WPA-PSK

  3. Start the access point:
    sudo systemctl start hostapd

For temporary distribution you can use nmcli:

nmcli dev wifi hotspot ifname wlan0 ssid MyHotspot password "12345678"
Why is Wi-Fi speed slower on Linux than on Windows?

This may be due to:

  • Lack of support 802.11n/ac/ax in the driver. Check:
    iw list | grep "Supported interface modes"
  • Speed ​​limiting due to energy saving. Disable it:
    sudo iwconfig wlan0 power off
  • Suboptimal router settings (channel width, Wi-Fi standard).

For diagnostics use:

iw dev wlan0 station dump

Please pay attention to the parameters tx bitrate And rx bitrate.