The Persistent Connection
Ubuntu is designed to remember your hardware states to provide a seamless experience. However, a common issue arises with the Wi-Fi adapter on laptops. If you manually turn off your Wi-Fi (perhaps you are plugging into a secure Ethernet connection, or you want to save battery while working offline), you might expect it to stay off. Instead, if you reboot your computer or wake it from suspension, Ubuntu will often automatically re-enable the Wi-Fi adapter and attempt to connect to nearby networks. This persistent behavior overrides your manual hardware choices and can be a security concern if you strictly intended to remain disconnected.
Enforcing Airplane Mode Rules
To ensure your hardware respects your commands across reboots and stop Ubuntu from automatically turning on your Wi-Fi adapter, you must adjust the Network Manager configuration.
The most reliable way to enforce this is by modifying the Network Manager’s state file, though this requires terminal access. Open your terminal (Ctrl+Alt+T). Type sudo nano /var/lib/NetworkManager/NetworkManager.state and press Enter (you will need your administrator password). This file stores the status of your networking hardware. Look for the line that says WirelessEnabled=true. Change the “true” to “false”. Press Ctrl+O to save, Enter to confirm, and Ctrl+X to exit the nano editor. By forcing this state in the configuration file, you instruct the Network Manager daemon that the default state upon startup or wake should be disabled, ensuring the Wi-Fi remains off until you manually click the icon to turn it back on.