How to Connect Wi-Fi on Linux Ubuntu: A Complete Guide

operating system Ubuntu Linux has long established itself as a reliable and secure platform for everyday work, but initial network connection setup can be challenging for beginners accustomed to Windows interfaces. Unlike proprietary systems, Linux offers flexible network management tools that can solve complex problems, but requires an understanding of the basic principles of network interfaces. Modern versions of the distribution, such as 22.04 LTS or 24.04, feature a graphical environment. GNOME, where connecting to a wireless network is implemented as intuitively as possible, but in some cases, especially when working with server versions or specific equipment, it is impossible to do without using the command line.

The process of activating the wireless module depends on many factors, including the model of your network adapter, the kernel version Linux kernel and the presence of proprietary drivers installed. Often, the system automatically recognizes the device and offers a list of available access points immediately after installation, but in cases with new or rare chipsets, the user will have to expend effort on manual configuration. Understanding how the network manager works NetworkManager, will be the key to successfully resolving most communication problems in this operating environment.

In this guide, we'll walk you through every step in detail: from simple network selection in the graphical interface to in-depth diagnostics via the terminal, allowing you to confidently navigate any situation. We'll cover methods for installing missing drivers, setting up static IP addresses, and troubleshooting common errors that can hinder a stable connection. Being comfortable working with the command line will significantly expand your network management capabilities.

Diagnosing and checking the status of the network adapter

Before attempting to enter a wireless network password, you need to ensure that the operating system can see your wireless hardware and that it isn't blocked at the hardware or software level. The first step should always be checking the physical state of the interface, as the problem often stems from a disabled radio module or driver conflict, rather than incorrect security settings. For complete information about network devices in Linux, there's a powerful tool. lshw, which displays a detailed list of hardware components.

Run the command in terminal to see the status of your Wi-Fi adapter and make sure it is marked as enabled:

sudo lshw -C network

In the command output, pay attention to the lines configuration And capabilities: if you see a mark DISABLED, then the interface is software-mute. It's also useful to check whether the wireless module is blocked by a utility. rfkill, which controls the radio switches on laptops and some desktop boards. Run the command rfkill listto see a list of all wireless devices and their current blocking status.

⚠️ Attention: If in the output rfkill you see the status Hard blocked: yesSoftware methods won't help. You'll need to find a physical switch on the laptop case or use a key combination (usually Fn + the antenna key) to unlock the module.

Another important aspect is to check that the driver for your device is loaded, as without the correct driver, the adapter will not function even if there is a physical connection. Use the command lsmod | grep wifi or lspci -k (for PCI devices) to see which driver (driver) is associated with your network controller. The absence of the line Kernel driver in use often indicates that the driver is not loaded or is missing from the system.

Connecting via the GNOME graphical interface

For most Ubuntu desktop users, the fastest and most convenient way to log in to the network is to use the built-in graphical interface of the environment. GNOMEIn the upper right corner of the screen is the system tray, which displays the sound, battery, and network indicators. Clicking the network icon (usually represented by two arcs or a computer) opens a drop-down menu with available access points. Here, you can see a list of nearby networks sorted by signal strength and select the one you need.

Once you select a network, the system will ask for a security password; depending on the encryption type (usually it is WPA2 or WPA3), you'll need to enter the access key you set in your router. If the network is hidden (not broadcasting its SSID), select "Connect to a hidden network" in the menu and manually enter the network name and security settings. The graphical interface also allows you to configure automatic connection and network availability for all users of the system, which is convenient for home computers with multiple accounts.

In more advanced settings, accessible through the menu Settings → Network → Wi-FiYou can manage your MAC address (using randomization for privacy) and configure IPv4 and IPv6 settings. For standard home use, leaving the IP settings on "Automatic (DHCP)" is sufficient, but corporate networks or servers often require manual static address assignment. Ubuntu's interface is flexible enough to cover 95% of use cases without the need for a console.

