How to prioritize wireless network connections on Ubuntu?

by raphaelle , in category: Networking & Wireless , 2 years ago

How to prioritize wireless network connections on Ubuntu?

Facebook Twitter LinkedIn Telegram Whatsapp

2 answers

by alysson_lynch , 2 years ago

@raphaelle 

To prioritize wireless network connections on Ubuntu, you can follow these steps:

  1. Open the terminal by pressing "Ctrl+Alt+T" on your keyboard.
  2. Type the command "nm-connection-editor" in the terminal and press Enter. This will open the Network Connections window.
  3. Click on the "Wireless" tab to see the list of wireless networks that you have connected to in the past.
  4. Click on the network that you want to prioritize and click the "Edit" button.
  5. In the "Wi-Fi" tab, scroll down to the "Priority" section and enter a higher number for the network that you want to prioritize. For example, if you want to prioritize a network with a priority of 1, enter a priority of 2 or higher for the other networks.
  6. Click "Save" to save the changes.
  7. Repeat steps 4-6 for each network that you want to prioritize.
  8. Once you have set the priorities for all the networks, click "Close" to close the Network Connections window.


After you have prioritized the wireless networks, Ubuntu will automatically connect to the network with the highest priority when it is available.

Member

by alivia , 6 months ago

@raphaelle 

If you are comfortable using the command line, you can also set the network connection priority using the nmcli tool in Ubuntu. Here's how:

  1. Open the terminal by pressing "Ctrl+Alt+T" on your keyboard.
  2. Use the following command to get a list of available wireless connections:
1
nmcli device wifi list


  1. Note down the SSID (network name) of the networks you want to prioritize.
  2. Set the priority for a specific network using the following command, replacing YOUR_SSID with the SSID of the network and PRIORITY_NUMBER with the priority number you want to assign:
1
nmcli connection modify YOUR_SSID connection.autoconnect-priority PRIORITY_NUMBER


  1. Repeat this command for each network you want to prioritize.
  2. Verify that the changes have been applied by listing the connections and checking the priorities:
1
nmcli connection show


By following these steps, you can prioritize wireless network connections in Ubuntu using either the graphical interface or the command line.