How to Disable Wi-Fi in Ubuntu: Methods and Commands

operating system Ubuntu While wireless networks are renowned for their flexibility and extensive customization options, standard network management methods can sometimes seem unobvious to beginners. Often, situations arise where you need to urgently disconnect from a wireless access point for troubleshooting or simply for data security. Understanding how to gracefully shut down wireless adapter, is a basic skill for any Linux user.

There are several approaches to solving this problem, from using a graphical interface to entering commands in a terminal. The choice of a specific method depends on the distribution version, the installed graphical shell, and the user's personal preferences. In this article, we'll cover all available methods in detail so you can choose the one that's most convenient for you.

Improperly terminating network processes can lead to driver freezes or the inability to reconnect without a system reboot. Therefore, it's important to know not only how to disable the module but also how to ensure that the process was successful. We'll cover both standard tools and more advanced administrative tools.

Using the GNOME graphical interface

The easiest and most intuitive way for most users is to use the standard graphical interface of the environment. GNOME, which is installed by default in UbuntuIn the upper right corner of the screen is the system tray, which displays system status indicators, including the network icon. Clicking it displays a drop-down menu with available connections.

To disable Wi-Fi, simply find the switch labeled "Wi-Fi" or depicting a wireless network and toggle it to the "Off" position. This will immediately stop scanning for available networks and terminate the active connection. The interface will immediately respond, and the tray icon will change to indicate that the module is inactive.

If the standard switch is unresponsive or the interface is frozen, you can use an alternative method through the settings menu. To do this, go to Settings → NetworkHere, wireless interface management is located in a separate panel, where you can not only disable Wi-Fi but also configure IP, DNS, and proxy server settings.

  • 📶 Click the network icon in the upper right corner of the taskbar.
  • 🔌 Move the "Wi-Fi" slider to the off position.
  • ⚙️ Or open "Settings" and select the "Network" section for detailed control.

The graphical method is ideal for everyday use when in-depth diagnostics aren't required. However, it depends on the graphical interface being used. If the system is unstable, this method may be unavailable.

📊 How do you prefer to manage your network in Linux?
Through the graphical interface
Terminal only
Combination of methods
I don't care

Disabling via terminal using nmcli

For more advanced users and system administrators, an indispensable tool is NetworkManager, controlled via a command-line utility nmcliThis method provides complete control over network connections and allows for automation of processes through scripts. The terminal provides access to functions that may be hidden in the graphical interface.

To disable Wi-Fi, you first need to identify the device or connection name. Enter the command nmcli device statusto see a list of all network interfaces. Find the device type in the list wifi and remember its name, usually it is wlo1 or wlan0.

nmcli radio wifi off

This command globally disables the wireless radio module. If you only want to disable a specific connection without disabling the adapter completely, use the command nmcli connection down"Connection_Name"This allows you to keep the adapter active for other tasks if needed.

☑️ Check before disconnecting the network

Completed: 0 / 4

Usage nmcli especially effective on servers without a graphical shell or when accessed remotely via SSHThe commands execute instantly and don't require restarting services. This makes this method preferable for troubleshooting.

Managing systemd network services

In modern versions Ubuntu The service responsible for managing network interfaces is often systemdIn some configurations, especially on server builds, interacting with the NetworkManager or systemd-networkd service. Stopping the service will completely stop network management, which is equivalent to disabling Wi-Fi.

This operation requires superuser privileges. Use the command sudo systemctl stop NetworkManagerto stop the network management service. Please note that this action may disconnect not only the Wi-Fi connection but also the wired connection if it is also managed by this service.

⚠️ Attention: Service stop NetworkManager This may result in loss of remote access to the server if you're working via SSH. Make sure you have physical access to the machine or the recovery console before running this command.

To enable the network again, you will need to start the service with the command sudo systemctl start NetworkManagerThis method is more "rough" and is used primarily to reboot network components during critical failures when standard methods do not work.

It is important to distinguish between stopping a service and disabling an interface. Stopping a service systemd This removes the control layer, but the device driver itself may remain active. To completely power off the device, it's best to use the methods described in the following sections.

Working with kernel modules and rfkill

At the lowest level, wireless adapters are controlled through Linux kernel modules. The utility rfkill Designed specifically for blocking wireless devices, it allows for software-based "disabling" of the device, which is often more effective than simply disconnecting.

First, run the command rfkill listto see a list of all wireless devices and their current status. You'll see the TYPE, DEVICE, and SOFT/HARD BLOCKED columns. To block Wi-Fi, use the command rfkill block wifiThis action will send a signal to the driver to turn off the radio emission.

Team Description of action Access level
rfkill list Shows the status of all devices User
rfkill block wifi Blocks all Wi-Fi devices Superuser
rfkill unblock all Removes all software locks Superuser
rfkill block 0 Blocks the device by index Superuser

If software blocking doesn't help, the device may be hard blocked. This could be a physical switch on the laptop case or a key combination (e.g. Fn + F2). In such cases, software commands rfkill will not take effect until the hardware switch is activated.

