The Linux operating system provides system administrators and advanced users with powerful tools for managing network interfaces, which are often unavailable or limited in graphical environments. When the familiar graphical interface is unresponsive, freezes, or simply absent, as it often happens on servers, it's precisely this command line becomes the only way to restore a connection to the global network. Understanding how network utilities work allows you to not only enable Wi-Fi, but also conduct a thorough diagnosis of problems that are hidden from the average user.
In this article, we will look at the basic methods of activating the wireless module using standard utilities such as NetworkManager, ip And iwYou'll learn not only how to bring up the interface, but also how to check its status, scan for available access points, and connect to secure networks without using graphical applets. These skills are critical for any specialist working with Linux systems.
Diagnosing the status of a wireless adapter
Before attempting to enable Wi-Fi, you need to ensure that the operating system even recognizes your wireless hardware. Often, the problem lies not in software settings, but rather in missing drivers or a physically disconnected module. The first step should always be checking the list of network devices, which will help you determine whether the Linux kernel recognizes your Wi-Fi adapter.
To get complete information about network interfaces, it is best to use the utility ip, which replaced the outdated one ifconfig. Enter the command ip link show in the terminal to see a list of all interfaces. Look for devices with names starting with wl or wlan, which is the naming standard for wireless cards in modern distributions.
⚠️ Attention: If the list does not contain an interface with the prefix
wl, this may mean that the driver for your device is not installed or the module is blocked at the BIOS/UEFI level. In this case, attempting to enable Wi-Fi software will be futile.
Additionally, it is worth checking the radio module blocking status using the utility rfkillThis command shows whether Wi-Fi is blocked by hardware (physical switch on the laptop) or software. The command rfkill list all will display a detailed list of all wireless devices and their current blocking status.
Using RFKill utility to unlock
Utility rfkill is a standard Linux tool for managing wireless device switches. It allows you to bypass software locks that may occur after a system update or network service outage. If the previous diagnostic step showed that your device is marked as "locked," this is where we'll unlock it.
To remove all locks from wireless interfaces, use a simple command with superuser rights. In the terminal, enter sudo rfkill unblock wifi or sudo rfkill unblock allIf you want to unlock all wireless modules, including Bluetooth, use this command. After running this command, the status should change to "unblocked."
- 🔹 Team
rfkill listShows the current status of all devices and types of locks. - 🔹 Using the flag
sudoThis is necessary because changing the state of the equipment requires administrator rights. - 🔹 If the device remains locked after the unblock command, check the physical switch on the laptop case.
It is important to understand the difference between "hard blocked" and "soft blocked". Hard block means a physical shutdown or blocking via BIOS, which is difficult to remove programmatically. Soft block - this is a software blockage that the utility eliminates rfkillSuccessfully removing the soft block often solves the problem of no Wi-Fi.
Activating an interface via NetworkManager (nmcli)
Most modern distributions, such as Ubuntu, Fedora, and CentOS, use a network manager by default. NetworkManagerThis is a powerful tool that allows you to manage connections completely through the console using a utility. nmcliThis method is the most preferred, as it saves settings and automatically reconnects upon reboot.
The first thing you need to do is enable the network manager itself if it has been stopped. The command sudo nmcli radio wifi on activates the wireless radio module. After this, you need to enable a specific network interface. To find out the device name, you can use the command nmcli device status, which will show a list of devices and their status.
sudo nmcli device set wlan0 managed yes
sudo nmcli device connect wlan0
If the interface is managed by NetworkManager, you can scan available networks with the command nmcli device wifi listTo connect to the network, use the command nmcli device wifi connect "SSID_network" password "your_password"This is the simplest and most reliable way to connect in graphical and console environments.
☑️ Checking the connection via nmcli
Manual control via IP and IW
For systems that do not use NetworkManager, or for more fine-grained control over the network stack, utilities are used. ip And iwThese tools work directly with the Linux kernel and allow low-level control of the interface. This is useful for automation scripts or debugging driver issues.
To enable the interface manually, you first need to put it into the "UP" state. The command sudo ip link set wlan0 up brings the interface up, making it ready for use. If the interface has already been brought up but isn't working, you can try restarting it by first running the command sudo ip link set wlan0 down, and then again up.
To operate wireless functions such as scanning, a utility is used. iw. Team sudo iw dev wlan0 scan will start a scan of the airwaves. Please note that the interface must be free of active connections before scanning, otherwise the command may fail.
| Team | Description of action | Necessary rights |
|---|---|---|
ip link set dev up |
Activating the network interface | root (sudo) |
ip link show |
Displaying the status of interfaces | user |
iw dev scan |
Scanning Wi-Fi networks | root (sudo) |
iwconfig |
View wireless settings | user |
⚠️ Attention: When using utilities
ipAndiwSettings are not saved after reboot. For a persistent connection, you must enter the configuration in the appropriate system files or use NetworkManager.
Connecting to WPA/WPA2 secured networks
Simply enabling the interface isn't enough—you need to securely connect to the access point. For password-protected networks (WPA2-PSK), the standard utility is wpa_supplicantThis daemon manages connections and ensures traffic encryption. Connecting through it is more complex, but provides complete control.
First, you need to create a configuration file with a password hash to avoid storing the password in plaintext. Use the utility wpa_passphrase to generate the config. The command looks like this: wpa_passphrase "SSID_network" "password" > /etc/wpa_supplicant/wpa_supplicant.confThis will create a file with the required parameters.
Then we launch the daemon itself, specifying the interface and the created configuration file. The command sudo wpa_supplicant -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.conf -B will run the process in the background. After successfully associating with the access point, you need to obtain an IP address, usually via dhclient or dhcpcd.
What to do if wpa_supplicant does not connect?
Check the password and encryption type. Make sure the driver supports your card's operating mode. Try disabling NetworkManager management, as they may conflict with each other for interface control.
Automation and saving of settings
Manually entering commands each time the system boots is inefficient. Linux has mechanisms for automatically bringing up interfaces. In Debian/Ubuntu-based distributions, you can use the file /etc/network/interfaces, adding lines there auto wlan0 And iface wlan0 inet dhcp.
For systems using systemd-networkd, the configuration is stored in files with the extension .network in the directory /etc/systemd/network/. Creating a file wireless.network With the corresponding Match and Network sections, this will allow the system to automatically enable Wi-Fi upon boot. This is especially relevant for servers and embedded devices.
Please remember that wireless network configurations may change when packages are updated or interface naming rules change (for example, moving from wlan0 To wlo1). Always check the current device names after major system updates.
Why does the ip link set up command return an error?
The error "Operation not permitted" means that you forgot to add sudoThe "No such device" error indicates that the interface name is incorrect or the driver is not loaded. Check the name via ip link.
Is it possible to enable Wi-Fi without root rights?
Usually no. Managing network interfaces requires superuser privileges. However, if Polkit is configured, the system may prompt for a password via a graphical window when attempting to connect via nmcli.
How to check if Wi-Fi is working after turning it on?
Use the command ping 8.8.8.8If the packets are coming through, then the connection is established. You can also check whether the IP address has been received using the command ip addr show wlan0.