On 3/31/22 10:17 AM, Grant Taylor wrote:
I do know that the DHCP protocol supports adding additional options /
definitions / parameters (?term?) to specify ... static routes.
In case others are interested in this, a few pointers about using it.
ISC's DHCP server has two options for advertising routes that clients
should install;
subnet ... netmask ... {
...
option cidr-static-route ...;
...
ms-static-route ...;
...
}
Both *-static-route options use the same format and the format took a
little bit to wrap my head around. It consists of sets of <netmask
length>, followed by the <network bits>, followed by the router. E.g.
option cidr-static-route 10, 100, 64, 192, 0, 2, 123, 0, 192, 0, 2, 1;
That says:
- 100.64.0.0/10 is reachable via 192.0.2.123
- 0/0 is reachable via 192.0.2.1
ProTip: Go ahead and add the default gateway 0/0 route to the
*-static-route entries as some clients ignore the option routers entry
when *-static-route option is present.
I have multiple macOS, iOS, Windows 10, Linux, and other esoteric things
correctly using a route to a lab / sandbox subnet via a system that
isn't the LAN's default gateway.
Finally: This seems to be a well defined DHCP standard, but seemingly
not well known option by the various people that I've discussed this with.
--
Grant. . . .
unix || die