diff --git a/internal/app/machined/pkg/controllers/network/route_config.go b/internal/app/machined/pkg/controllers/network/route_config.go index 1a855f7c8..00f41a8ed 100644 --- a/internal/app/machined/pkg/controllers/network/route_config.go +++ b/internal/app/machined/pkg/controllers/network/route_config.go @@ -351,9 +351,11 @@ func (ctrl *RouteConfigController) processMachineConfig(linkConfigs []cfg.Networ } family := nethelpers.FamilyInet4 + outLinkName := "" if destination.Addr().Is6() { family = nethelpers.FamilyInet6 + outLinkName = "lo" } route := network.RouteSpecSpec{ @@ -362,7 +364,7 @@ func (ctrl *RouteConfigController) processMachineConfig(linkConfigs []cfg.Networ Table: nethelpers.TableMain, Protocol: nethelpers.ProtocolStatic, Type: nethelpers.TypeBlackhole, - OutLinkName: "lo", + OutLinkName: outLinkName, ConfigLayer: network.ConfigMachineConfiguration, Priority: blackholeRouteConfig.Metric().ValueOr(network.DefaultRouteMetric), } diff --git a/internal/app/machined/pkg/controllers/network/route_config_test.go b/internal/app/machined/pkg/controllers/network/route_config_test.go index c567a40f1..3f201f0cc 100644 --- a/internal/app/machined/pkg/controllers/network/route_config_test.go +++ b/internal/app/machined/pkg/controllers/network/route_config_test.go @@ -274,7 +274,7 @@ func (suite *RouteConfigSuite) TestMachineConfiguration() { asrt.Equal(nethelpers.FamilyInet4, r.TypedSpec().Family) asrt.EqualValues(network.DefaultRouteMetric, r.TypedSpec().Priority) case "configuration/inet4//10.1.3.4/32/300": - asrt.Equal("lo", r.TypedSpec().OutLinkName) + asrt.Empty(r.TypedSpec().OutLinkName) asrt.Equal(nethelpers.FamilyInet4, r.TypedSpec().Family) asrt.EqualValues(300, r.TypedSpec().Priority) asrt.Equal(nethelpers.TypeBlackhole, r.TypedSpec().Type)