dhcpcd-discuss

AW: linux routing table for default route

andrey

Fri Dec 13 05:51:15 2019

Hello Roy, Hello Ron,

> 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.

Absolutely correct. Whats why I see modification of routing table wia script critical.

> 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.

I feel that you overcomplicate things here: If a routing table name or ID wourl be specified (means "not the main table") dhcpcd should apply exactly the same logic it is applying now to a different table. It's obvious, that other tables contain "conflicting" routes, it's the normal case for policy based routing, otherwise there would be no need to have multiple routing tables. It's also the case right now: dhcpcd performs actions on the main table, other tables contain other default routes and dhcpcd has no clue about it. This is totally correct and should continue to be so. 
It the routing table option would be introduced, the only difference would be that dhcpcd performs exactly the same checks and actions on the custom table and has no clue (and doesn't care about) the content of all other tables including the main one. So fromm y point of view very simple, straightforward and transparent.
And it the option is pointing to different tables for different interfaces - so bei it, thet means that there is some logic arount it (policies) that defines thich tabel counts then, and dhcpcd is just doint it's job maintaining tables individually...

> I personally think routing tables like this are a bad idea and add extra 
> complexity where none is needed.
It's a tool for complex routing no more no less. It's there on linux and all specialized routing OS (CISCO etc.) and used typically then there are different options to reach the destination (for example you have multiple ISP or uplinks).

> Anyway, the OP has resolved his issue without the need to escalete this 
> futher so I'm happy.

So yes, actually I just asked about any plans or considerations it this direction because I considered it as extremely simple and useful change. And it's totally ok to say "no".

Andrey



References:
linux routing table for default routeandrey
Re: linux routing table for default routeRon Varburg
Re: linux routing table for default routeRoy Marples
Re: linux routing table for default routeRon Varburg
Re: linux routing table for default routeRoy Marples
Archive administrator: postmaster@marples.name