diff --git a/pkg/backend/extension/extension.go b/pkg/backend/extension/extension.go index 6804c5dbb..111a04b5f 100644 --- a/pkg/backend/extension/extension.go +++ b/pkg/backend/extension/extension.go @@ -97,11 +97,18 @@ func (be *ExtensionBackend) RegisterNetwork(ctx context.Context, wg *sync.WaitGr } attrs := lease.LeaseAttrs{ - PublicIP: ip.FromIP(be.extIface.ExtAddr), BackendType: "extension", BackendData: data, } + if be.extIface.IfaceAddr != nil { + attrs.PublicIP = ip.FromIP(be.extIface.IfaceAddr) + } + + if be.extIface.IfaceV6Addr != nil { + attrs.PublicIPv6 = ip.FromIP6(be.extIface.IfaceV6Addr) + } + lease, err := be.sm.AcquireLease(ctx, &attrs) switch err { case nil: diff --git a/pkg/subnet/kube/kube.go b/pkg/subnet/kube/kube.go index e31f60b50..4d8dad237 100644 --- a/pkg/subnet/kube/kube.go +++ b/pkg/subnet/kube/kube.go @@ -393,7 +393,10 @@ func (ksm *kubeSubnetManager) AcquireLease(ctx context.Context, attrs *lease.Lea } } - if (attrs.BackendType == "vxlan" && string(v6Bd) != "null") || (attrs.BackendType == "wireguard" && string(v6Bd) != "null" && attrs.PublicIPv6 != nil) || (attrs.BackendType == "host-gw" && attrs.PublicIPv6 != nil) { + if (attrs.BackendType == "vxlan" && string(v6Bd) != "null") || + (attrs.BackendType == "wireguard" && string(v6Bd) != "null" && attrs.PublicIPv6 != nil) || + (attrs.BackendType == "host-gw" && attrs.PublicIPv6 != nil) || + (attrs.BackendType == "extension" && attrs.PublicIPv6 != nil) { n.Annotations[ksm.annotations.BackendV6Data] = string(v6Bd) if n.Annotations[ksm.annotations.BackendPublicIPv6Overwrite] != "" { if n.Annotations[ksm.annotations.BackendPublicIPv6] != n.Annotations[ksm.annotations.BackendPublicIPv6Overwrite] {