Apple Event: May 7th at 7 am PT

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

Help needed defining DHCP option fields in 10.5 Server

According to the Unix man page for bootpd in Mac OS X 10.5 Server, the Apple DHCP server (actually called bootpd) now uses a configuration file called bootpd.plist which like other plist files is actually an XML formatted file.

Furthermore according to the same man page bootpd now (at long last) supports defining additional optional DHCP fields. One of the most common requirements needing these additional DHCP option fields is if you have a VoIP phone system. You can view this man page by typing *man bootpd* in the Terminal in both Mac OS X 10.5 Server and Client.

I would like to define several additional DHCP option fields to support our (Mitel) VoIP system but unfortunately I am getting errors from the DHCP server when I try this.

According to the Unix man page one should define additional properties using a name like

dhcp optionoptionnumber

e.g. dhcp option128

Based on other fields in the bootpd.plist file this to me suggests one should add a line like so

<key>dhcp option128</key>

and then again based on other entries in the standard bootpd.plist file a second line like so

<string>192.168.1.10</string>

making a total of two lines like so

<key>dhcp option128</key>
<string>192.168.1.10</string>

However this produces errors in the log like this

Dec 3 15:16:49 xserve1 bootpd[[67218]]: subnets: Failed to convert 'option_128': Failed to convert from string to opaque

The Unix man page suggests bootpd should be able to automatically convert the value inside the string section to whatever is needed to be sent across the network but obviously it is failing.

The only full example in the Unix man page looks like this

<string>dhcp option128</string>
<data>
AAqV1Tzo
</data>

but I think this is at least partly wrong since the first line should be using <key>. If I do try using <data> for the second line (in my own example) then the error does go away but without knowing how to convert a TCP/IP address to the right data value the result will be wrong.

Help!!

I want to be able to define five DHCP option fields, two of which will contain a TCP/IP address, one an ASCII string, and the other two simple integer numbers.

PowerBook G4, Mac OS X (10.5.1)

Posted on Dec 3, 2007 9:07 AM

Reply
45 replies

Apr 18, 2008 6:11 AM in response to Scurvey Dog

Scurvey Dog wrote:
Ok im in the same boat here, and reading through this thread and a few RFC's i think i have a pretty good handle on the problem.

I tried adding:

<key>dhcp option150</key>
<string>192.168.2.20</string>

And this should have worked

However we found out that due to a bug it cant translate the string variable into something it can use. So we know we need to use

<key>dhcp option150</key>
<data>XXXXXX</data>

Except we don’t know what type of data the xserve is looking for in place of XXXXXX.

My guess is Network Byte Order, however i don’t know how to convert an IP into it.

so John Lockwood, how are you doing the conversion from 172.26.26.2 into rBAQAg== ? what is that?


192.168.2.20

would be

<key>dhcp option150</key>
<data>wKgCFA==</data>

If I told you how I would have to kill you. 🙂

May 2, 2008 6:00 AM in response to John Lockwood

Hi Guys,
I have a similar issue.
my customer has a cisco router transmitted DHCP. To get it to turn off the engineer has requested I put" option 176 ascii L2Q=1,L2QVLAN=2" into the Mac 10.5 DHCP. VLAN 2 is the phone system, and I understand this has to be in place to allow the phones when rebooting to go to VLAN 2. The Mac server would recognize the phones as phones and point them to VLAN 2.
What I cannot grasp is how to input this into the Mac Server 10.5 DHCP?

would the variable be ?
<key>dhcp option176</key>
<string>192.168.11.5</string> (ip address of server)
<data>ascii L2Q=1,L2QVLAN=2</data>

any ideas on inputing the " option 176 ascii L2Q=1,L2QVLAN=2" into a mac 10.5 server DHCP

May 2, 2008 9:25 AM in response to jwilletts

