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

Jul 31, 2008 1:09 AM in response to John Lockwood

Just analyzed the data on this page. It is a base 64 algorithm. The only unclear thing is which 'last two' characters are used. From the data on this page, one is definitively the '|', the other presumeably '/'.

In any case, you can use one of the many online base64 encoders to get the values. For strings, I used:
http://www.motobit.com/util/base64-decoder-encoder.asp
Number values are a bit different, as you will need something which allows inputting a decimal or hex and then convert.

In any case, there's no magic behind the whole thing. Even the simple java base64 class will do for conversion.

For more info on base64:
http://en.wikipedia.org/wiki/Base64

Aug 1, 2008 4:06 AM in response to Robert M Frank

Well done all for it seems cracking that Apple are using Base64 encoding. I was coming to this conclusion myself (honest!) because a. having done several conversions it looked increasingly like Base64, and b. Apple use Base64 in other software so it would make sense.

For the benefit of everyone I find the following two conversion websites useful

http://www.vortex.prodigynet.co.uk/misc/ascii_conv.html
and
http://hogehoge.tk/tool-i/

The last one in particular might be extra useful as it allows converting from Hexadecimal to Base64 which a recent request I had to generate a DHCP Option 43 for a Cisco device needs.

You can convert from decimal to hexadecimal using the Vortex one.

Note: Apple allow defining integers as 8bit (1 byte), 16bit, or 32bit length.

For a decimal value of '6' Apple would use the following data values
Uint8 -> Bg==
Uint16 -> AAY=
Uint32 -> AAAABg==

Note: Mitel seem to need 32bit integers. I can confirm AAAABg== does work to send a decimal value of 6 to a Mitel phone.

Hmm, I just tried various online Base64 converters and none of them understood Bg== or AAY= or AAAABg== or at least did not return any sensible value.

It looks like we are close but not quite there. Robert, do the above Integer examples help? If you need more real Apple data values to crack this last bit I can generate whatever you want.

Aug 26, 2008 9:59 AM in response to John Lockwood

Hi John, I am new to OS x. I am trying to create a classless route for my OSX 10.5.4 dhcp server.

The default gateway for the clients is set to 192.168.1.254. I am trying to set up a classless rout in the bootpd so that any traffice that is for 192.168.20.x 255.255.255.0 use router 192.168.2.1 Any help in this matter I would greatly appricate. Apple was unable to help when I called support

Aug 27, 2008 10:04 AM in response to kerrdogwoof

kerrdogwoof wrote:
Hi John, I am new to OS x. I am trying to create a classless route for my OSX 10.5.4 dhcp server.

The default gateway for the clients is set to 192.168.1.254. I am trying to set up a classless rout in the bootpd so that any traffice that is for 192.168.20.x 255.255.255.0 use router 192.168.2.1 Any help in this matter I would greatly appricate. Apple was unable to help when I called support


I am not sure this is relevant to DHCP at all. It sounds more like a 'superclass' subnet.

For 192.168.20.x the normal subnet is 255.255.255.0 and this means a router normally would be in the range 192.168.20.1 to 192.168.20.254 with a superclass subnet mask of 255.255.0.0 you should be able to use a router address of 192.168.2.1

I believe the above is some times also referred to CIDR (Classless Inter Domain Routing).

However some software does not like this sort of thing so if at all possible you would be better of switching to using a 'proper' private class B range of 172.16.x.x to 172.31.x.x A single private class B network would be for example 172.20.0.0 with a subnet mask of 255.255.0.0 and would give you up to 65534 useable IP addresses.

If you do need to use CIDR then as far as I can see it would merely be a matter of entering the CIDR mask rather than a normal class C subnet mask. If your problem is that the Apple Server Manager program does not allow this then you could try manually editing the bootpd.plist file.

See this site for a CIDR calculator and useful background.

http://www.subnet-calculator.com/cidr.php

Aug 27, 2008 6:49 PM in response to John Lockwood

John,
Thanks for the reply. I should have been more clear. We have two routers. One (192.168.1.254) which goes out of a comcast router to the internet. THis is the router that the DHCP server is pushing to the end user. The other router (192.168.1.1), from another provider, goes over a site to site to another network (192.1.20.x). So i would like for a route to be pushed to the end users through dhcp

Aug 28, 2008 3:13 AM in response to kerrdogwoof

