How to Connect to WiFi on Linux: From Beginner to Pro

Working with the Linux operating system often evokes the need for constant interaction with the command line, especially when it comes to network connections. However, modern distributions like Ubuntu, Fedora, and Linux Mint offer intuitive graphical interfaces that allow you to set up internet access in seconds. Understanding how to connect to WiFi in Linux is a basic skill required by every administrator or open source enthusiast.

Unlike proprietary systems, Linux offers users unparalleled flexibility in managing network interfaces, allowing them to choose between automatic configuration tools and manual parameter entry. Whether you're using a laptop with the GNOME desktop environment or a headless server, connection methods remain logically similar, although the tools used vary. We'll cover the main methods of authorizing on wireless networks, focusing on the command line, as it provides complete control over the process.

Checking compatibility and availability of drivers

Before attempting a connection, you need to ensure that the operating system recognizes your wireless adapter. In the Linux world, hardware support often depends on the availability of open-source drivers in the kernel or the need to install proprietary modules separately. First, it's worth running basic diagnostics to verify the physical presence of the device and its status.

Use the utility lspci for internal cards or lsusb For external USB dongles, use the following to identify the chipset model. If the device appears in the list but doesn't work, additional firmware packages may need to be installed. Some distributions, such as Debian, don't include proprietary drivers by default due to licensing restrictions, requiring manual user intervention through non-free repositories.

To obtain detailed information about the state of the WiFi interface, the command is ideal ip link or more specialized iwconfigYou should see the name of your interface, which often looks like wlan0, wlp2s0 or wlo1If you see the message "device not found" instead of the network name or status, the problem lies at the kernel level or with the physical module connection.

⚠️ Caution: If you're using a laptop with dual boot Windows and Linux, the "Fast Startup" feature in Windows may block the WiFi adapter. Always perform a full shutdown, not hibernation, before starting Linux.

It's worth noting that some modern adapters require microcode to be loaded during system startup. Missing this file may result in the interface being visible but unable to scan the air. Check the kernel logs via dmesg | grep firmware often helps to identify such module loading errors.

How to install proprietary drivers?

In Ubuntu and Mint, you can use the "Additional Drivers" utility from the Applications menu. It will automatically scan your hardware and offer to install proprietary Broadcom or Realtek drivers if they are required for proper operation.

Connection via graphical interface (GUI)

For most desktop Linux users, the easiest way remains the built-in network manager. In the GNOME, KDE Plasma, or XFCE desktop environments, this process is as unified as possible and resembles connecting in Windows or macOS. Typically, just click the network icon in the system tray to see a list of available access points.

After selecting the desired network, the system will prompt you for a password. It's important to understand that the graphical interface is merely a frontend for background services such as NetworkManager or ConnMan. This means that settings made through the GUI are saved in system configuration files and can be edited manually if necessary.

  • 📡 Click on the network icon in the upper or lower right corner of the screen.
  • 🔍 Select your network from the list of available SSIDs.
  • 🔑 Enter the security password (usually WPA2/WPA3) and click "Connect".

If authentication is successful, you will receive an IP address automatically via DHCP unless the network requires additional settings, such as a static IP or a corporate 802.1x certificate. The graphical interface also allows you to manage network priority, omitting unnecessary connections or configuring settings for specific SSIDs.

📊 Which Linux distribution do you use most often?
Ubuntu/Linux Mint
Fedora/CentOS
Arch/Manjaro
Debian
Another

If automatic connection doesn't occur, check your privacy settings. Newer versions of GNOME, for example, have MAC address rotation enabled by default to enhance anonymity. Some routers may block such devices if MAC filtering isn't configured, so you may need to disable this feature on your home network.

Using the Command Line: nmcli and nmtui

When a graphical interface isn't available or you're working on a server, text-based utilities come to the rescue. The most powerful tool for managing NetworkManager is nmcliIt allows you to perform all the same actions as the GUI, but through the terminal, making it ideal for scripting and remote administration.

To simplify the work there is a pseudo-graphical utility nmtui, which provides a text menu controlled by the keyboard arrows. This golden mean between the complexity of pure commands and the convenience of the mouse. By launching sudo nmtui, you will be taken to a menu where you can activate the device, add a new connection, or edit an existing one.

