dhcpcd5: Default route is not added to the routing table if the DHCP server also supplies classless static routes

Bug #2020400 reported by Justin Jereza
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Raspbian
New
Undecided
Unassigned

Bug Description

Platform: Raspberry Pi 1 Model B+ running Raspbian 11 (bullseye)

Configure DHCP server to supply the following to IPv4 clients:

* Default route (RFC 2132 option 3)
* Classless static routes (RFC 3442 option 121)

On boot, running `ip route` shows that only the classless static routes are added. The default route is not added. Furthermore, the machine was running before the classless static routes were added to the DHCP server and the default route was observed to have disappeared at some point after the DHCP server settings were modified, most likely during a lease renewal. As a temporary solution, I have added the default route manually and am observing if that will also disappear at some point in the future.

Running `dhcpcd --dumplease eth0` shows that dhcpcd did receive the `routers` and `classless_static_routes` options.

No similar bug reports have been found for dhcpcd5 on Debian, although there is an RFC 3442 related bug report regarding client misconfiguration in the event of the disappearance of the DHCP server (https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1024208).

I currently don't have the infrastructure to test if it is a problem on Debian as well.

Revision history for this message
Justin Jereza (justinjereza) wrote :

For clarification, I just noticed that I neglected to mention that the Debian bug report I linked is for isc-dhcp-client and not for dhcpcd5 so it's farfetched that it's related. Dhcpcd5 itself on Debian has zero bug reports.

Revision history for this message
Donna Whisnant (dewhisna) wrote :

I encountered a similar issue. However, it seems that `dhcpcd5` is correct on this detail if your classless static routes list on the DHCP server isn't also setting the default route. According to the RFC 3442 spec (https://www.rfc-editor.org/rfc/rfc3442.txt), it states:

> "If the DHCP server returns both a Classless Static Routes option and a Router option, the DHCP client MUST ignore the Router option."

I fixed this specific issue on mine by changing the classless-static-routes to add the default gw route: "0 192 168 1 1", for a default route to 192.168.1.1, to the end of the classless-static-routes list I previously had. And that made my Raspbian install see it and properly set the default gw.

I'm actually struggling with another related issue. While this fixed the default route, it's not setting the other static route that the classless-static-routes list is specifying (though it didn't set it before I fixed this issue either). I'm guessing I have some additional configuration issue somewhere telling it not to add that other route that I haven't resolved yet. And ironically, all of the other clients on my network were previously setting both the default route and the route in classless-static-routes without the classless-static-routes list also specifying the default route (seemingly ignoring the RFC spec in this regard) and they all seem oblivious to this fix (i.e. do doubled up routes or anything).

But try adding the default gw route to your classless-static-route list too and see if that resolves it. You probably want to leave the routers entry too, though, in case there are clients that don't support the classless-static-routes option.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.