📊 Which connection method do you prefer?
Graphical user interface (GUI)
Command line (CLI)
Autostart scripts
NetworkManager TUI

It is worth noting that the graphical interface in Ubuntu is controlled by a daemon NetworkManager, which stores connection configurations in system files. This means that settings made through the GUI are applied system-wide and persist after reboots, ensuring stable operation. If the GUI is unresponsive or freezes, you can try restarting the service through the terminal with the command sudo systemctl restart NetworkManager, without rebooting the entire computer.

Setting up Wi-Fi via the command line (nmcli)

For system administrators and users of server versions of Ubuntu, such as Ubuntu Server, the graphical interface is not available, and all configuration is done exclusively through the terminal using the utility nmcli (NetworkManager command line interface). This tool provides complete control over network connections and allows you to perform all the same actions as the GUI, but using text commands. First, enable the Wi-Fi adapter if it's disabled, using the command nmcli radio wifi on, and then scan the surroundings.

To search for available networks, use the scan command, which will list SSIDs, security modes, and signal strength:

nmcli dev wifi list

Once you see your network in the list, you can initiate a connection by entering the network name (SSID) and password. The command will create a new connection profile and attempt to obtain an IP address from the router's DHCP server automatically. The command syntax requires careful attention to the case of the characters in the network name:

nmcli dev wifi connect "Your_Network_Name" password "Your_Password"

⚠️ Attention: If your Wi-Fi network name or password contains special characters or spaces, be sure to enclose the arguments in double quotes, otherwise the terminal will interpret the command incorrectly and return a syntax error.

In corporate environments or if there are issues with DHCP, manual configuration of the IP address, gateway, and DNS servers may be required. Using nmcli You can modify an existing connection by adding a static IP address, which is often necessary for port forwarding or accessing network resources at a fixed address. To do this, use the command nmcli con mod, followed by the profile name and configuration parameters such as ipv4.addresses And ipv4.gateway.

☑️ CLI Configuration Checklist

Completed: 0 / 4

Installing and updating Wi-Fi drivers

One of the most common reasons for the lack of Wi-Fi in Ubuntu is the lack of proprietary drivers for the wireless adapter, especially if you are using new hardware or specific chipsets from Broadcom or RealtekThe open source Linux community has created numerous drivers, but some manufacturers don't provide specifications openly, requiring additional packages from the Ubuntu repositories. To begin working with drivers, ensure you have internet access via an Ethernet cable or USB modem, as you'll need to download packages from the network.

Ubuntu comes with a handy Additional Drivers tool that automatically scans your hardware and offers recommended proprietary modules for installation. In the graphical interface, this tool can be found through the application search, and in the terminal, it's equivalent to the utility ubuntu-drivers. Running the command ubuntu-drivers devices will display a list of devices for which alternative drivers are available and mark the recommended option.

To automatically install all recommended drivers, you can use the command:

sudo ubuntu-drivers autoinstall

After installation is complete and the system reboots, the adapter should be detected correctly. In cases where the standard repositories don't contain the required driver (for example, for very new Wi-Fi 6E cards), you may need to manually build the module from the source code on GitHub, but this requires a compiler. build-essential and kernel header files linux-headersThe manual installation process is more complex and vendor-specific, so always try the standard repository methods first.

What should I do if the driver does not work after installation?

If Wi-Fi doesn't appear after installing the driver, try resetting the kernel module with sudo modprobe -r module_name and then sudo modprobe module_name. Also, check the kernel logs with dmesg | grep firmware for microcode loading errors.

