5

I'm trying to get an OSX Lion Server to provide a static route to its clients (all OSX Lion) over DHCP. I can't get the client to actually apply the static route.

So far, I've managed to get the DHCP server (BOOTPD) to actually serve the DHCP OPTION 33 (static_route) on the DHCP offers by editing /etc/bootpd.plist and adding something like:

<key>dhcp_option_33</key>
<data>[some base64 goes here]</data>

.. and restarting the DHCP service.

On the client I've managed to get the client to actually request the dhcp option by modifying and adding option 33 to the DHCPRequestedParameterList key:

<key>DHCPRequestedParameterList</key>
<array>
   ... keys snipped for brevity ...
   <integer>33</integer>
</array>

.. and rebooting the client. This makes the client request the static_route option from the DHCP server ( i can see the proper output in ipconfig getpacket en0 ) but it doesn't actually apply the rule.

Has anyone ever succeeded in applying static_route options on OSX clients through DHCP?

NSSec
  • 53
  • 1
  • 6
  • What is the subnet, prefix and gateway of the route you're trying to apply? – Mike Pennington Jul 05 '12 at 14:39
  • I'm not adding a network but a direct static route. So I provide 2 IPs: first one the destination (77.245.xxx.xxx), the second is the gateway (10.0.1.6). ipconfig getpacket en0 shows it as "static_route (ip_pairs): {IP1, IP2}" – NSSec Jul 05 '12 at 19:12
  • ok, but is 77.245.xxx.xxx a 32-bit host route? – Mike Pennington Jul 05 '12 at 19:14
  • yes, full ip to specific host. – NSSec Jul 05 '12 at 19:15
  • what does "ip getoption en0 33" show? – quadruplebucky Jul 07 '12 at 22:40
  • As far as I can tell, the client receives the route. It is shown in the output of `ipconfig getpacket en0` (this shows all options). I can't check right now (not in the office) but I'm assuming your command (although, using IPCONFIG instead of IP) is going to show me the same thing. – NSSec Jul 08 '12 at 08:12
  • This question is less about: how do I get the route to the client through DHCP and more about: OS X is not applying the route it receives. Should it be doing that? Can we actually configure it to do that. – NSSec Jul 08 '12 at 08:13

2 Answers2

2

FWIW, OSX clients don't appear to implement DHCP option 121 (which supercedes option 33), which is surprising considering Apple is listed as an author of RFC 3442.

I'd guess they're not supporting option 33 either (I can't get either to work from an ISC DHCPD).

One workaround is some launchd ugliness:

https://discussions.apple.com/thread/1757618?start=0&tstart=0

quadruplebucky
  • 5,139
  • 20
  • 23
0

The question was written for Lion but is applicable for several version afterwards.

El Capitan and later fully supports DHCP option 121 for DHCP provisioned static routes.

Yosemite and older requires additional software to work with DHCP static routes, which is available here: https://github.com/beckit/DHCP_121_macOS

abeckit
  • 11
  • 3