[pve-devel] [PATCH pve-network 3/6] sdn: controller: prevent invalid router-id generation from zero mac
Hannes Laimer
h.laimer at proxmox.com
Thu Jan 22 14:51:48 CET 2026
When a standard loopback interface is used, the retrieved MAC is
typically 00:00:00:00:00:00. This causes the router-id generation logic
to produce "0.0.0.0", which is an invalid BGP ID.
Explicitly check for a zero MAC address and fail with a descriptive
error.
Signed-off-by: Hannes Laimer <h.laimer at proxmox.com>
---
src/PVE/Network/SDN/Controllers/Plugin.pm | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/PVE/Network/SDN/Controllers/Plugin.pm b/src/PVE/Network/SDN/Controllers/Plugin.pm
index cab036a..45e2f46 100644
--- a/src/PVE/Network/SDN/Controllers/Plugin.pm
+++ b/src/PVE/Network/SDN/Controllers/Plugin.pm
@@ -120,6 +120,11 @@ sub get_router_id {
die "can't autofind a router-id value from ip or mac" if !$mac;
+ if ($mac eq '00:00:00:00:00:00') {
+ die "Interface $iface has a zero MAC address. Cannot derive a BGP router-id. "
+ . "Please use a dummy interface or assign an IPv4 address to $iface.\n";
+ }
+
my @mac_bytes = split(':', $mac);
return
hex($mac_bytes[2]) . "."
--
2.47.3
More information about the pve-devel
mailing list