kerrdogwoof wrote:
John,
Thanks for the reply. I should have been more clear. We have two routers. One (192.168.1.254) which goes out of a comcast router to the internet. THis is the router that the DHCP server is pushing to the end user. The other router (192.168.1.1), from another provider, goes over a site to site to another network (192.1.20.x). So i would like for a route to be pushed to the end users through dhcp


As far as I can see this still does not need to involve DHCP. What you need is to either setup RIP between the two routers so they exchange a list of routes automatically, or setup a static route in the 'master' router to list the second available route.

I did something like this myself a while ago when I was in the middle of moving from one Internet provider to another and temporarily had access to both. I setup the new router as the master one (advertised by DHCP) and in it defined a static route via the old router so I could still access the servers on the old ISP network via their network (they only allowed access via their own connections).

Aug 29, 2008 8:38 AM in response to John Lockwood

Alright, so I was reading all the information here, and I just figured this all out for myself, so heres a step by step.

1. Go here: http://www.vortex.prodigynet.co.uk/misc/ascii_conv.html
2. in the first box ( Enter a string here. Any unsupported characters will be ignored. ) enter your IP Address, in our case, 192.168.201.13
3. Change the Delimiter to an empty box ( this makes it easyer further on )
4. Hit Convert, and look in the box that says "Enter hexadecimal ASCII here"
5. Take that value, and copy it
6. open your bootpd.plist in property list editor
7. click on Root and hit New Child
8. Type in the option number you need in this format "dhcp option##"
9. Change the class to Data
10. Paste the data from step 5, between the in the value feild
11. Save

You should see the Property List editor, did some formatting on your text, for us, it put a space between each segment. Now check the file with nano/textedit .

For us, its
<key>dhcp option66</key>
<data>
MTkyLjE2OC4yMDEuMTM=
</data>

Hopefully the step by step will help someone else with this issue, until Apple can sort this out themselves.

- Allan Button

Aug 29, 2008 8:39 AM in response to John Lockwood

Alright, so I was reading all the information here, and I just figured this all out for myself, so heres a step by step.

1. Go here: http://www.vortex.prodigynet.co.uk/misc/ascii_conv.html
2. in the first box ( Enter a string here. Any unsupported characters will be ignored. ) enter your IP Address, in our case, 192.168.201.13
3. Change the Delimiter to an empty box ( this makes it easyer further on )
4. Hit Convert, and look in the box that says "Enter hexadecimal ASCII here"
5. Take that value, and copy it
6. open your bootpd.plist in property list editor
7. click on Root and hit New Child
8. Type in the option number you need in this format "dhcp option##"
9. Change the class to Data
10. Paste the data from step 5, between the in the value feild
11. Save

You should see the Property List editor, did some formatting on your text, for us, it put a space between each segment. Now check the file with nano/textedit .

For us, its
<key>dhcp option66</key>
<data>
MTkyLjE2OC4yMDEuMTM=
</data>

Hopefully the step by step will help someone else with this issue, until Apple can sort this out themselves.

* Allan Button

Sep 1, 2008 8:53 AM in response to Allan Button

Allan Button wrote:
Alright, so I was reading all the information here, and I just figured this all out for myself, so heres a step by step.

1. Go here: http://www.vortex.prodigynet.co.uk/misc/ascii_conv.html
2. in the first box ( Enter a string here. Any unsupported characters will be ignored. ) enter your IP Address, in our case, 192.168.201.13
3. Change the Delimiter to an empty box ( this makes it easyer further on )
4. Hit Convert, and look in the box that says "Enter hexadecimal ASCII here"
5. Take that value, and copy it
6. open your bootpd.plist in property list editor
7. click on Root and hit New Child
8. Type in the option number you need in this format "dhcp option##"
9. Change the class to Data
10. Paste the data from step 5, between the in the value feild
11. Save

You should see the Property List editor, did some formatting on your text, for us, it put a space between each segment. Now check the file with nano/textedit .

For us, its
<key>dhcp option66</key>
<data>
MTkyLjE2OC4yMDEuMTM=
</data>

Hopefully the step by step will help someone else with this issue, until Apple can sort this out themselves.

- Allan Button


According to my method of generating Data values, the IP address of 192.168.201.13 should be a data value of wKjJDQ== or

<key>dhcp option66</key>
<data>
wKjJDQ==
</data>

As I mentioned earlier in this thread, while it does look like Apple are using Base64 encoding, it is does not look as simple as taking a value and encoding it in Base64, it looks like Apple are still doing something extra.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

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 Account.