The Stubborn Network Connection
Ubuntu’s Network Manager is designed to keep you online with minimal effort. When you connect to a new Wi-Fi network, it saves the credentials and settings. By default, if that network is in range and you aren’t connected to anything else, Ubuntu will automatically attempt to reconnect to it. While usually convenient, this is problematic if you are in an area with multiple saved networks and the system constantly reconnects to a slower, weaker, or captive portal network (like a coffee shop Wi-Fi) that you don’t actually want to use at that moment, overriding your preferred connection.
Disabling Auto-Connect via NMCLI or GUI
To maintain control over which networks you join and stop Ubuntu from automatically reconnecting to a specific, previously saved Wi-Fi network, you must change that network’s profile settings.
You can do this easily through the graphical interface. Click the network icon in the top right corner of your screen, expand the Wi-Fi section, and click Wi-Fi Settings. Find the network you want to stop connecting to automatically in the “Known Networks” list. Click the gear icon (settings) next to it. In the “Details” tab, uncheck the box labeled Connect automatically. Click Apply.
Alternatively, for terminal users, you can use the Network Manager command line interface (nmcli). Open a terminal (Ctrl+Alt+T). List your saved connections by typing nmcli connection show. Note the exact name of the network under the “NAME” column. Then, type the following command, replacing [Network_Name] with the actual name: nmcli connection modify "[Network_Name]" connection.autoconnect no. Press Enter. The system will now ignore that network until you manually select it.