net: Add `link_down` config to allow setting interfaces as disconnected
If this network option is set, the host-side link will be forced down
and the interface won't be connected to the bridge.
Add 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, especially considering we already support the same thing
for VMs.
[0] https://bugzilla.proxmox.com/show_bug.cgi?id=3413
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.
[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
Thus force the host-side link of the container network down and avoid
adding it to the designated bridge if the new option is set, effectively
disconnecting the container network.
Signed-off-by: Christoph Heiss <c.heiss@proxmox.com>
Tested-by: Friedrich Weber <f.weber@proxmox.com>
[ T: paste cover letter as commit message ]
Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>