What is Hard Block?

A Hard Block means that power to the wireless module is physically blocked either at the BIOS/UEFI level or by a physical switch. OS software cannot bypass this restriction, as the device simply does not respond to data bus requests. To remove the block, you need to locate the physical switch on the laptop case or change the BIOS settings in the Power Management or Wireless section.

Completely disabling a kernel module

In extreme cases, when a device driver is behaving incorrectly, causing overheating, or system crashes, it may be necessary to completely unload the kernel module responsible for the Wi-Fi adapter. This action is equivalent to physically removing the card from the system. To do this, use the command rmmod (remove module).

First, you need to find out the module name. This can be done using the command lspci -k or lsmod | grep wifiMost often, modules have names like iwlwifi (for Intel), ath9k (for Atheros) or rtl8xxx (for Realtek) Let's say your module is called iwlwifi.

sudo rmmod iwlwifi

After running this command, the device will disappear from the list of available network interfaces. To bring it back, use the command sudo modprobe iwlwifiThis method is useful for forcibly reloading a driver without restarting the entire operating system.

Usage rmmod This requires caution. If a module is occupied by other processes, the system will refuse to unload it. In this case, it may be necessary to stop the associated services first. This method is for experienced users who understand the structure of the Linux kernel.

Automation and task scheduler

There is often a need to turn off Wi-Fi on a schedule, for example, at night to save energy or during working hours to comply with corporate security policies. Ubuntu You can use the standard task scheduler for this cronThis allows for the automation of routine actions without human intervention.

To configure, open crontab with the command crontab -eAdd a line that will execute the shutdown command at the specified time. For example, to disable Wi-Fi every day at 11:00 PM, add the following line: 0 23 * /usr/bin/nmcli radio wifi offIt's best to specify the full path to the command so that the scheduler can accurately find the executable file.

  • 🕒 Open the terminal and enter crontab -e.
  • 📝 Add a line with the time and shutdown command.
  • 💾 Save the file and exit the editor.

Don't forget to also set up a task to turn on Wi-Fi in the morning, if needed. For example, at 8:00 AM with the command 0 8 * /usr/bin/nmcli radio wifi onThis approach provides a balance between convenience and resource conservation.

⚠️ Attention: Command line interfaces and package names may vary slightly between versions. Ubuntu (For example, upgrading from version 20.04 to 22.04 or 24.04). Always check your distribution's official documentation for up-to-date command syntax before adding startup tasks.

Diagnosing shutdown problems

Sometimes users encounter a situation where Wi-Fi won't turn off using any of the above methods. The indicator in the interface may be lit, but the network remains active. This often indicates a driver conflict or a device that's stuck. In such cases, a comprehensive diagnostic can help.

Check the system logs for errors related to NetworkManager or the kernel. Command journalctl -u NetworkManager will display the service's event history. Look for any error (ERROR) or warning (WARNING) messages at the time of the shutdown attempt. This will help you understand why the command is being ignored.

It's also worth checking if you have any conflicting network managers installed, such as: wicd And NetworkManager simultaneously. They can interfere with each other's control of the device. Removing the extra packet often solves the "immortal" connection problem.

Comparison of shutdown methods

The method you choose depends on your goal. If you simply need to connect to the internet via cable, a graphical interface will suffice. If you're configuring a server, a terminal is needed. For in-depth diagnostics, working with kernel modules is essential. Understanding the differences allows you to act effectively.

The graphical method is advantageous because it's visual and secure. The terminal offers speed and precision. Working with the kernel provides complete control, but carries risks. Combine these approaches depending on the situation.

The table below provides a brief comparison of the methods considered for quick orientation:

Method Complexity Speed Reliability
Graphical interface Low Average High
Nmcli (Terminal) Average High Very high
Systemd / Services High High Average
Rfkill / Modules High Instant Maximum

By mastering these techniques, you will become a more confident user. UbuntuNetwork management is a fundamental skill that comes in handy when setting up a home lab, a server, or simply optimizing your laptop.

Is it possible to permanently disable Wi-Fi in Ubuntu?

Yes, this can be done by blocking the kernel module in the blacklist configuration. Create a file in /etc/modprobe.d/blacklist-wifi.conf and add a line blacklist module_nameHowever, this will make it impossible to use Wi-Fi until you delete this entry.

Why does the Wi-Fi indicator on my laptop stay on after I turn off Wi-Fi?

The indicator may be lit if only the software level is disabled (connection is lost), but power is supplied to the card. A command is often required to completely turn off the indicator. rfkill block or hardware shutdown using the Fn keys.

Is it safe to use rmmod command on Wi-Fi?

Usage rmmod It's safe if you know the module name and understand the consequences. It won't cause any harm, but it may cause a temporary network outage. Just be sure not to delete modules that are critical to your current session if you're working remotely.

How do I know which driver my Wi-Fi adapter is using?

Use the command lspci -k | grep -A 3 -i networkThe output will contain the line "Kernel driver in use", which indicates the active driver (e.g., iwlwifi, ath10k).