[clug] What could be stopping dhclient from setting the default route?

Tony Lewis tony at lewistribe.com
Thu Feb 2 02:19:35 UTC 2023


Almost a year after bringing this up, I stumbled across the solution.

For reasons forgotten, I had configured the DHCP server to offer DHCP 
option 121, which is a list of classless static routes.  The DHCP client 
on Ubuntu server (not sure why not Ubuntu desktop) is configured to not 
apply a default route if this option is present.  The configuration can 
be changed in the DHCP client on the server, but the better solution is 
to not offer option 121, and currently this is working.

Ref: 
https://askubuntu.com/questions/767002/dhcp-connection-does-not-set-default-gateway-automatically

Tony

On 14/2/22 11:10, Tony Lewis wrote:
>
> I am installing a couple of servers; at the moment, using a very basic 
> Ubuntu 20.04 install.  When configuring the network, it selected DHCP 
> and showed a valid IP, and I leave it at that. However after booting 
> up, there is no default route set.  I can't figure out why it's not 
> being set.
>
> I can add the default route from the command line, and everything 
> works until a reboot or until dhclient decides to refresh things.  I 
> have used wireshark to determine that the default route is being sent 
> from the DHCP server, both as an option 3 and as a "Next Server IP 
> Address".
>
> I have tried disabling apparmor (there was indications that a dhclient 
> script was getting blocked), and I've tried tweaking parameters in my 
> server's dnsmasq config, but nothing seems to help.  I've also 
> upgraded everything to the latest Ubuntu 20.04 packages.
>
> Google shows that some people report problems like this, but they 
> aren't exactly the same, and most are old.  Either way they don't 
> solve things for me.
>
> Any clues?
>
> Tony
>


More information about the linux mailing list