Skip to content

Commit

Permalink
fix: set route to metaserver for scaleway platform
Browse files Browse the repository at this point in the history
Set default route to metaserver, which exists only on eth0 interface.

Signed-off-by: Serge Logvinov <[email protected]>
Signed-off-by: Andrey Smirnov <[email protected]>
  • Loading branch information
sergelogvinov authored and smira committed Feb 25, 2022
1 parent eb40b92 commit 79d9720
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,21 @@ func (s *Scaleway) ParseMetadata(metadataConfig *instance.Metadata) (*runtime.Pl
ConfigLayer: network.ConfigPlatform,
})

gw, _ := netaddr.ParseIPPrefix("169.254.42.42/32") //nolint:errcheck
route := network.RouteSpecSpec{
ConfigLayer: network.ConfigPlatform,
OutLinkName: "eth0",
Destination: gw,
Table: nethelpers.TableMain,
Protocol: nethelpers.ProtocolStatic,
Type: nethelpers.TypeUnicast,
Family: nethelpers.FamilyInet4,
Priority: 1024,
}

route.Normalize()
networkConfig.Routes = []network.RouteSpecSpec{route}

networkConfig.Operators = append(networkConfig.Operators, network.OperatorSpecSpec{
Operator: network.OperatorDHCP4,
LinkName: "eth0",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,18 @@ links:
type: netrom
layer: platform
routes:
- family: inet4
dst: 169.254.42.42/32
src: ""
gateway: ""
outLinkName: eth0
table: main
priority: 1024
scope: link
type: unicast
flags: ""
protocol: static
layer: platform
- family: inet6
dst: ""
src: ""
Expand Down

0 comments on commit 79d9720

Please sign in to comment.