diff --git a/internal/app/networkd/pkg/nic/nic.go b/internal/app/networkd/pkg/nic/nic.go index 37cb12095..0dc939b20 100644 --- a/internal/app/networkd/pkg/nic/nic.go +++ b/internal/app/networkd/pkg/nic/nic.go @@ -367,9 +367,15 @@ func (n *NetworkInterface) configureInterface(method address.Addressing, link *n gw = nil } - // Any errors here would be non-fatal, so we'll just ignore them - //nolint: errcheck - n.rtnlConn.RouteAddSrc(method.Link(), *r.Dest, method.Address(), gw) + src := method.Address() + // if destination is the ipv6 route,and gateway is LL do not pass a src address to set the default geteway + if net.IPv6zero.Equal(r.Dest.IP) && gw.IsLinkLocalUnicast() { + src = nil + } + + if err := n.rtnlConn.RouteAddSrc(method.Link(), *r.Dest, src, gw); err != nil { + log.Println("failed to configure route: " + err.Error()) + } } return nil