Skip to content

Commit 11e31e3

Browse files
authored
Merge pull request flannel-io#693 from spacexnice/master
Keep route: [ 0.0.0.0/0 via ECS instance ] to work with alicloud DNAT…
2 parents a62ec9f + a69ed95 commit 11e31e3

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

backend/alivpc/alivpc.go

+5
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,11 @@ func (be *AliVpcBackend) recreateRoute(c *ecs.Client, table ecs.RouteTableSetTyp
167167
log.Infof("Keep target entry: rtableid=%s, CIDR=%s, NextHop=%s \n", e.RouteTableId, e.DestinationCidrBlock, e.InstanceId)
168168
continue
169169
}
170+
// 0.0.0.0/0 => ECS1 this kind of route is used for DNAT. so we keep it
171+
if e.DestinationCidrBlock == "0.0.0.0/0" {
172+
log.Infof("Keep route entry: rtableid=%s, CIDR=%s, NextHop=%s For DNAT\n", e.RouteTableId, e.DestinationCidrBlock, e.InstanceId)
173+
continue
174+
}
170175
// Fix: here we delete all the route which targeted to us(instance) except the specified route.
171176
// That means only one CIDR was allowed to target to the instance. Think if We need to change this
172177
// to adapt to multi CIDR and deal with unavailable route entry.

0 commit comments

Comments
 (0)