Skip navigation

Configure DHCP Options 66 and 67

7238 Views 16 Replies Latest reply: Jun 18, 2013 8:06 AM by Paul B. Adams RSS
1 2 Previous Next
Paul B. Adams Level 1 Level 1 (10 points)
Currently Being Moderated
Dec 1, 2012 3:01 PM

I need to configure OS X Server BOOTP to provide DHCP options 66 and 67 to provide PXE booting for PCs on the net work. I have tried following the bootpd MAN pages, but they are not specific enough. I have read conflicting informaiton on the net, but nothing definitive for Mountain Lion DHCP.

 

from bootpd man page:

bootpd has a built-in type conversion table for many more options, mostly those specified in RFC 2132, and will try to convert from whatever type the option appears in the property list to the binary, packet format.  For example, if bootpd knows that the type of the option is an IP address or list of IP addresses, it converts from the string form of the IP address to the binary, network byte order numeric value.

 

If the type of the option is a numeric value, it converts from string, integer, or boolean, to the proper sized, network byte-order numeric value.

 

Regardless of whether bootpd knows the type of the option or not, you can always specify the DHCP option using the data property list type  e.g.:

<key>dhcp_option_128</key>

<data>

AAqV1Tzo

</data>

 

My TFTP server is 172.16.152.20 and the bootfile is pxelinux.0

 

I have edited /etc/bootpd.plist and added the following to the subnet dict:

 

<key>dhcp_option_66</key>

<data>

LW4gLWUgrBCYFAo=

</data>

<key>dhcp_option_67</key>

<data>

LW4gLWUgcHhlbGludXguMAo=

</data>

 

 

According to the man page, the data elements are supposed to be Base64 encoded, but no matter what I try, I cannot get PXE clients to boot.

 

I have tried encoding 172.16.152.20 and pxelinux.0 using vaious methods:

 

 

Has anyone got this working?

 

Regards,

