How to Set Up Wi-Fi on Ubuntu: A Complete Guide

Modern Linux distributions, including Ubuntu, often automatically detect Wi-Fi adapters, allowing the user to connect to the network within minutes of system installation. However, reality dictates its own circumstances, and quite often owners of new laptops or specific network cards encounter a lack of wireless connection immediately after the first launch. This may be due to the absence of proprietary drivers in the kernel or specific power saving settings.

In this guide, we will cover in detail the process of diagnostics, installation of necessary components, and manual configuration of the network interface. Correct configuration Network connectivity is fundamental to the stable operation of the operating system, as many system updates and installation of additional software require an active internet connection. We'll cover both graphical methods through the standard GNOME interface and command-line utilities for advanced users.

Don't be alarmed by the black terminal screen, as the Linux command line provides much more flexible tools for network management than the graphical shell. Even if you don't have internet access on the computer itself, UbuntuThere are ways to download the necessary packages on another device and transfer them for installation. Understanding these processes will make you a confident user and allow you to solve network problems of any complexity.

⚠️ Note: Network manager interfaces and package names may differ slightly depending on the Ubuntu distribution version and the desktop environment used (GNOME, KDE, XFCE).

Network equipment diagnostics

The first step before any configuration should always be a thorough diagnostic. It's essential to accurately identify the model of your Wi-Fi adapter, as this will determine the driver selection. Linux offers a powerful utility for this purpose. lspci for devices on the PCI bus (usually built-in cards in laptops) and lsusb for external USB whistles.

Launch a terminal and enter the command to view a list of PCI devices, filtering the output by the word "Network" or "Wireless." This will show the vendor and specific chipset model. If a device is displayed but marked as "unclaimed," this is a sure sign that a driver is missing. It's also helpful to check the kernel status to see if any driver modules are loading.

lspci -k | grep -A 3 -i network

An alternative method for obtaining summary information about all network interfaces is provided by the utility nmcli, which is part of NetworkManager. It will show not only the presence of the equipment but also its current status, including the ability to control it via software switches. This is especially important if the wireless module is blocked at the software level.

  • 🔍 Use lspci for built-in maps and lsusb for external adapters.
  • 📋 Look for lines marked "Kernel driver in use" to check if the driver is active.
  • 🚫 Please note the "Soft blocked" status, which indicates a software blocking.
  • 💡 Team inxi -N Gives a brief summary of network devices if the inxi package is installed.

Installing and updating drivers

After identifying the hardware, it often turns out that proprietary drivers need to be installed for it to work correctly. Ubuntu There's a convenient "Additional Drivers" feature that automatically scans your system and suggests available software options for your hardware. This is the easiest and safest method for beginners.

To access this tool, open the application menu and find "Software & Updates." Go to the "Additional Drivers" tab and wait for the search to complete. If the system finds a suitable driver, for example, for cards Broadcom or Realtek, select it from the list, and click "Apply Changes." The system will automatically download and install the necessary components.

Manufacturer Typical driver package Status in repositories
Intel iwlwifi (in the kernel) Open, built-in
Broadcom bcmwl-kernel-source Proprietary
Realtek rtl88xxau-dkms Often requires DKMS
MediaTek mt76xx (in the kernel) Open, built-in

In situations where automatic search does not yield results, manual installation via the package manager may be required. aptOften the problem is solved by installing a meta-package linux-firmware, which contains binary firmware files for many devices. Make sure you have internet access via an Ethernet cable or USB modem before beginning the installation.

sudo apt update

sudo apt install --reinstall linux-firmware

☑️ Checking drivers

Completed: 0 / 4

Configuration via graphical interface

For most users, setting up Wi-Fi in Ubuntu It's limited to a graphical interface, which is controlled by the NetworkManager service by default. In the upper right corner of the screen is a network indicator; clicking it opens a list of available access points. This method is intuitive and doesn't require command-line knowledge.

When you select your network, the system will ask for a password. After successful authentication, the connection will be saved and will be available in the future. automatic connection This will occur when a familiar access point is detected. For more detailed configuration, such as changing DNS or setting a static IP, you need to go to the network settings section.

Open "Settings" -> "Wi-Fi" and click the gear icon next to your network or select "Identity" to edit the settings. Here you can change the addressing method from automatic (DHCP) to manual, specify DNS servers (for example, from Google or Cloudflare), and configure proxy server settings for corporate networks.

What should I do if the network does not appear in the list?

If your network is hidden (does not broadcast its SSID), you will need to select the "Connect to Hidden Network" option in the GUI and manually enter the network name (SSID) and security type.

  • 📡 The standard interface allows you to manage network priority.
  • 🔐 Saved passwords are stored in the GNOME Keyring.
  • ⚙️ IPv4 and IPv6 settings can be configured separately for each network.
  • 🔄 The Wi-Fi switch allows you to quickly turn the module on and off.

