Selector under Settings>System>Network that sets default adapter

I was able to set my default network adapter from enp0s20 to enp0s18. I have changed the metric with nmcli.

My HA versions:

  • OS Version: Home Assistant OS 11.2
  • Home Assistant Core: 2023.12.3

Here is what I did:

$ ssh ha
...
➜  ~ docker exec homeassistant ip route
default via 10.10.10.1 dev enp0s20  src 10.10.10.2  metric 100
default via 192.168.8.1 dev enp0s18  src 192.168.8.2  metric 101
default via 10.10.100.1 dev enp0s19  src 10.10.100.2  metric 102
10.10.10.0/24 dev enp0s20 scope link  src 10.10.10.2  metric 100
10.10.100.0/24 dev enp0s19 scope link  src 10.10.100.2  metric 102
172.30.32.0/23 dev hassio scope link  src 172.30.32.1
172.30.232.0/23 dev docker0 scope link  src 172.30.232.1
192.168.8.0/24 dev enp0s18 scope link  src 192.168.8.2  metric 101

➜  ~ nmcli  con sh --active
NAME                UUID                                  TYPE      DEVICE
Supervisor enp0s18  x                                     ethernet  enp0s18
Supervisor enp0s19  y                                     ethernet  enp0s19
Supervisor enp0s20  z                                     ethernet  enp0s20

➜  ~ nmcli connection modify "Supervisor enp0s20" ipv4.route-metric 103
➜  ~ nmcli connection modify "Supervisor enp0s20" ipv6.route-metric 103
➜  ~ nmcli connection up "Supervisor enp0s20"
Connection successfully activated (D-Bus active path: /org/freedesktop/NetworkManager/ActiveConnection/7)

Reboot HA.

$ ssh ha
...
➜  ~ docker exec homeassistant ip route
default via 192.168.8.1 dev enp0s18  src 192.168.8.2  metric 100
default via 10.10.100.1 dev enp0s19  src 10.10.100.2  metric 101
default via 10.10.10.1 dev enp0s20  src 10.10.10.2  metric 103
10.10.10.0/24 dev enp0s20 scope link  src 10.10.10.2  metric 103
10.10.100.0/24 dev enp0s19 scope link  src 10.10.100.2  metric 101
172.30.32.0/23 dev hassio scope link  src 172.30.32.1
172.30.232.0/23 dev docker0 scope link  src 172.30.232.1
192.168.8.0/24 dev enp0s18 scope link  src 192.168.8.2  metric 100

On the UI (Settings → System → Network → Network adapter) I can see the change as well.

2 Likes