Re: linux routing table for default route
Roy Marples
Thu Dec 12 22:44:58 2019
On 12/12/2019 22:24, Ron Varburg wrote:
Why would it confuses dhcpcd at renewal?
Since the kernel manages routing, and the kernel has the final word,
I think dhcpcd should use whatever routing the kernel tells it. dhcpcd
should give the kernel routing top priority, falling back to some other
routing table only if there is some predetermined necessities. Isn't it
a bug
if that is not the case?
And doesn't exit-hook runs at renewal too? If it does, dhcpcd can keep
up setting whatever the dhcp server tells it to, and the exit-hook would
change that afterwards. hopefully, the transition time will not be
noticeable.
So dhcpcd does a lot of things.
One of them is manage DHCP requests on more than one interface.
As such, to provide a deterministic state, dhcpcd needs to adjust the
routing table. To do this efficiently we need to read the routing table,
examine what changes we need to make as a whole and then apply them.
On Linux, we need to specificy the table in play.
I don't want to second guess things so we always use the main table -
and have done for over 15 years without issue.
So dhcpcd will always put the route there. Will the kernel complain
about route already exists and then fail? Because dhcpcd didn't see it
then it doesn't know about it.
Lastly, is it the right route in the other table? dhcpcd doesn't know if
it goes via the correct interface or not.
As RENEW is UNICAST, it could go over the default route and to the wrong
place (in dhcpcd's view).
> Or, even better, isn't there a way to tell dhcpcd to ignore some of the
> settings the dhcp serever asks for?
Yes there is, but only at an option level. We could say "ignore the
default router option", but then we get it via classless static routes.
We could say "ignore the classless static route option", but then we
don't get any other subnet routes either. There is no silver bullet here.
I personally think routing tables like this are a bad idea and add extra
complexity where none is needed.
Anyway, the OP has resolved his issue without the need to escalete this
futher so I'm happy.
Roy
Archive administrator: postmaster@marples.name