On Wed, Aug 17, 2022 at 07:40:04PM -0700, Noah Meyerhans wrote:
> Adding some tracing to the dhclient-script, I can see that
> /etc/dhcp/dhclient-exit-hooks.d/rfc3442-classless-routes is trying to add
> the routes with calls like:
> 
> ip -4 route add 169.254.169.254/32 via 169.254.0.1 dev ens5
> 
> However, because there's no route to 169.254.0.1, the call fails with
> "Error: Nexthop has invalid gateway."
> 
> On systems where the routes are properly configured, there's a link scope
> route to that address, e.g. on sid:
> 
> 169.254.0.1 dev ens5 proto dhcp scope link src 169.254.2.187 metric 100
> 
> If we create this route on bullseye, then the rest of the IPv4 routes are
> installed as expected.  Something like the following could work, but I'm
> open to other options:
> 
> services/admin@i-07e63055bb304147c:~$ cat /etc/dhcp/dhclient-exit-hooks.d/gw
> case "$reason" in
>   BOUND|RENEW|REBIND|REBOOT)
>         if [ -z "$old_ip_address" ] ||
>            [ "$old_ip_address" != "$new_ip_address" ]; then
>                 case "$new_ip_address" in
>                   169.254.*)
>                         ip -4 ro add 169.254.0.1 dev "$interface" scope link

Should this also have "src $new_ip_address"?  I can't think of a case where it
would clearly make a difference, but it might be worth matching sid exactly.

Ross

Reply via email to