Connman(1)
can be used to prioritize your connections to prefer wired networks and auto-connect to wireles when the wired connection is unavailable. It is supported by Intel, so it can be hostile to non-intel networking hardware: I can't use Connman(1)
since my wifi driver won't set flags Intel expects to enable the adapter. I get "no carrier" error and no wifi connection. However, it seems to connect quickly when I plug in the wired connection.
You need to configure /etc/connman/main.conf/main.conf
with something like:
BackgroundScanning = false
DefaultAutoConnectTechnologies = ethernet,wifi
PreferredTechnologies = ethernet,wifi
SingleConnectedTechnology = true
to ensure only wifi or ethernet is connected. Then, use an interactive connmanctl(1)
session as indicated by the man page to connect to wifi the first time or edit the settings file for your interface found in /var/lib/connman
(this seems easier to me, but restart required.) See connman-service.config(5)
If you have ifupdown
or its variants installed, you might remove those to avoid collisions before installing connman(1)