Let's look at an example of connection using nmcliFirst, you need to scan available networks with the command nmcli dev wifi listOnce the desired SSID is found, use the connect command, specifying the network name and password. This will create a connection profile that will automatically activate when the network appears in range.

sudo nmcli dev wifi connect "Network_Name" password "Your_Password"

Using the command line offers the advantage of precise control over connection parameters. You can explicitly specify the security type, protocol version, or ignore certain networks. Furthermore, nmcli Allows you to easily switch between multiple profiles, which is useful for mobile users.

☑️ Terminal connection checklist

Completed: 0 / 5

Setting up a static IP address

In some cases, such as port forwarding, server setup, or printing, a fixed IP address is required instead of the dynamic one assigned by the router. Setting up a static address in Linux is accomplished by editing NetworkManager configuration files or using a utility. nmcli.

Using a static IP eliminates addressing conflicts on the local network, but requires manual configuration of the gateway and DNS servers. An incorrectly specified default gateway will result in loss of internet access, even if the local network is functioning correctly. Therefore, it is important to know the exact parameters of your subnet.

To configure via nmcli You must first create or modify a connection by adding the ipv4.method manual parameters, address, gateway, and DNS. After applying the changes, the network will reconnect with the new parameters. This is conveniently done using scripts when deploying the infrastructure.

Parameter Description Example of meaning
IP Address Fixed device address 192.168.1.50
Netmask Subnet mask 255.255.255.0 (/24)
Gateway Router address (gateway) 192.168.1.1
DNS Domain name servers 8.8.8.8, 1.1.1.1

Remember that the static IP address must be outside your router's DHCP pool range, otherwise an address conflict will occur. If the router hands out the same address to another device, one of them will lose the connection. It's best to reserve the address in the router's settings using the client's MAC address.

Troubleshooting common problems

Even with proper configuration, situations may arise where the connection is unstable or completely lost. A common cause is a driver conflict or a malfunctioning network management service. Restarting the NetworkManager service often resolves the issue of a frozen interface without rebooting the entire system.

Team sudo systemctl restart NetworkManager completely refreshes the network stack. If the problem persists, it's worth checking whether the wireless module is blocked by software. The utility rfkill Shows the blocking status. Sometimes after a kernel update, a module may be marked as "hard blocked" or "soft blocked."

  • 🔌 Check the physical WiFi switch on the laptop case.
  • 🔄 Restart the network service using the systemctl command.
  • 📝 Check your system logs for driver errors.

It's also worth paying attention to power saving settings. Linux can disable the WiFi adapter by default to save power, which can lead to connection drops. Disabling power saving mode for a specific interface in the TLP or pm-utils configuration can significantly improve signal stability.

⚠️ Note: Interfaces and package names may vary depending on the distribution. Older versions used Wicd or net-tools, while modern systems rely on NetworkManager and systemd-networkd.

Wireless connection security

When connecting to public WiFi networks, it's important to remember the security of the data being transmitted. Linux offers numerous auditing and security tools, but every user should take basic precautions. Using a VPN encrypts all traffic, making it unreadable by access point administrators.

Certificate verification and the use of WPA3 protocols instead of legacy WEP or WPA2-TKIP significantly improve security. Linux makes it easy to manage certificates and keys through the system store, ensuring reliable authentication on corporate networks.

For home use, it is recommended to disable WPS, as this protocol has known vulnerabilities. In Linux, you can use tools like aircrack-ng (For educational purposes only!) to test your own network's password strength. Make sure your password contains enough characters and isn't a dictionary word.

Frequently Asked Questions (FAQ)

Why can't my Linux see WiFi networks, even though everything works in Windows?

Most likely, proprietary drivers for your WiFi adapter aren't installed on Linux. In Windows, they're built-in or installed automatically, but in Linux, you often need to install them manually through a package manager or repositories.

How to find out the IP address after connecting to WiFi?

Use the command ip addr show or in short ip aFind your wireless interface (usually starts with w) and look at the inet line, where the current IP address will be listed.

Is it possible to share WiFi from a Linux laptop?

Yes, most modern distributions allow you to create a hotspot directly from the network settings in the graphical interface or via nmcli commands, turning your laptop into a router.

What should I do if the password request keeps appearing?

This could indicate an incorrect password, but it also often occurs due to an incorrect system date/time or a connection profile conflict. Try deleting the saved network profile and creating it again.