aws: do not set the primary network interface to "Unmanaged=yes" - #18642
Merged
kubernetes-prow[bot] merged 2 commits intoJul 30, 2026
Merged
kubernetes-prow[bot] merged 2 commits into
kubernetes-prow[bot] merged 2 commits into
Conversation
The file "10-eni-secondary.network" causes systemd-networkd to ignore the secondary ENIs. Before this change, the file found the secondary ENIs by their interface names. The names were correct only if the primary network interface had the name "ens5". But the interface names are different for each instance family and each systemd naming scheme. On Graviton4 instances, the primary network interface has the name "ens34". The file also found this interface. Thus systemd-networkd ignored the primary network interface, and systemd-resolved had no DNS servers for it. On 8th-generation Intel instances, the interfaces have the names "enp39s0" and "enp40s0". The file did not find these interfaces. Thus the secondary ENIs had no protection. With this change, the file finds all the interfaces that use the "ena" driver, but does not include the primary network interface. To find the primary network interface, nodeup reads the primary MAC address from the instance metadata and compares it with the sysfs data. The file uses the udev property "INTERFACE" for this, because a "Name=" entry also agrees with the alternative names of an interface.
hakman
force-pushed
the
aws-eni-unmanaged-primary-interface
branch
from
July 30, 2026 06:39
5f9892c to
ef79039
Compare
systemd-networkd uses the first file that agrees with an interface.
With the number 75, the per-interface files ("10-netplan-*" on Debian,
"70-*" on AL2023) come before this file. Thus the primary network
interface keeps its own file, and this gives more protection against
an incorrect match. The number 75 also comes before the AL2023
catch-all file "80-ec2.network". Thus the secondary ENIs stay
unmanaged.
Tests on EC2 (Debian 12 and AL2023, c8g.medium) show this order: the
primary network interface keeps its per-interface file, also without
the "Property=" exclusion, and a hot-attached ENI stays unmanaged.
rifelpet
approved these changes
Jul 30, 2026
Contributor
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: rifelpet The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Member
|
Wow - thanks for fixing. Is there similar code in EKS or AWS-VPC-CNI - it feels like it would be a problem there also? |
kubernetes-prow Bot
added a commit
that referenced
this pull request
Jul 30, 2026
…-upstream-release-1.36 Automated cherry pick of #18642: aws: do not set the primary network interface to "Unmanaged=yes"
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The file "10-eni-secondary.network" causes systemd-networkd to ignore the secondary ENIs. Before this change, the file found the secondary ENIs by their interface names. The names were correct only if the primary network interface had the name "ens5". But the interface names are different for each instance family and each systemd naming scheme.
On Graviton4 instances, the primary network interface has the name "ens34". The file also found this interface. Thus systemd-networkd ignored the primary network interface, and systemd-resolved had no DNS servers for it.
On 8th-generation Intel instances, the interfaces have the names "enp39s0" and "enp40s0". The file did not find these interfaces. Thus the secondary ENIs had no protection.
With this change, the file finds all the interfaces that use the "ena" driver, but does not include the primary network interface. To find the primary network interface, nodeup reads the primary MAC address from the instance metadata and compares it with the sysfs data. The file uses the udev property "INTERFACE" for this, because a "Name=" entry also agrees with the alternative names of an interface.
/cc @rifelpet @ameukam