How to Share WiFi with Linux: A Complete Setup Guide

Modern Linux operating systems have long ceased to be the exclusive preserve of server administrators and enthusiasts, becoming powerful workstations for everyday use. However, even in 2026, users often face the need to quickly set up a wireless network to connect smartphones, tablets, or other laptops that don't have direct access to wired internet. Transforming your Linux desktop into a full-fledged access point (Hotspot) is a solvable task that does not require in-depth knowledge of network protocols if you follow proven algorithms.

There are several ways to implement this feature, from using graphical shells built into popular distributions like Ubuntu or Fedora to manually configuring network services via the command line for maximum control. The choice of method depends on your goal: whether you need a one-time solution for guests or a permanent infrastructure with fine-tuned security and traffic filtering. In any case, understanding how network interfaces work will allow you to effectively manage your connection.

In this article, we will examine in detail all the available options, from the simplest graphical utilities to professional software like hostapdWe'll cover the nuances of working with different network cards, the specifics of DHCP server configuration, and troubleshooting common errors you might encounter when setting up an access point. Being comfortable with the terminal will significantly expand your capabilities, but we'll start with the most accessible methods.

Checking wireless adapter compatibility

Before you begin configuring the software, it's crucial to ensure your hardware is capable of operating in access point mode. Not all Wi-Fi adapters support this mode. Master Mode or AP Mode, which is necessary for internet distribution. Many budget USB dongles or built-in modules in laptops only operate in client mode (Station), making it impossible to create a network without replacing the equipment.

To check the capabilities of your adapter in Linux, use the utility iw, which replaced the outdated one iwconfigYou need to open a terminal and run the command to check for supported interfaces. If you see the word "AP" in the list of supported interface modes in the command output, then your device is theoretically ready for use.

iw list | grep -A 10"Supported interface modes"

However, driver support for AP mode isn't the only requirement. There are hardware limitations related to frequency bands. Some adapters can only broadcast at 2.4 GHz, while others support 5 GHz, which provides higher speeds but a shorter range. It's also worth considering that virtual machines often don't have direct access to the host's physical Wi-Fi module, making it impossible to create an access point from within the guest OS without USB passthrough.

⚠️ Attention: If your adapter supports AP mode but the access point isn't being created, try disabling Wi-Fi power saving mode. Drivers often reduce power or disable the module to save energy, which disrupts connections to clients.

Why don't some adapters see 5 GHz networks?

It's all about regional regulatory settings. In some countries, 5 GHz channels are restricted. Check your region with the `iw reg get` command and, if necessary, change it to `US` or `DE` with `iw reg set`, but be aware of your country's regulations.

Creating an access point via the graphical interface

For most users of desktop distributions such as Ubuntu, Linux Mint, Pop!_OS, or Fedora Workstation, there is no need to delve into the depths of the command line. Modern desktop environments based on GNOME or KDE Plasma, have a built-in hotspot feature. This method is ideal for quickly sharing internet with colleagues or connecting a smartphone to transfer files over the air.

The process is usually hidden in the network settings. Find the Wi-Fi section and toggle the switch to "Use as an access point" or "Hotspot." The system will automatically generate a network name (SSID) and password, although you can change these settings to your own. Behind the scenes, the operating system will automatically start the necessary services, configure NAT (Network Address Translation), and launch a DHCP server to distribute IP addresses to connected devices.

The main advantage of the graphical method is its stability and integration with the security system. The encryption password is typically set to the WPA2/WPA3 standard, which provides a sufficient level of security for home use. However, its functionality is limited: you can't configure client isolation, filter MAC addresses, or keep detailed connection logs without additional tools.

  • 📱 Open system settings and go to the Wi-Fi section.
  • 🔌 Select the "Use as hotspot" option from the action menu.
  • 🔐 Enter the network name (SSID) and a strong password in the window that appears.
  • 📡 Click "Enable" and check the network availability from your mobile device.
📊 Which setup method do you prefer?
Graphical User Interface (GUI): Terminal and Scripts: NetworkManager TUI: Ready-made utilities like create_ap

Setting up an access point via the terminal (nmcli)

For system administrators and users who prefer control over every parameter, an indispensable tool is nmcli (NetworkManager command line interface). This utility allows you to manage network connections without a graphical shell, making it ideal for server versions of Linux or remote management via SSH. nmcli commands translate into the NetworkManager configuration, ensuring that settings persist after reboot.

Creating an access point via the terminal takes just seconds if you know the syntax. You'll need to specify the name of the connection being created, the SSID, the password, and the interface through which the connection will be shared. It's important to understand that when creating a new access point via nmcli, the system automatically creates a connection profile, which can be modified or deleted later.

nmcli device wifi hotspot ssid"MyLinuxHotspot" password"SuperSecret123" ifname wlan0

After executing the command, your computer will immediately begin broadcasting the network. You can check the connection status using the command nmcli connection show --activeIf the connection is active but the internet is not working on client devices, the problem most likely lies in the routing settings or the lack of IP forwarding in the system kernel. In such cases, checking the iptables or nftables tables is necessary.

☑️ Checking nmcli settings

Completed: 0 / 1

