How to Connect Wi-Fi in Linux: From Beginner to Pro

Modern operating system distributions Linux They've come a long way from console utilities to user-friendly graphical interfaces that allow you to connect to wireless networks with literally one click. However, as administration practice shows, the graphical interface isn't always stable, and in server versions of the OS, it's simply absent, leaving the user alone with the command line. Therefore, knowledge of manual configuration methods is essential. NetworkManager or wpa_supplicant is a critical skill for any system administrator or advanced user.

In this article, we'll cover all possible methods for connecting to Wi-Fi in Linux, from standard graphical utilities in Ubuntu to complex terminal configurations in Debian or Arch Linux. You'll learn how to diagnose driver issues, manage connection profiles, and ensure the security of your connection.

Regardless of whether you use Ubuntu, Fedora, Linux Mint Whether you're using Linux or another distribution, the principles of network subsystem operation remain similar, although the tools may have different names. We'll look at universal methods that will help you stay online in any situation, even if the graphical shell has stopped responding.

Equipment diagnostics and testing

Before attempting to enter a password or set a static IP address, you need to ensure that the operating system actually "sees" your wireless adapter. Often, the problem lies not with the network settings, but with missing drivers or a physically disconnected module. The first step should always be to verify the device's presence in the system.

For a quick check, you can use the utility lspci for internal cards or lsusb for external USB dongles. These commands will list the connected hardware, and you need to look for lines with the words Wireless, Wi-Fi or names of manufacturers like Realtek, Intel, Qualcomm.

lspci | grep -i network

lsusb | grep -i wireless

If the device is found but doesn't work, it most likely requires proprietary drivers. In Linux-based distributions Debian And Ubuntu A utility is often used for this purpose additional-drivers, which automatically finds and offers to install the necessary packages.

⚠️ Attention: If you're using a laptop, check the physical Wi-Fi switch on the case or the keyboard shortcut (usually Fn + antenna icon). In Linux, the state of this switch often blocks the module at the kernel level, and no software settings will help until it's enabled.

📊 Which Linux distribution do you use most often?
Ubuntu
Debian
Arch Linux
Linux Mint
Fedora

Connection via graphical interface

For most desktop Linux users, the easiest way remains to use the graphical interface. In desktop environments GNOME And KDE Plasma Network management is built into the system tray. Typically, just click the network icon in the upper-right corner of the screen, select the desired access point from the list, and enter the password.

However, if automatic connection doesn't occur, you can create a profile manually. In Network Settings, select the Wi-Fi section, click "Add" or "+", enter the SSID (network name), and select the security type, which is usually labeled as WPA & WPA2 PersonalThis is the most common standard for protecting home routers.

It's important to note that graphical utilities often hide advanced settings, such as MAC addressing or static DNS. To access them in Ubuntu, for example, you need to go to Settings → Network → Wi-Fi → Gear (next to the active network) → IPv4Here you can disable DHCP and enter addresses manually if required by your ISP or corporate security policy.

Network management via nmcli (NetworkManager CLI)

When the graphical interface is unavailable or does not work correctly, the help comes nmcli — a powerful console utility for management NetworkManagerIt's included by default in most popular distributions and allows you to perform any actions available in the GUI, but using commands. It's the de facto standard for servers without a graphical shell.

Before connecting, it is useful to scan for available networks. The command nmcli dev wifi list will display a list of available access points, their signal strength, and security type. If the list is empty, the Wi-Fi adapter may be disabled programmatically. You can enable it with the command nmcli radio wifi on.

nmcli dev wifi connect "Network_Name" password "Your_Password"

This command will attempt to create a new connection and activate it. If the network requires a hidden SSID or WPS, the syntax may be slightly different, but in 95% of cases, the name and password are sufficient. Nmcli will automatically save the profile, and the next time you log in, the connection will occur automatically.

Team Description of action Example of use
nmcli c show Show all saved profiles Checking the profile name
nmcli c up "Profile" Activate connection by name Enabling the backup channel
nmcli c delete "Profile" Delete connection profile Clearing old settings
nmcli dev wifi rescan Forced network scanning If the network does not appear in the list

⚠️ Attention: Command line interfaces may change in new versions of NetworkManager. If a command returns a syntax error, check the help via nmcli --help or refer to your distribution's documentation, as the parameters may differ.

☑️ Check before entering a command

Completed: 0 / 4

Configuration via wpa_supplicant

In some minimalist distributions or specialized builds NetworkManager may be absent. In such cases, a lower-level daemon is used. wpa_supplicantIt is directly responsible for negotiating encryption keys and associating with the access point. It is more complex to work with, but provides complete control over the process.

First, you need to create a configuration file, usually located at the path /etc/wpa_supplicant/wpa_supplicant.confA block is added to it. network with your network parameters. The password can be stored in cleartext (less secure) or as a hash.

network={

ssid="MyHomeWiFi"

psk="ComplexPassword123"

key_mgmt=WPA-PSK

}

After editing the config, you need to start the daemon by specifying the interface (for example, wlan0). The command will look like this wpa_supplicant -B -i wlan0 -c /etc/wpa_supplicant/wpa_supplicant.confThen, to get an IP address, you need to run a DHCP client, for example, dhcpcd wlan0 or dhclient wlan0.

How to get password hash for wpa_supplicant?

Instead of storing the password in plaintext in the configuration file, you can generate a hash using the wpa_passphrase "SSID" "PASSWORD" command. Copy the command output (the network={...} block) into the configuration file. This will protect the password from accidental viewing.

Solving common connection problems

Even with proper configuration, situations may arise where the connection is unstable or completely absent. One common cause is an address conflict or incorrect DNS settings. If you are connected to the router but websites are not opening, try entering public DNS servers, such as Google's (8.8.8.8) or Cloudflare (1.1.1.1).

It's also worth paying attention to power saving mode. Some Wi-Fi drivers disable the adapter by default to save power, which can lead to connection drops. You can disable this feature in the settings. TLP or laptop-mode-tools, or by adding a parameter iwconfig wlan0 power off into startup scripts.

If all else fails, it's helpful to look at the system logs. Most distributions log network events in /var/log/syslog or /var/log/messagesSearch by word wifi or firmware The logs often reveal a specific driver error or access denial.

Wireless connection security

When connecting to public networks in cafes or airports, it is important to remember data security. Protocol WPA3 is the current security standard, but many devices still use WPA2Avoid open networks where data is transmitted unencrypted.

For additional security, it's recommended to use VPN tunneling immediately after connecting to Wi-Fi. This will encrypt all traffic between your device and the VPN server, protecting passwords and communications from interception on the local network. Popular Linux clients OpenVPN And WireGuard.

It is also a good practice to disable automatic connections to known networks if you are unsure of their security. NetworkManager You can configure your profile so that it does not activate automatically, requiring user confirmation each time.

How do I check if my connection is secure?

Use the command nmcli -f active,security dev wifito see the security type of the active network. If it says WEP or Open, the connection is not secure for transmitting confidential data.

What to do if the router does not distribute DHCP?

DHCP may not work on corporate networks or if the router is down. In this case, you must manually enter the IP address, subnet mask, and gateway in the IPv4 settings using the information provided by the network administrator.

Is it possible to share Wi-Fi from a Linux laptop?

Yes, most modern adapters support hotspot mode. In GNOME, this is done through the "Mobile Hotspot" settings, and in the terminal, through nmcli con add type wifi ifname wlan0 con-name hotspot ssid MyHotspot mode ap.