Is it possible to set the metric on the ethernet bridges?

stevelup

New Member
Feb 20, 2023
2
0
1
Hi

I've got several containers that have two bridged ethernet adapters. One of them is 'unfiltered' internet access, the other is via a VPN.

The problem is that on all the containers, both ethernet interfaces have the same metric (1024) and are both set as the default gateway so traffic just randomly gets routed to the two interfaces.

I would prefer one to have a higher metric than the other (or indeed, for the other not to be a default gateway at all).

Is this achievable?

Thanks!
 
I've solved this, posting here in case anyone else needs this in the future, or in case I did something stupid but...

I added...

Code:
[DHCPv4]
RouteMetric = 100

... to /etc/systemd/network/eth0.network and then made that file non-overwritable using the .pve-ignore directive.