jwilletts wrote:
Hi Guys,
I have a similar issue.
my customer has a cisco router transmitted DHCP. To get it to turn off the engineer has requested I put" option 176 ascii L2Q=1,L2QVLAN=2" into the Mac 10.5 DHCP. VLAN 2 is the phone system, and I understand this has to be in place to allow the phones when rebooting to go to VLAN 2. The Mac server would recognize the phones as phones and point them to VLAN 2.
What I cannot grasp is how to input this into the Mac Server 10.5 DHCP?

would the variable be ?
<key>dhcp option176</key>
<string>192.168.11.5</string> (ip address of server)
<data>ascii L2Q=1,L2QVLAN=2</data>

any ideas on inputing the " option 176 ascii L2Q=1,L2QVLAN=2" into a mac 10.5 server DHCP


\[I think they mean you need to define DHCP option code 176 and that it should contain ASCII text (not a number or IP address), therefore it needs to contain the equivalent of "L2Q=1,L2QVLAN=2". Based on this assumption read on.\]

By the way, doing a quick Google suggests you have an Avaya phone system.

Apple don't currently provide a method for mere mortals to use to do this. However here is what you need :-

<key>dhcp option176</key>
<data>TDJRPTEsTDJRVkxBTj0y</data>

What I believe will happen (I have not used an Avaya system but it should be basically the same as a Mitel system) is that the VoIP (Avaya) phone will boot on the default VLAN (which will be the Mac one), query the Mac DHCP server for DHCP option 176 to find the VoIP VLAN number, switch to the VoIP VLAN, and then query the DHCP server on that VLAN to find the Avaya system itself.

This http://www.avaya.com/master-usa/en-us/resource/assets/applicationnotes/gw-dhcp-t ftp.pdf is the Avaya documentation on this subject (but assumes you are using their own DHCP server).

Let me know if the above works (or not).

May 7, 2008 8:33 AM in response to jwilletts

jwilletts wrote:
Thanks for that.
finally got round to updating the file and am unsure where I insert the text you gave me into the file.
can i insert it anywhere in the <dict> part of the xml file or do I insert it into the <array><dict> field where it looks at the router address, the dhcp range etc.


I put it at the same level as for example the dhcp domain_nameserver key.

May 14, 2008 8:53 AM in response to jwilletts

jwilletts wrote:
Thanks John,
thats all working now the mac's are communicating with the server fine now.

Just wondering how you got the syntax <data>TDJRPTEsTDJRVkxBTj0y</data>
is it a software program that generates the code inside the <data> tags

best regards JW


As I said in a previous reply, if I told you how I would have to kill you 😉

What I can say is that Lyle Millander discovered once we had some real data in /etc/bootpd.plist that the Apple PropertyList Editor program (included with the XCode tools) can open this plist (duh! it is a plist file after all) and that it does automatically decode existing data entries, try it on yours.

In theory one could do the reverse, open /etc/bootpd.plist and add a brand new data property entry using PropertyList Editor.

It might be easier to add a dummy entry using a text editor and then check/modify it using PropertyList Editor.

PS. Apart from the fact that the tools provided with Mac OS X 10.5 do not provide a way to generate these Data entries, the included Unix man page for bootpd has an error regarding this.

May 29, 2008 4:36 PM in response to John Lockwood

So ... Property List Editor can decode the data values, but not properly encode them? I'm in the middle of the ginormous Xcode Tools download in the hopes that it can, since it seems the only other option currently is to post what we need on this thread and hope that you check it sometime soon and have the time to encode them? Seems a little ridiculous to me...

Of course, I have a truly odd thing going on where I can't even add in the required keys, as whenever I do this and start DHCP services again, it blows out the bootpd.plist file and substitutes a totally bogus one that has no relevance to how I had it set up in the first place. =\

May 30, 2008 3:35 AM in response to Khanaset

Khanaset wrote:
So ... Property List Editor can decode the data values, but not properly encode them? I'm in the middle of the ginormous Xcode Tools download in the hopes that it can, since it seems the only other option currently is to post what we need on this thread and hope that you check it sometime soon and have the time to encode them? Seems a little ridiculous to me...

