Filter pod route destined to default gateway
Do not pass a static route that has destination IP
of the default gateway.
@@ -337,7 +337,7 @@ func discoverPodNetworkInterface(nic *VIF) (netlink.Link, error) {
if len(routes) > 1 {
// Filter out irrelevant routes
for _, route := range routes[1:] {
- if !route.Src.Equal(nic.IP.IP) {
+ if !route.Src.Equal(nic.IP.IP) && !route.Dst.IP.Equal(nic.Gateway) {
dhcpRoutes = append(dhcpRoutes, route)
}
}
