dhcpcd-discuss

Re: Option 121 Classless Static Routes

Roy Marples

Thu Apr 05 08:50:28 2018

Hi Paul

On 04/04/2018 23:49, Walrath, Paul wrote:
In the 7.0.0-rc2 release notes you list “dhcp: fixed classless static routes”.  Do you remember what was fixed?  I am using version 6.9.1G. In this version, not all of the routes in Option 121 seem to end up in the routing table.

As a test, I had my DHCPv4 server send Option 121 as follows (Wireshark trace):

Option: (121) Classless Static Route

     Length: 36

      192.168.10.0/24-192.168.10.1

      192.168.10.1/32-0.0.0.0

      192.168.20.0/24-192.168.20.1

      192.168.20.1/32-0.0.0.0

     default-192.168.2.2

      default-192.168.2.3

      default-192.168.2.4

      default-192.168.2.5

The extra default gateways are there just to see what dhcpcd would do with them.

Wow! That's complex. I've never tested beyond a simple setup.
I'll do similar on my server and see what happens.


The dhcpcd client added the following routes to the routing table:

Destination/Gateway/Genmask

0.0.0.0/192.168.2.2/0.0.0.0

192.168.2.2/0.0.0.0/255.255.255.255

192.168.10.1/0.0.0.0/255.255.255.255

192.168.20.1/0.0.0.0/255.255.255.255

Shouldn’t the following routes also have been added?

192.168.10.0/255.255.255.0/192.168.10.1

192.168.20.0/255.255.255.0/192.168.20.1

Is this what was fixed in 7.0.0-rc2?

No, I'm pretty sure it wasn't that. The fix is here:
https://roy.marples.name/git/dhcpcd.git/commit/?id=510c760cb24ef4b1b16cc14732c5ffe0fbb0d96d

Also, it won't apply to dhcpcd-6 because one of the goals in dhcpcd-7 was to move to a protcol agnostic routing setup which means a lot less code to maintain.

I'll try and test with dhcpcd-7 tonight as I have my kids birthday party all day today.

Roy

Follow-Ups:
Re: Option 121 Classless Static RoutesRoy Marples
References:
Option 121 Classless Static RoutesWalrath, Paul
Archive administrator: postmaster@marples.name