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