Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 29 Nov 2021 19:08:13 +0100
From:      Joost Bekkers <joost@jodocus.org>
To:        scott@gasch.org
Cc:        Michael Sierchio <kudzu@tenebras.com>, Jon Radel <jon@radel.com>, freebsd-questions <freebsd-questions@freebsd.org>
Subject:   Re: Custom static route not applied at reboot
Message-ID:  <cf58fe40.AMcAAGsvUBoAAAAAAAAAAHAkGMAAAAAA0PMAAAAAABYlygBhpRcO@mailjet.com>
In-Reply-To: <CABYAQkQxnmitk4-j=E0dY1aU0K%2BA224mQCEQouk%2BbEaKxo0qRA@mail.gmail.com>
References:  <CABYAQkQox2dy2xATkj3ghntcqqefuo9nsYTtQsmc%2B1TNTdVKUw@mail.gmail.com> <a8565a89-f746-93d7-7450-dfef8784489e@radel.com> <CABYAQkQAeWvcL4YYMQuDEskKP6stV6fsGLuFHom4OAOc2A9E%2BQ@mail.gmail.com> <CAHu1Y71Ex0fzp5FJi1b=eXxF8Bu5jtBOFEtg8EaWJgdSChkjgA@mail.gmail.com> <CABYAQkQxnmitk4-j=E0dY1aU0K%2BA224mQCEQouk%2BbEaKxo0qRA@mail.gmail.com>

index | next in thread | previous in thread | raw e-mail

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.



help

Want to link to this message? Use this
URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?cf58fe40.AMcAAGsvUBoAAAAAAAAAAHAkGMAAAAAA0PMAAAAAABYlygBhpRcO>