Is there a way to permanently configure the /etc/systemd/network/eth*.network of a LXC?

Anotheruser

Member
Sep 21, 2022
63
16
8
Currently messing around with lxc containers and trying to add a lxc to more than 10 vlans.

Since this isnt possible via the proxmox ui (can only add max 10 interfaces) i did it inside the container, which works perfectly (see below),
the only issue proxmox overwrites the /etc/systemd/network/eth*.network on every container reboot and i kinda dont want to create a script that runs after every boot just adding it back.

Is there a way to prevent this or alternatively add additional arguments to the interfaces via lxc.conf?

Any advice appreciated :)

Setup inside the LXC
Code:
## /etc/systemd/network/eth1.network

[Match]
Name = eth1

[Network]
Description = Interface eth1 autoconfigured by PVE
DHCP = no
IPv6AcceptRA = false
VLAN=vlan10
VLAN=vlan20
VLAN=vlan30

One for Each VLAN, just replace the VLAN IDs
Code:
## /etc/systemd/network/vlan10.netdev

[NetDev]
Name=vlan10
Kind=vlan

[VLAN]
Id=690
Parent=eth1

Code:
## /etc/systemd/network/vlan10.network

[Match]
Name=vlan10

[Network]
DHCP=yes
 
Last edited:
  • Like
Reactions: Kingneutron

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!