Paul Adams.

  • John Lockwood Level 5 Level 5 (5,075 points)
    Currently Being Moderated
    Dec 3, 2012 7:55 AM (in response to Paul B. Adams)

    I'm the author of DHCP Option Code Utility

     

    Normally you would define IP addresses as type IP Address and this gets stored as four bytes, 255 would equal FF in hex. You would not normally define an IP address as type string as this would be a much longer value where each character is one byte.

     

    A string would be defined as type string of course.

     

    It would appear therefore that you have used the wrong choice for defining the IP address.

  • John Lockwood Level 5 Level 5 (5,075 points)
    Currently Being Moderated
    Dec 3, 2012 5:03 PM (in response to Paul B. Adams)

    The correct values should be

     

    <key>dhcp_option_66</key>

    <data>

    rBCYFA==

    </data>

     

     

    <key>dhcp_option_67</key>

    <data>

    cHhlbGludXguMA==

    </data>

     

    It does not appear to be your fault. I just tried my utility on Snow Leopard, and then on Mountain Lion and on Mountain Lion it is giving the wrong results - the ones you got. For everyone's benefit, there seems to be a simple workaround which is to delete LW4gLWUg from the front of each generated value on Mountain Lion.

  • John Lockwood Level 5 Level 5 (5,075 points)
    Currently Being Moderated
    Dec 4, 2012 11:55 AM (in response to Paul B. Adams)

    I believe you have them in the right place, here is a working bootpd.plist file

     

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
            <key>NetBoot</key>
            <dict/>
            <key>Subnets</key>
            <array>
                    <dict>
                            <key>allocate</key>
                            <true/>
                            <key>dhcp_domain_name</key>
                            <string>example.com</string>
                            <key>dhcp_domain_name_server</key>
                            <array>
                                    <string>192.168.168.10</string>
                                    <string>192.168.168.11</string>
                            </array>
                            <key>dhcp_domain_search</key>
                            <array>
                                    <string>example.com</string>
                            </array>
                            <key>dhcp_ldap_url</key>
                            <array>
                                    <string>ldap://server.example.com/dc=server,dc=example,dc=com</string>
                            </array>
                            <key>dhcp_nb_over_tcpip_name_server</key>
                            <array>
                                    <string>192.168.168.10</string>
                            </array>
                            <key>dhcp_router</key>
                            <string>192.168.168.1</string>
                            <key>lease_max</key>
                            <integer>3600</integer>
                            <key>lease_min</key>
                            <integer>3600</integer>
                            <key>name</key>
                            <string>File Server LAN</string>
                            <key>net_address</key>
                            <string>192.168.168.0</string>
                            <key>net_mask</key>
                            <string>255.255.255.0</string>
                            <key>net_range</key>
                            <array>
                                    <string>192.168.168.150</string>
                                    <string>192.168.168.240</string>
                            </array>
                            <key>selected_port_name</key>
                            <string>en0</string>
                            <key>uuid</key>
                            <string>8C5D9377-595C-48A5-844C-EC83EFC4BF5B</string>
                    </dict>
            </array>
            <key>dhcp_enabled</key>
            <array>
                    <string>en0</string>
            </array>
            <key>timeDatabaseUpdated</key>
            <string>2009-07-21 15:19:30 +0100</string>
            <key>timeServiceStarted</key>
            <string>2010-06-19 11:44:26 +0100</string>
    </dict>
    </plist>

    Some of your arrays are listed but empty and I am worried this may be confusing things since they don't have balanced <array> <array/> pairs unlike the working example above.

  • tim_r_66 Level 1 Level 1 (30 points)
    Currently Being Moderated
    Dec 10, 2012 3:46 AM (in response to John Lockwood)

    This dialogue was a huge help in my getting so the client gets an assigned ip address and the tftp process for boot is started.  Unfortunately, it fails.  I will start a new thread for that but wanted to provide another success in using the information here..

  • John Lockwood Level 5 Level 5 (5,075 points)
    Currently Being Moderated
    Dec 14, 2012 11:45 AM (in response to Paul B. Adams)

    Paul, see this thread https://discussions.apple.com/message/20548362#20548362

     

    It turns out that the pxelinux.0 string needs to be null terminated. You need to convert pxelinux.0 to hex values and then add 00 to the end and then enter that in my utiltiy chosing the hex option. I believe the right result should therefore be as follows.

     

    <key>dhcp_option_67</key>

    <data>

    cHhlbGludXguMAA=

    </data>

  • tim_r_66 Level 1 Level 1 (30 points)
    Currently Being Moderated
    Dec 14, 2012 12:51 PM (in response to John Lockwood)

    I'll double-check when I get home but I believe mine ended with AK.

  • John Lockwood Level 5 Level 5 (5,075 points)
    Currently Being Moderated
    Jan 4, 2013 11:14 AM (in response to Paul B. Adams)

    Thanks for the confirmation it worked.

     

    I plan at some point to do an update to my utility to add an extra option for encoding as a null-terminated-string and fixing the Mountain Lion error. However I also need to find a suitable free webhosting service as my old MobileMe site is of course no more.

  • rnakama Calculating status...
    Currently Being Moderated
    Feb 6, 2013 3:07 PM (in response to Paul B. Adams)

    Thanks thread helped me to solved my Deploystudio PC issue.  Took me a while to find this thread, I was pulling my hair trying to figure out it out.

  • Mackey Mark Calculating status...
    Currently Being Moderated
    May 6, 2013 10:14 PM (in response to John Lockwood)

    Hi John,

     

    Can you tell me what the correct value would be for 10.2.1.11.  I cannot seem to get some AAstra phones to acknowledge it no matter which combination I use. 

     

    Also, are you still only lacking a hosting provider for your utility to update it to Mountain Lion?  I could probably handle that.

  • John Lockwood Level 5 Level 5 (5,075 points)
    Currently Being Moderated
    May 6, 2013 11:45 PM (in response to Mackey Mark)

    The details for the IP address you want would be

     

    <key>dhcp_option_66</key>

    <data>

    CgIBCw==

    </data>

     

    A lack of someone where to post a fixed version i.e. a webhost has been the excuse I have been using for not getting stuck in to writing a fixed version so if you can assist there that would be of interest.

     

    Cheers, John

  • edxley Calculating status...
    Currently Being Moderated
    May 15, 2013 9:31 PM (in response to John Lockwood)

    Not a substitute for a graphical interface, but here is a way to encode the string for option 67 in Terminal:

     

    $ printf %s00 `echo -n pxelinux.0 | xxd -p` | xxd -r -p | openssl base64

     

    It echoes the string "pxelinux.0" through xxd to convert to hex, uses printf to add a "00", then pipes through xxd again to convert back from hex, then pipes to openssl to encode in base64.  Note the backticks (not single quotation marks).  The output is

     

    cHhlbGludXguMAA=

     

     

     

    Also, for option 66:

     

    $ echo 10.2.1.11 | awk -F . '{ printf "%.2x%.2x%.2x%.2x", $1, $2, $3, $4 }' | xxd -r -p | openssl base64

     

    This one echoes the IP address string through an awk program to convert to hex (the result is "0a02010b"), then pipes through xxd to convert back to binary, then openssl to encode in base64.  The output is

     

    CgIBCw==

     

     

     

    Regards,

    edxley

    Mac OS X (10.5.8)
1 2 Previous Next

Actions

More Like This

  • Retrieving data ...

Bookmarked By (1)

Legend

  • This solved my question - 10 points
  • This helped me - 5 points
This site contains user submitted content, comments and opinions and is for informational purposes only. Apple disclaims any and all liability for the acts, omissions and conduct of any third parties in connection with or related to your use of the site. All postings and use of the content on this site are subject to the Apple Support Communities Terms of Use.