This adds a `Disconnect` option for network interfaces on LXC containers, much like it already exists for VMs. This has been requested in #3413 [0] and seems useful, esp. considering we already support the same thing for VMs.
One thing to note is that LXC does not seem to support the notion of setting an interface down. The `flags` property would suggest that this possible [1], but AFAICS it does not work. I tried setting the value as empty and to something else than "up" (since that is really the only supported option [2][3]), which both had absolutely no effect. The solution was to force the host-side link of the container network down, thus effectively becoming "physically" disconnected. [0] https://bugzilla.proxmox.com/show_bug.cgi?id=3413 [1] https://linuxcontainers.org/lxc/manpages/man5/lxc.container.conf.5.html#lbAO [2] https://github.com/lxc/lxc/blob/08f0e769/src/lxc/confile.c#L453-L467 [3] https://github.com/lxc/lxc/blob/08f0e769/src/lxc/confile.c#L5933-L5952 pve-container: Christoph Heiss (1): net: Add `link_down` config to allow setting interfaces as disconnected src/PVE/LXC.pm | 20 +++++++++++++------- src/PVE/LXC/Config.pm | 5 +++++ src/lxcnetaddbr | 3 ++- 3 files changed, 20 insertions(+), 8 deletions(-) pve-manager: Christoph Heiss (1): lxc: Add `Disconnect` option for network interfaces www/manager6/Parser.js | 3 +++ www/manager6/lxc/Network.js | 13 +++++++++++++ 2 files changed, 16 insertions(+) -- 2.39.1 _______________________________________________ pve-devel mailing list pve-devel@lists.proxmox.com https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel