1

I have multiple WiFi networks in range that are set to automatically connect when available, in case one fails. Whenever I try to manually connect to one of them while being connected to another (for example when the current one is slow), I have to try many times, because it usually either switches back to the old network or disconnects from all networks and on the next manual attempt connects back to the old one.

How do I make Debian obey my command and actually switch networks when I tell it to?

Debian 9.6
Cinnamon 3.2.7
network-manager version 1.6.2-3+deb9u2
Tested with network manager applet and system settings->network.

2 Answers 2

1

It is going to connect to the one with the highest signal strength if they are all set to auto. You need to set one on auto and the rest that are in range need to be manual.

1
  • 1
    Well, that's an explanation of why it does that (it's still a bad behaviour to override manual actions), but it doesn't answer how to stop that from happening. Nov 17, 2018 at 14:31
1

Use the nmcli command to set the connection priority :

First set your connection to autoconnect with:

nmcli c mod CONNECTION1 connection.autoconnect yes
...

To list the connection names : nmcli c s

Then set the connection priority:

nmcli c mod CONNECTION1 connection.autoconnect-priority 1
nmcli c mod CONNECTION2 connection.autoconnect-priority 2
...

A high value mean a high priority.

Using the nmcli tool, version 1.6.2 you can check the status autoconnect with:

for i in $(nmcli c s | awk 'NR>1 {print $1}'); do echo $i;  nmcli c s $i | awk '/connection.autoconnect:/ {print $2 "\n"}'; done

The same format to check the connection priority:

for i in $(nmcli c s | awk 'NR>1 {print $1}'); do echo $i;  nmcli c s $i | awk '/connection.autoconnect-priority:/ {print $2 "\n"}'; done
5
  • And how should I set the priorities so that I'm able to manually switch? All the same number? According to the other answer, it would then override my choice with the strongest connection. Nov 17, 2018 at 14:32
  • @FabianRöling The manual switch can be done trough a command (easy). Answer edited to explain how the priority number work.
    – GAD3R
    Nov 17, 2018 at 16:28
  • So you mean I should put shortcuts somewhere that contain scripts that switch to a different network? That would work, but it's not really nice, I would prefer the applet or setting to just do what I tell it to. Nov 17, 2018 at 20:35
  • @FabianRöling It is the same it can be applied from the nm-applet : a right clic on the nm-applet >> Edit connection >> select the connection name >> Edit >> General >> Select Atoconnect ..... then set the priority ...
    – GAD3R
    Nov 17, 2018 at 20:40
  • Yes, but that's a lot of clicks. It's not "making the thing just work". What I expected was: Click on applet, click on network name, it connects. Two clicks. Nov 18, 2018 at 0:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .