Switching to an open-source operating system often comes with a desire to understand the intricacies of hardware, and wireless networks are no exception. Unlike proprietary systems, where the connection process is hidden behind layers of automation, Linux gives you full control over the network interface. This allows you to not only connect to the router but also fine-tune security settings, routing, and connection priorities.
However, for beginners, the lack of a familiar graphical interface in some distributions can be a barrier. Modern desktop environments like GNOME or KDE Plasma handle basic tasks well, but server versions or minimalist builds require a command line. Terminal In this case, it's not a sign of archaism, but a powerful administration tool that allows you to diagnose problems at the package level.
In this guide, we will cover all the current methods for setting up a connection: from simple graphical utilities to advanced console managers like NetworkManager And systemd-networkdYou will learn to understand the logic behind network daemons and be able to confidently configure Wi-Fi on any distribution, be it Ubuntu Server, Debian or Arch Linux.
Checking the presence and status of a Wi-Fi adapter
Before attempting to enter the network password, make sure the operating system can even detect your wireless equipment. Often, the problem lies not in the settings, but in missing drivers or a blocked radio module at the kernel level. The first step should always be to diagnose the hardware to rule out physical faults.
First, use the utility lspci for internal cards or lsusb For external USB dongles, these commands will list connected devices, where you should look for names like Intel, Realtek or Qualcomm AtherosIf the device is displayed, it means the system recognizes it, but it may require the installation of proprietary firmware files to function.
Next, check whether the wireless module is blocked by software or hardware. In Linux, this is done using the utility rfkill, which controls the radio switches. Run the command in the terminal:
rfkill list all
In the output you will see the statuses Soft blocked And Hard blocked. If at least one of them is marked as yes, the connection cannot be established. To remove the software block, use the command sudo rfkill unblock wifiThe hardware lock is usually released using a physical switch on the laptop case or a key combination with Fn.
⚠️ Attention: If the utility
rfkillIf your adapter isn't shown in the list, the driver may not have loaded. In this case, installing the firmware packages for your chipset model is required before proceeding.
Using the GUI and nmtui utility
For users of desktop Linux versions, such as Ubuntu with GNOME or Linux Mint with Cinnamon, setup is most often done through the system tray. The network icon in the upper right corner allows you to select an available access point and enter the password. This is the standard approach, which works 90% of the time thanks to a background daemon. NetworkManager.
However, on server builds or when working via SSH, the graphical interface is unavailable. This is where a pseudo-graphical utility comes in handy. nmtui (Network Manager Text User Interface). It provides a simple text menu controlled by the keyboard arrows, making the connection process intuitive even without a mouse.
To start the setup, enter the following in the terminal:
sudo nmtui
In the menu that opens, select "Activate a connection." A list of available networks will appear. Find your SSID, press Enter, enter the password, and confirm. The system will automatically create a connection profile and attempt to obtain an IP address.
- 📶 Activate a connection — selecting and connecting to an available Wi-Fi network.
- 📝 Edit a connection — manual configuration of static IP, DNS or security parameters.
- 🔌 Edit global options - hostname and network wait management during boot.
This method is ideal for initial server setup when you need to quickly access the internet to install updates. After connecting via nmtui You can switch to the graphical interface or continue working in the console.
Setting up Wi-Fi via the command line with nmcli
For those who value speed and automation, the utility nmcli (Network Manager Command Line Interface) is an indispensable tool. It allows you to manage your network entirely from the command line, without opening additional menus. It's the preferred method for scripting and remote administration.
The first thing you need to do is turn on the Wi-Fi module if it is turned off. The command nmcli radio wifi on Activate the radio. Then, scan the airwaves to ensure the desired network is visible. While scanning often occurs automatically, forcing it on ensures the list is up-to-date:
nmcli device wifi rescan
After scanning, list the networks with the command nmcli device wifi listFind your network name (SSID) in the list and copy it exactly, taking into account the case of the characters. To connect, use the following structure, replacing the parameters with your own:
nmcli device wifi connect "Network_Name" password "Your_Password"
If the connection was successful, NetworkManager will save the profile. When you reconnect, you won't need to enter the password. To check the connection status, use the command nmcli connection show --active, which will display all active interfaces and their current state.
⚠️ Attention: When entering a password on the command line through the bash history (
history) it may be saved in plaintext. For security, clear the history or use environment variables when entering sensitive data.
Hidden Networks (Hidden SSID)
If your network doesn't broadcast the name, add the hidden yes parameter: nmcli device wifi connect "Name" password "Password" hidden yes ssid "Name"
Network Configuration in Ubuntu Server with Netplan
Modern versions Ubuntu (starting from 17.10) and some other distributions use Netplan as a standard tool for network configuration. Unlike NetworkManager, Netplan works with YAML configuration files and generates a backend for systemd-networkd or NetworkManager.
Configuration files are located in the directory /etc/netplan/ and have an extension .yamlThe file name may differ, for example, 00-installer-config.yaml or 50-cloud-init.yamlBefore editing, be sure to make a backup copy of the file, as an error in YAML indentation will result in network inoperability.
Example configuration for connecting to Wi-Fi using WPA2:
network:version: 2
renderer: networkd
wifis:
wlan0:
dhcp4: true
access-points:
"MyHomeWiFi":
password: "SuperSecretPassword"
Here wlan0 — the name of your interface, which can be found through ip linkAfter making changes, apply the configuration with the command sudo netplan applyIf the syntax is correct, the system will attempt to connect. For debugging, use sudo netplan try, which will roll back changes after 120 seconds if the connection fails.
| Parameter | Meaning | Description |
|---|---|---|
| renderer | networkd | The backend used (systemd-networkd) |
| dhcp4 | true | Automatically obtaining an IPv4 address |
| optional | true | Don't wait for connection when loading (for servers) |
| addresses | 192.168.1.5/24 | Static IP (if dhcp4: false) |
Manual interface management via ip and iw
For deep diagnostics and work in minimalistic environments (for example, Alpine Linux or old Debian), low-level utilities are used. ip (from the iproute2 package) and iwThey don't store profiles or manage WPA authorization automatically, so they require more steps, but they give you complete control.
First, bring up the interface with the command ip link set wlan0 upThen scan the networks using iw dev wlan0 scan | grep SSIDTo connect to an open network, simply specify the IP address and gateway. However, for secure networks, a daemon is required. wpa_supplicant.
The connection process looks like this: creating a configuration file with a password hash, launching wpa_supplicant in the background and receiving IP through dhclient or dhcpcdThis is a more complex approach, which is only justified in specific cases where other managers are not working.
- 🔍 iw dev — displays information about wireless devices.
- 🔗 ip addr — shows IP addresses and interface status.
- 🛡️ wpa_passphrase — generates an encrypted key for the config.
Using these tools requires an understanding of how the TCP/IP stack works in Linux. An incorrect gateway or DNS configuration will result in no internet access, even if the router is successfully connected.
Troubleshooting and Common Mistakes
Even with proper setup, connection issues may still occur. A common cause is a driver conflict or an unstable signal. Use a utility dmesg | grep wifi or journalctl -u NetworkManager to view the system log. It will indicate the reasons for connection interruptions or failures.
If your connection speed is slow, check your Wi-Fi channel. Channels in apartment buildings can be overloaded. Use the command iwlist wlan0 scanning You can see the channel load and try switching the router to a less loaded frequency range.
It's also worth paying attention to power-saving settings. Some drivers disable the Wi-Fi module by default to save power, which can lead to disconnects. You can disable this through the configuration. NetworkManager or by creating a file in /etc/NetworkManager/conf.d/ with parameter wifi.powersave = 2.
⚠️ Attention: Interfaces and package names may vary depending on the distribution version and kernel used. Always consult the official documentation for your specific Linux distribution if the standard commands don't work.
☑️ Wi-Fi diagnostics
Questions and Answers (FAQ)
Why isn't my Wi-Fi adapter visible in the list of devices?
Most likely, a proprietary driver or firmware is missing. Check the adapter model via lspci or lsusb, find the driver package on the manufacturer's website or in the distribution's repositories (often has a prefix firmware- or linux-firmware) and install it.
How to save a Wi-Fi password in plain text?
Passwords are stored in configuration files /etc/NetworkManager/system-connections/By default, they may be hidden. To see the password, use the command sudo nmcli connection show "NetworkName" | grep 802-11-wireless-security.key-mgmt or view the config file with root privileges.
Is it possible to set up Wi-Fi without rebooting the system?
Yes, all the methods considered (nmcli, netplan apply, nmtui) apply changes on the fly. A reboot is only required when installing new kernel drivers or updating firmware.
What to do if there is a connection, but the Internet does not work?
Check your DNS settings. Try pinging an IP address (e.g., 8.8.8.8). If you can ping but websites don't open, manually enter the DNS (e.g., 1.1.1.1 or 8.8.8.8) in your connection settings.