Using Hostapd and Dnsmasq for Professionals

When standard tools are not enough, a combination comes into play hostapd And dnsmasq. This is a classic approach for creating dedicated access points, hotspots in cafes, or guest networks with authentication. Hostapd is responsible for wireless interface management and security (authentication, encryption), while dnsmasq handles the DHCP server and DNS caching functions.

Configuring hostapd requires creating a separate configuration file, which specifies all parameters: driver, frequency, channel, encryption type, and the path to the password file (if using WPA-Enterprise). This provides flexibility unavailable in graphical interfaces: you can set signal strength, hide the SSID, configure the access point's schedule, and log all events.

interface=wlan0

driver=nl80211

ssid=ProLinuxAP

hw_mode=g

channel=7

wmm_enabled=0

macaddr_acl=0

auth_algs=1

ignore_broadcast_ssid=0

wpa=2

wpa_passphrase=MyPassword

wpa_key_mgmt=WPA-PSK

wpa_pairwise=TKIP

rsn_pairwise=CCMP

Establishing such a combination often requires stopping standard network managers, such as NetworkManager, as they can conflict with each other for control of the wireless adapter. This makes the method difficult to use on a regular desktop, but indispensable for specialized tasks, such as setting up temporary internet at an event or creating an isolated test environment.

Parameter Meaning Function Description
driver nl80211 A modern driver for the Linux kernel, replacing the old madwifi
hw_mode g / a Operating mode: g for 2.4 GHz, a for 5 GHz
wpa 2 Security protocol version (WPA2)
channel 1-14 Channel number, it is important to choose one that is free from neighbors

Driver and compatibility issues

Linux is renowned for its hardware support, but the situation with proprietary Wi-Fi drivers, especially from Realtek and Broadcom, can be ambiguous. It often happens that the adapter is detected by the system and operates in client mode, but categorically refuses to switch to access point mode. This is due to driver vendors not always implementing the full functionality of the chipset or using non-standard kernel extensions.

If you encounter the error "nl80211: Could not configure driver mode" or a similar one, first check which driver is loaded. The command lsmod | grep -E"iwl|ath|rtl|brcm" will help identify the module. Some Realtek chips (e.g., RTL8812AU) may require drivers from the DKMS repositories, which must be manually compiled from the source code available on GitHub.

It's also worth mentioning the dual-bootloader issue with Windows. If you have a dual-boot system, the Fast Startup feature in Windows can leave the Wi-Fi module in a blocked state. Linux sees the device but can't change its operating mode. The solution is simple: boot into Windows and perform a full shutdown, or disable Fast Startup in the power settings.

⚠️ Attention: When installing drivers from third-party sources (DKMS), always verify the digital signatures of the repositories. Injecting malicious code at the kernel level through the Wi-Fi driver gives an attacker complete control over the system.

Optimizing network speed and security

Once your hotspot is successfully running, it's important to ensure it's fast and secure. By default, many distributions use basic encryption settings, which can be vulnerable. It's recommended to force-enable the protocol. WPA3, if your hardware and client devices support it, as it protects against brute-force attacks.

To improve data transfer speeds, ensure you're using a channel width of 40 MHz (for 2.4 GHz) or 80/160 MHz (for 5 GHz). However, in dense urban areas, wide channels can pick up more interference, so it's sometimes better to choose a narrow but clear channel. Also, remember to keep your Linux kernel up to date: new versions often contain patches for the mac80211 wireless network stack that improve performance.

Security also involves client isolation. In a corporate environment or when sharing the internet with strangers, you should enable "Client Isolation" (AP Isolation). This will prevent devices connected to your hotspot from seeing each other and attacking your personal files or printers on the local network. In hostapd, this is done with the parameter ap_isolate=1.

  • 🔒 Use complex passwords of at least 12 characters in length and case-sensitive.
  • 🛡️ Update your package regularly wpa_supplicant and the core of the system.
  • 📉 Monitor channel load and change frequencies if interference appears.
  • 🚫 Disable WPS, as this protocol has known vulnerabilities.

Frequently Asked Questions (FAQ)

Is it possible to share Wi-Fi if the laptop is already connected to a Wi-Fi network?

Yes, this is possible, but it requires two wireless adapters (for example, a built-in one and a USB one) or support for virtual interfaces on one physical adapter. In "Wi-Fi Repeater" mode, one interface receives the signal while the other distributes it, but this often results in a 50% reduction in speed.

Why does my phone connect but say "No Internet access"?

Most likely, NAT (masquerading) isn't configured at the kernel level. You need to enable IP forwarding with the command sysctl -w net.ipv4.ip_forward=1 and configure iptables rules to forward traffic from the access point interface to the interface with access to the global network.

How can I make the hotspot turn on automatically on boot?

If you used nmcli, the connection is saved by default. Make sure the parameter connection.autoconnect installed in yesFor hostapd, you will need to create a systemd service that will launch the daemon at system startup.

Does creating a hotspot affect battery life?

Yes, it does. Access point mode keeps the radio module in a constant, active transmission state, which consumes significantly more power than client mode. Expect a 30-50% reduction in battery life depending on the number of connected devices.