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

networkd: avoid managing MAC addresses for veth devices #33

Merged
merged 1 commit into from
Jan 4, 2021

Conversation

margamanterola
Copy link
Contributor

@margamanterola margamanterola commented Jan 4, 2021

When a veth device is created, the CNI in charge of bringing the device up will set a MAC address. If MACAddressPolicy=permanent is set, systemd will change it to a different one, causing dropped packets due to mismatches.

With this change, the address set when the device is created will remain untouched by systemd.

See flatcar/Flatcar#278 for more information.

Testing done

I've tested this manually, by creating the equivalent /etc file. I haven't tested it using a generated image. We currently don't have any kola tests that catch this, because we aren't testing any CNIs that use this. We already have a rule in place for flannel, the only one that we do test.

When a veth device is created, the CNI in charge of bringing the device
up will set a MAC address, if `MACAddressPolicy=permanent` is set,
systemd will change it to a different one, causing dropped packets due
to mismatches.

With this change, the address set when the device is created will remain
untouched by systemd.

See flatcar/Flatcar#278 for more information.
@margamanterola margamanterola requested a review from a team January 4, 2021 16:09
@margamanterola margamanterola merged commit 959ca2e into flatcar-master Jan 4, 2021
@margamanterola margamanterola deleted the marga-kinvolk/veth branch January 4, 2021 16:42
jepio pushed a commit that referenced this pull request Feb 21, 2022
dracut/99emergency-timeout/timeout.sh: fix heredoc leak into arguments
zmrow added a commit to zmrow/bottlerocket that referenced this pull request Mar 3, 2022
This change adds a default network configuration .link file that
`systemd-udev` will use when configuring new interfaces.  It contains
the default list of policies that are used when naming interfaces, as
well as the policy by which the MAC address should be set.

Bottlerocket packages its own version of this file rather than the
default from systemd for a few reasons. 1) Bottlerocket does not
create/use a udev hwdb (we disable the option in systemd compile flags),
so we remove this option from the NamePolicy list, 2) CNI plugins can be
confused when MAC addresses change for virtual interfaces, so
Bottlerocket sets the default MACAddress Policy to "none" which
directs systemd not to attempt to manage the MAC.  Hardware usually has
a MAC, and veth devices used by CNI generally get a MAC generated by the
plugin.

Additional information about the MAC address issue:
systemd/systemd#3374 (comment)
flatcar/Flatcar#278
flatcar/init#33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants