{"record":{"id":"fbe849b4a6c708eb","repo":"kubernetes/kops","slug":"no-physical-network-interface-found-with-mac-addre","errorCode":null,"errorMessage":"no physical network interface found with MAC address %q","messagePattern":"no physical network interface found with MAC address %q","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"nodeup/pkg/model/networking/eni_networking.go","lineNumber":238,"sourceCode":"\t\tname := entry.Name()\n\t\t// The scan uses the \"device\" symlink in sysfs to know if an interface is physical.\n\t\tif _, err := os.Stat(filepath.Join(sysClassNet, name, \"device\")); err != nil {\n\t\t\tcontinue\n\t\t}\n\t\taddress, err := os.ReadFile(filepath.Join(sysClassNet, name, \"address\"))\n\t\tif err != nil {\n\t\t\tcontinue\n\t\t}\n\t\tif strings.EqualFold(strings.TrimSpace(string(address)), mac) {\n\t\t\tmatches = append(matches, name)\n\t\t}\n\t}\n\n\tswitch len(matches) {\n\tcase 1:\n\t\treturn matches[0], nil\n\tcase 0:\n\t\treturn \"\", fmt.Errorf(\"no physical network interface found with MAC address %q\", mac)\n\tdefault:\n\t\treturn \"\", fmt.Errorf(\"multiple physical network interfaces found with MAC address %q: %v\", mac, matches)\n\t}\n}\n\n// narrowCloudIfupdownHelperRule rewrites Debian 11's\n// /etc/udev/rules.d/75-cloud-ifupdown.rules to exclude AWS VPC CNI veths.\n// The package-shipped rule matches ENV{INTERFACE}==\"eth*|en*\", which catches\n// real ENIs (ens*) and CNI veths (eni*) alike. For each new netdev,\n// /etc/network/cloud-ifupdown-helper generates a DHCP ifupdown stanza and\n// starts ifup@$IFACE.service. On CNI veths DHCP times out, ifdown then takes\n// the veth DOWN, and pod networking is broken.\n//\n// The rule and helper are written by cloud-init at first boot and are not\n// owned by any dpkg package, so overwriting the file is safe.\n//\n// Debian 11 only.\nfunc narrowCloudIfupdownHelperRule(c *fi.NodeupModelBuilderContext, dist distributions.Distribution) {","sourceCodeStart":220,"sourceCodeEnd":256,"githubUrl":"https://github.com/kubernetes/kops/blob/4c8573c808a73d578c5eadc86d410646ea0b0d73/nodeup/pkg/model/networking/eni_networking.go#L220-L256","documentation":"After scanning physical interfaces (those with a 'device' symlink in sysfs), no entry's 'address' equaled the MAC fetched from IMDS. nodeup refuses to write 75-eni-secondary.network because a wrong match would make systemd-networkd ignore the primary interface and break DNS via systemd-resolved. This is a deliberate safety failure, not a crash.","triggerScenarios":"The MAC from IMDS 'mac' matches zero physical interfaces in /sys/class/net: the scan found no interface whose sysfs address file equals the IMDS MAC (case-insensitive), e.g. interface renamed/replaced after IMDS read, MAC truncated/misparsed, or IMDS returned the MAC of a bond/parent not present as a physical device.","commonSituations":"Non-ENA or virtualized NICs where the interface lacks a 'device' symlink; systems where IMDS mac disagrees with sysfs due to bonding or hot-swap; running nodeup somewhere that is not the actual EC2 instance; custom kernel modules that hide the device link.","solutions":["Compare IMDS MAC to sysfs: for i in /sys/class/net/*; do echo \"$i $(cat $i/address)\"; done and reconcile mismatches","Confirm the instance uses ENA and the primary NIC exposes /sys/class/net/<name>/device (ls -l /sys/class/net/*/device)","Check for bonding/bridging that moved the ENI MAC onto a virtual device — adjust instance networking or run nodeup earlier in boot","Reboot the node to resync IMDS-visible and sysfs state, then re-run nodeup"],"exampleFix":"// diagnostic\nmac=$(TOKEN=$(curl -sX PUT http://169.254.169.254/latest/api/token); curl -sH \"X-aws-ec2-metadata-token: $TOKEN\" http://169.254.169.254/latest/meta-data/mac)\ngrep -ri \"$mac\" /sys/class/net/*/address  # expect exactly one physical match","handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":["Keep IMDS MAC and sysfs in sync; avoid bonding the primary ENI","Smoke-test ENA device symlinks on custom AMIs"],"tags":["linux","network","mac-address","ena"],"backgroundTag":"mac-interface-mismatch","analyzedSha":"4c8573c808a73d578c5eadc86d410646ea0b0d73","analyzedAt":"2026-09-05T04:13:19.212Z","contentChangedAt":"2026-09-05T04:13:19.212Z","schemaVersion":2},"datasetVersion":"2026-09-12T07:17:12.445Z"}