Skip to content

Commit

Permalink
vpcagent: ovn: explicitly include gateway route in classless routes
Browse files Browse the repository at this point in the history
  • Loading branch information
yousong committed May 8, 2020
1 parent 0c45818 commit 5caaccd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkg/vpcagent/ovn/keeper.go
Original file line number Diff line number Diff line change
Expand Up @@ -142,14 +142,18 @@ func (keeper *OVNNorthboundKeeper) ClaimNetwork(ctx context.Context, network *ag
Type: "localport",
Addresses: []string{fmt.Sprintf("%s %s", mdMac, mdIp)},
}
routes := []string{
mdIp, "0.0.0.0",
"0.0.0.0/0", network.GuestGateway,
}
dhcpopts := &ovnutil.DHCPOptions{
Cidr: fmt.Sprintf("%s/%d", network.GuestIpStart, network.GuestIpMask),
Options: map[string]string{
"server_id": network.GuestGateway,
"server_mac": dhcpMac,
"lease_time": fmt.Sprintf("%d", 86400),
"router": network.GuestGateway,
"classless_static_route": fmt.Sprintf("{%s/32,0.0.0.0}", mdIp),
"classless_static_route": fmt.Sprintf("{%s}", strings.Join(routes, ",")),
},
ExternalIds: map[string]string{
externalKeyOcRef: network.Id,
Expand Down

0 comments on commit 5caaccd

Please sign in to comment.