I deployed an Ubuntu 24.04 LXC with multiple network devices (eth0, eth15, eth20, eth25...eth60) each on it's own vlan. In the LXC I created Docker macvlan networks and attached each to it's corresponding network device so I can setup various containers on different vlans. However, each network device was set as the default route which created problems.
So I added this to the end of: /etc/systemd/network/eth0.network (which I want as my default route):
and added this to the end of each: /etc/systemd/network/eth{15,20,25...60}.network
I also created /etc/systemd/network/.pve-ignore.eth{0,15,20,25...60}.network files so my changes would persist through reboots.
Everything seems to work so far but is this best practice or is there a better way to accomplish this?
So I added this to the end of: /etc/systemd/network/eth0.network (which I want as my default route):
Bash:
[DHCPv4]
RouteMetric=100
and added this to the end of each: /etc/systemd/network/eth{15,20,25...60}.network
Bash:
[DHCPv4]
UseRoutes=false
I also created /etc/systemd/network/.pve-ignore.eth{0,15,20,25...60}.network files so my changes would persist through reboots.
Everything seems to work so far but is this best practice or is there a better way to accomplish this?