Network management via terminal (nmcli)

For system administrators and minimalism lovers, the utility is an indispensable tool nmcli (NetworkManager Command Line Interface). It allows you to perform all the same actions as the graphical shell, but with greater speed and the ability to automate. Working with nmcli requires precision in command syntax.

To connect to a Wi-Fi network, you must first enable the wireless interface if it is disabled. Then, a scan for available networks is performed. The connection command contains the network name (SSID) and password. If the network uses a hidden SSID, a flag must be added. hidden yes.

nmcli radio wifi on

nmcli dev wifi list

nmcli dev wifi connect "Network_Name" password "Your_Password"

An important feature nmcli The ability to create connection profiles is a plus. You can create a profile with specific DNS and IP addressing settings and then activate it as needed. This is especially useful for laptops used in different locations with different network requirements.

⚠️ Note: When entering passwords in the terminal via the command line, the command history may be saved in a file .bash_history. Use the option -s (secure) when entering a password to hide it while typing, or clear the history after work.

📊 Which network management method do you prefer?
GNOME graphical interface
nmcli command line
Text editor for configs
Automation scripts

Solving common problems

Even with proper configuration, Wi-Fi may become unstable or even disappear completely. One common cause is an aggressive power saving policy that disables the adapter to conserve battery life. This can be resolved by editing the NetworkManager configuration files.

You need to create or edit a configuration file and add a rule that prevents the Wi-Fi module from being powered off. After making the changes, the service needs to be restarted. It's also worth checking whether the connection is being blocked by a firewall. ufw, although by default it usually does not interfere with local traffic.

sudo nano /etc/NetworkManager/conf.d/default-wifi-powersave-on.conf

In this file the parameter wifi.powersave must be set to value 2 (which means turning off power saving), instead of the standard 3After saving the file, restart the NetworkManager service with the command sudo systemctl restart NetworkManagerThis often solves the problem of constant connection breaks.

  • 🔌 Check the physical Wi-Fi switch on the laptop case.
  • 📉 Reducing the transmitter power can improve stability in interference conditions.
  • 🛡️ The firewall should not block outgoing connections to ports 53 and 80.
  • 🔄 Rebooting the router often solves protocol compatibility issues.

Setting up a static IP address

In some cases, such as file or printer access, a computer needs a permanent IP address on the local network. Dynamic address assignment (DHCP) can change the device's address after a reboot, disrupting network connections. Setting up a static IP address solves this problem.

It's best to assign a static address in the range reserved by the router, but outside the pool of addresses assigned by DHCP, to avoid conflicts. For example, if the router assigns addresses from 100 to 200, a static address can be set in the range of 20-50. It's also important to correctly specify the gateway (usually the router's address) and DNS servers.

In the graphical interface, this is done in the IPv4 settings of the selected network. In the "Method" field, select "Manual," then add the address, netmask (usually 255.255.255.0 or /24), gateway, and DNS. In the terminal, this can be done with the command nmcli con mod, specifying the required addressing parameters.

nmcli con mod "Connection_Name" ipv4.addresses 192.168.1.50/24

nmcli con mod "ConnectionName" ipv4.gateway 192.168.1.1

nmcli con mod "ConnectionName" ipv4.dns "8.8.8.8 1.1.1.1"

nmcli con mod "ConnectionName" ipv4.method manual

How to avoid IP address conflicts?

Before assigning a static address, check the ARP table on your router or use the ping command to ensure that the address you choose is not already taken by another device on the network.

What should I do if the Wi-Fi adapter is not detected in the system at all?

Even if the teams lspci or lsusb If the wireless device isn't showing up, there may be a hardware issue. Check if the module is disabled in the BIOS/UEFI. Also, try booting from a Live USB of a different Linux version to rule out hardware failure. Sometimes, relieving static electricity by removing the battery (if it's removable) and disconnecting the power for 10 minutes helps.

Can I use my phone as a Wi-Fi adapter for Ubuntu?

Yes, this is possible using USB tethering. Connect your smartphone via USB and enable "USB tethering" in your phone's settings. Ubuntu will automatically recognize this as a wired Ethernet connection. This is a great way to download drivers for your primary Wi-Fi module if it's not working.

How do I know if my adapter supports monitor mode?

To check for support of monitor mode (required for security audit), use the utility iw listIn the output, find the "Supported interface modes" section. If the word "monitor" is there, your adapter and driver support this mode. Not all chipsets, especially Broadcom ones, fully support this feature in open-source drivers.