public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH container/manager 0/2] fix #3413: Add `Disconnect` option for LXC networks
@ 2023-02-13 13:56 Christoph Heiss
  2023-02-13 13:56 ` [pve-devel] [PATCH container 1/2] net: Add `link_down` config to allow setting interfaces as disconnected Christoph Heiss
  2023-02-13 13:57 ` [pve-devel] [PATCH manager 2/2] lxc: Add `Disconnect` option for network interfaces Christoph Heiss
  0 siblings, 2 replies; 8+ messages in thread
From: Christoph Heiss @ 2023-02-13 13:56 UTC (permalink / raw)
  To: pve-devel

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





^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-02-14 10:20 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-13 13:56 [pve-devel] [PATCH container/manager 0/2] fix #3413: Add `Disconnect` option for LXC networks Christoph Heiss
2023-02-13 13:56 ` [pve-devel] [PATCH container 1/2] net: Add `link_down` config to allow setting interfaces as disconnected Christoph Heiss
2023-02-13 14:31   ` Wolfgang Bumiller
2023-02-14  9:29     ` Christoph Heiss
2023-02-14  9:52   ` Thomas Lamprecht
2023-02-14 10:10     ` Christoph Heiss
2023-02-14 10:20       ` Thomas Lamprecht
2023-02-13 13:57 ` [pve-devel] [PATCH manager 2/2] lxc: Add `Disconnect` option for network interfaces Christoph Heiss

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal