Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove a handful of NetworkManager hacks #633

Merged
merged 2 commits into from
May 6, 2022

Conversation

monstermunchkin
Copy link
Member

  • udev: Allow NetworkManager to manage veth interfaces
  • main: Stop doing terrible things to NetworkManager
  • main: Restrict veth rule to udev systems only

This supersedes #602.

distrobuilder/main.go Outdated Show resolved Hide resolved
distrobuilder/main.go Outdated Show resolved Hide resolved
Let's drop a bunch of arcane hacks that are no longer needed now that
NetworkManager treats the veth eth0 just like an ordinary Ethernet.

Namely:

1.) Don't force eth0 up. NetworkManager will just bring it up itself,
    just like a regular Ethernet.

2.) Don't force the device down. NetworkManager doesn't care and it
    hasn't cared for many years.

Apart from these things being unnecessary, they make assumtions that are
not correct; such as the connection being called "System eth0". That is
a name generated by the ifcfg compat layer that is going away in next
Fedora release.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Signed-off-by: Thomas Hipp <thomas.hipp@canonical.com>
NetworkManager ships with an udev rule that excludes veth devices.
The reason is that veths are often used by tooling that would be unhappy
if NetworkManager interfered.

In containers where /sys is read-only (such as libvirt's LXC backend),
systemd-udev is not used and NetworkManager is happy to manage them.
With LXD, however, /sys is mounted read-write and systemd-udev runs.

While some future version of NetworkManager might solve this somehow,
we need this to work with existing versions. Let's just override
the rule in question with something that works well with LXD.

Signed-off-by: Lubomir Rintel <lkundrak@v3.sk>
Signed-off-by: Thomas Hipp <thomas.hipp@canonical.com>
@stgraber stgraber merged commit fd10001 into lxc:master May 6, 2022
monstermunchkin added a commit to monstermunchkin/distrobuilder that referenced this pull request Jun 13, 2022
This reintroduces one of the NetworkManager workarounds which was
removed in lxc#633. Without the workaround, some containers only get an
IPv4 address after a container reboot.

Signed-off-by: Thomas Hipp <thomas.hipp@canonical.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants