dhcpcd-discuss

Re: how to configure to accept both additional static routes AND a default gateway

Roy Marples

Sun Jun 14 16:46:58 2020

On 14/06/2020 15:23, Bruce Ferrell wrote:
You have set this config option?
option classless-routes 32, 0,0,0,0, 192,0,2,135, 24, 192,168,22, 192,0,2,135;

Try this instead
option classless-routes 0, 192,0,2,135, 24, 192,168,22, 192,0,2,135;

Roy


It took me a bit to work that syntax out, but that's the configuration that worked for dhcpcd... And without a routers option (which, if set, breaks dhcpcd with no default route set), the windows and android devices failed with no default route.  But it worked for dhcpcd.

dhcpcd will work with that if a routers option is present as well.
If not, then please tell me dhcpcd version.

For reference, dhcpcd gained this option over 15 years ago and was the first open source client to support it.

I also tried:

      option classless-routes 0, 0,0,0,0, 192,0,2,135, 24, 192,168,22, 192,0,2,135;

Which conceptually "matches" route definitions syntactically, but is wrong, and gives a really weird routing table that doesn't work for anybody :-)

No it does not match. Let me explain.

The first byte is the CIDR. A default route has a CIDR of 0.
The next CIDR bytes are the destination address. As the value is 0 for a default route it's length is 0 and thus doesn't exist in this option.
The next 4 bytes are the gateway address.

So effectively you have added this to the routing table
0.0.0.0      0.0.0.0        0.0.0.0 UG

I would not expect that to work.

Let us look at your original route output:
0.0.0.0         192.0.2.135     255.255.255.255 UGH       0 0          0 eth0

That matches your config option where you had a CIDR of 32, which I would not expect to work either.

0, 192,0,2,135,
which will give this
0.0.0.0         192.0.2.135     0.0.0.0 UG       0 0          0 eth0


Every DHCP client that supports this option WILL interpret 0, 192,0,2,135, correctly.

As I said, there are a LOT on non-rfc3442 compliant dhcp clients in the world and accommodating dhcpcd breaks them without doing fiddly things to assure compliant messages are ONLY sent to dhcpcd and any other rfc3442 conformant dhcp client (are there any?).

And this is just bogus.

I use a fairly complex CSR on my home network and I also send a default router option too. dhcpcd works just fine, along side dhclient on FreeBSD/OpenBSD, my kids android tablets and the wifes iPhone as well as my Windows 10 gaming PC.

And did you know that dhcpcd was used in android phones up to I think android-9?
It's still used in ChromeOS last I checked.

Roy

Follow-Ups:
Re: how to configure to accept both additional static routes AND a default gatewayBruce Ferrell
References:
how to configure to accept both additional static routes AND a default gatewayBruce Ferrell
Re: how to configure to accept both additional static routes AND a default gatewayRoy Marples
Re: how to configure to accept both additional static routes AND a default gatewayBruce Ferrell
Re: how to configure to accept both additional static routes AND a default gatewayBruce Ferrell
Re: how to configure to accept both additional static routes AND a default gatewayBruce Ferrell
Re: how to configure to accept both additional static routes AND a default gatewayRoy Marples
Re: how to configure to accept both additional static routes AND a default gatewayBruce Ferrell
Re: how to configure to accept both additional static routes AND a default gatewayRoy Marples
Re: how to configure to accept both additional static routes AND a default gatewayBruce Ferrell
Re: how to configure to accept both additional static routes AND a default gatewayRoy Marples
Re: how to configure to accept both additional static routes AND a default gatewayBruce Ferrell
Archive administrator: postmaster@marples.name