I have a Debian Linux server and two wireless networks, A and B.
Network A is the preferred, faster network. B serves as backup.
Therefore I have set both to connect automatically in NetworkManager using nmcli
(connection.autoconnect: yes
) and given network A a higher priority (connection.autoconnect-priority
).
It mostly works fine. When I power up the server and both networks are available, it will automatically connect to network A.
A problem arises due to specific conditions at this location. We have daily, short power cuts. The server is hooked to an UPS (Uninterruptible Power Supply) so it survives power cuts. Network B is powered by an UPS as well. Network A is not so it goes down when there is a power cut. The server then automatically connects to network B.
The power is then restored and network A goes back up. However the server does not seem to care and stays connected to network B until I log in and manually switch it to network A, which would then stay valid until the next power cut.
How do I make it so that the OS would detect the favorite network becoming available and automatically reconnect to it?