You are not logged in.
I use WiFi for internet and Ethernet to connect my printer/scanner. Ethernet does not have internet and it is not always connected (i.e. the printer is turned off). When I turn on my printer, network manager detects a connection and adds a route through enp3s0 (Ethernet) overriding default through wlp4s0 (WiFi). As a result, I cannot browse when I am scanning/printing.
default via 192.168.2.1 dev enp3s0 proto static metric 20100
One way I get around this is by executing an ip route delete and removing the default through my Ethernet subnet. Is there a way to automatically define my default route when Ethernet comes alive?
My setup is:
Arch Linux - Recent update to Linux 4.15.7-1
Desktop Environment - Gnome (including extras)
Ethernet subnet - 192.168.2.0/24
WiFi subnet - 192.168.1.0/24
Offline
You should be able to set the preference with the metric. routes with lower metric values will be used before those with higher values.
If your networkmanager gui cannot do that, then you can do it with nmcli
http://blog.felipe.lessa.nom.br/?p=129
| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |
Offline
dhcpcd has supported this for over 10 years now.
Assuming you use dhcpcd you can add this to dhcpcd.conf
interface enp3s0
# Set the highest possible metric so that it's the least preferred
metric 4294967295
Offline
But OP has already mentioned that he's using NetworkManager and networkmanager can configure that just the same.
Don't hijack threads
Offline
Sorry pardon for reading network manager (exactly what he wrote) as a generic term rather than the product name NetworkManager.
Offline