Re: Custom static route not applied at reboot

From: Joost Bekkers <joost_at_jodocus.org>
Date: Mon, 29 Nov 2021 18:08:13 UTC
On 2021-11-27 05:24, Scott Gasch wrote:
> Any suggested remedy other than a sleep 20; route add -net 
> 192.168.0.0/24
> -gateway 10.0.0.225 in my rc.local?  There must be a less ugly way than
> that, no?
> 

Assuming using a static ip address is not an option, you could tell 
dhclient to add the route.

The option classless-routes (#121, RFC3442) is not in the 
dhcp-options(5) man page, but is is implemented in the client.

Your dhclient.conf would look something like this:

interface "igb0" {
   append classless-routes 24,192,168,0,10,0,0,225;
}

Please note: Because all relevant bytes of the network fit in the first 
3 bytes (24/8 <= 3), you don't specify the fourth.

I haven't tested if it works when specified in the .conf, but I've seen 
it work when the server sends it.



Joost.