Of course, I have a truly odd thing going on where I can't even add in the required keys, as whenever I do this and start DHCP services again, it blows out the bootpd.plist file and substitutes a totally bogus one that has no relevance to how I had it set up in the first place. =\


I agree ideally Apple need to provide an official solution, perhaps if you use the feedback form this will move up their agenda.

I believe in theory that using Property List Editor to create a key should be possible.

Regarding the DHCP server zapping your attempts and replacing them with bogus ones.

If you create an incorrect key like

<key>dhcp option133</key>
<data>thisiswrong</data>

then my early attempts did show it would put bogus stuff in like

<key>dhcp option133</key>
<data>Z1d5G</data>

So the DHCP server is obviously error checking the contents and making its best (and incorrect) guess in these cases.

If you put the correct data in then it does leave it alone.

May 30, 2008 2:56 PM in response to John Lockwood

John Lockwood wrote:
Khanaset wrote:
So ... Property List Editor can decode the data values, but not properly encode them? I'm in the middle of the ginormous Xcode Tools download in the hopes that it can, since it seems the only other option currently is to post what we need on this thread and hope that you check it sometime soon and have the time to encode them? Seems a little ridiculous to me...

Of course, I have a truly odd thing going on where I can't even add in the required keys, as whenever I do this and start DHCP services again, it blows out the bootpd.plist file and substitutes a totally bogus one that has no relevance to how I had it set up in the first place. =\


I agree ideally Apple need to provide an official solution, perhaps if you use the feedback form this will move up their agenda.

I believe in theory that using Property List Editor to create a key should be possible.

Regarding the DHCP server zapping your attempts and replacing them with bogus ones.

If you create an incorrect key like

<key>dhcp option133</key>
<data>thisiswrong</data>

then my early attempts did show it would put bogus stuff in like

<key>dhcp option133</key>
<data>Z1d5G</data>

So the DHCP server is obviously error checking the contents and making its best (and incorrect) guess in these cases.

If you put the correct data in then it does leave it alone.


So I gave Property List Editor a try -- it does not convert the values unfortunately, unless I'm using it wrong =) That being said, since time was of the essence, I went ahead and built and deployed the ISC DHCP server, since I had already installed the Xcode Tools. Straightforward and easy from there on in.

It just blows my mind, I guess, with all the major changes in Server Admin in 10.5, that such a commonplace need like passing DHCP options is neither available through the GUI, or even at the shell level with a few exceptions. Ah well, life goes on...

May 31, 2008 5:41 AM in response to Khanaset

Khanaset wrote:
So I gave Property List Editor a try -- it does not convert the values unfortunately, unless I'm using it wrong =) That being said, since time was of the essence, I went ahead and built and deployed the ISC DHCP server, since I had already installed the Xcode Tools. Straightforward and easy from there on in.

It just blows my mind, I guess, with all the major changes in Server Admin in 10.5, that such a commonplace need like passing DHCP options is neither available through the GUI, or even at the shell level with a few exceptions. Ah well, life goes on...


If you want to use the Apple one list your requirements and I will generate the values for you.

Jul 23, 2008 5:18 AM in response to Jeremy.Wellner

Jeremy.Wellner wrote:
Hello John!

I am onsite with someone and they have an Mitel IP system as well. I need the following values converted for their bootp.plist file.

option 128
192.168.2.5

option 129
192.168.2.5

option 130
MITEL IP PHONE

option 132
0x2

option 133
0x6

Thank you!!


Sorry for the delay in replying, been a while since I checked here.

Option code 128 and 129 will both be
192.168.2.5 = wKgCBQ==

Option code 130
MITEL IP PHONE = TUlURUwgSVAgUEhPTkU=

Option code 132
decimal 2 = AAAAAg==

Option code 133
decimal 6 = AAAABg==

Help needed defining DHCP option fields in 10.5 Server

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple ID.