It is important to understand the difference between open source drivers (e.g. ath9k for Atheros) and proprietary (for example, bcmwl-kernel-source (for Broadcom). Open-source drivers are usually built into the kernel and work out of the box, while proprietary drivers require separate installation and may stop working after a kernel update, requiring recompilation of the DKMS module.

Solving common connection problems

Even with properly installed drivers, users may experience unstable connections, constant disconnects, or an inability to obtain an IP address. One common issue is a power management conflict, where the system attempts to conserve battery power by disabling the Wi-Fi adapter, resulting in connection interruptions. To disable this feature, edit the NetworkManager configuration file and add a parameter that prevents the system from entering sleep mode.

Create or edit a configuration file and add a line to disable power saving:

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

Change the value wifi.powersave on 2 (which means disabling power saving), save the file, and restart the network service. Another common problem is incorrect system time: if the computer's clock is significantly behind or ahead, security certificates may be considered invalid, and connections to secure networks will be blocked. Time synchronization via timedatectl often solves the problem of inability to log in.

Problem Possible cause Solution method
Network not found The driver is not loaded Check lspci and install firmware
Constant breaks Energy saving Disable wifi.powersave in the config
No internet access DNS error Register DNS 8.8.8.8 manually
The password request is endless. Invalid security type Delete the network profile and create a new one

It's also worth mentioning an issue with IPv6 that sometimes occurs on older networks: if the router doesn't support IPv6, and Ubuntu is persistently trying to obtain an address via this protocol, delays may occur. In the connection settings in the graphical interface or via nmcli You can explicitly specify the use of IPv4 only (method ignore for IPv6), which will speed up the connection process in such conditions.

Setting up a static IP and managing profiles

Setting up a home server, media center, or simply conveniently accessing files over a network often requires a computer to have a permanent IP address that doesn't change after a router reboot. In Ubuntu, this can be accomplished in two ways: reserving an address in the router's DHCP settings (MAC address binding) or assigning a static IP directly to the operating system. The latter method is more reliable if you don't have access to the router's admin panel or use multiple networks.

Setting up a static address via the command line is accomplished using the connection modification command, where you specify the desired address, subnet mask, and gateway. It's important to correctly calculate the address space to avoid IP address conflicts with other devices on the network. An example command for setting a static IP:

nmcli con mod "Profile_Name" ipv4.addresses 192.168.1.50/24 ipv4.gateway 192.168.1.1 ipv4.dns "8.8.8.8 8.8.4.4" ipv4.method manual

After applying the settings, you must reactivate the connection for the changes to take effect. Profile management allows you to store settings for different locations (home, office, cafe) and switch between them as needed. In Linux, each profile stores its own security settings, DNS, and IP addresses, making the system flexible for mobile users.

⚠️ Attention: When manually setting up a static IP, make sure the address you select is outside your router's DHCP range, otherwise an address conflict will occur and one of the devices will lose network connectivity.

To return to automatic address acquisition (DHCP), simply change the method to auto and remove manual address settings. This will return the system to its default behavior, where the router automatically assigns all necessary parameters. Proper profile management and an understanding of IP addressing will allow you to build a stable and predictable network infrastructure based on Ubuntu.

Frequently Asked Questions (FAQ)

Why doesn't Ubuntu see my Wi-Fi adapter after installation?

Most likely, your system is missing proprietary drivers for your hardware. Connect your computer to the internet via an Ethernet cable or use a USB modem from your phone (USB tethering mode), then open the "Additional Drivers" app and install the recommended software. The issue may also be caused by a blocked rfkill module.

How do I find the MAC address of my Wi-Fi adapter in Ubuntu?

To view the MAC address, use the command ip link show or ifconfigFind your wireless interface in the list (usually starts with wlan0 or wlp...) and look at the field value link/etherThis is a unique identifier for your device on the network.

Is it possible to share Wi-Fi from an Ubuntu laptop?

Yes, modern versions of Ubuntu allow you to create a Wi-Fi hotspot directly from the graphical interface in the network settings. In the terminal, you can do this by creating a new connection with the "Hotspot" type in NetworkManager, which will allow you to share internet from your cable connection with other devices.

Where are Wi-Fi network passwords stored in Linux?

Saved passwords and network configurations are stored in encrypted form in system files at the path /etc/NetworkManager/system-connections/To view the contents of a specific file, you will need superuser (sudo) privileges, as the data is protected from being read by regular users.