Closed jeffmccune closed 5 years ago
Note, /usr/sbin/dhclient-script
does not set $routers
when classless static routes are provided by the DHCP server, which is the case for secondary network interfaces in GCP:
402 if [ -n "${new_classless_static_routes}" ] ||
403 [ -n "${new_static_routes}" ]; then
404 if [ -n "${new_classless_static_routes}" ]; then
405 IFS=', |' static_routes=(${new_classless_static_routes})
406 # If the DHCP server returns both a Classless Static Routes option and
407 # a Router option, the DHCP client MUST ignore the Router option. (RFC3442)
408 new_routers=""
409 else
410 IFS=', |' static_routes=(${new_static_routes})
411 fi
This means we can't rely on dhclient to provide the gateway IP address for non-primary interfaces.
Fixed in 0.5.0
Summary
Consider a vpc-link instance which has completed startup and is forwarding packets correctly. When the
google-network-daemon
service is restarted, the instance no longer forwards packets correctly.When a client (10.19.16.45) on the local VPC attached to eth1, which pings
10.0.0.6
in the shared VPC, the ICMP reply generates a huge number of packets which are "stuck" in eth0:On the client (10.19.16.45) instance:
On the IP router instance, note the ICMP echo reply getting "stuck" in of eth0, when it should be forwarded out eth1.
Root cause
The
default via 10.0.3.1 dev eth1
route should exist intable rt1
, but does not afterdhclient eth1
completes, run bygoogle-network-daemon
:Correct table
Incorrect table
The following is the table rt1 after dhclient operates against eth1. Note the missing default route, which causes the packet to go back out
eth0
.Next steps
ip route add default via "${gateway}" dev eth1 table rt1
using a dhclient exit hook./etc/hosts
to easily track cases:Verification