Previous 1 2 Next 16 Replies Latest reply: Jun 18, 2013 8:06 AM by Paul B. Adams
Paul B. Adams Level 1 Level 1 (10 points)

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 (6,180 points)

    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.

  • Paul B. Adams Level 1 Level 1 (10 points)

    Hi John,

     

    Thanks for the response. I have recreated the following using your utility:

     

    <key>dhcp_option_66</key>

    <data>

    LW4gLWUgrBCYFAo=

    </data>

    <key>dhcp_option_67</key>

    <data>

    LW4gLWUgcHhlbGludXguMAo=

    </data>

     

    66 is the IP address 172.16.152.20 IP address format (not string), 67 is "pxelinux.0" as a string. When I add these to my subnet dictionary in the /etc/bootpd.plist and restart my DHCP service, I still cannot get the PXE boot images to connect to the PXE server, it times out.

     

    When I pass LW4gLWUgrBCYFAo= through a Base64 decode I get: -n -e � �

    When I pass LW4gLWUgcHhlbGludXguMAo= through a Base64 decode I get: -n -e pxelinux.0

     

    Is that correct? Should each value be prefixed with "-n-e "?

     

    Any pointers to a solution will be greatly appreciated

     

    Regards,

    Paul.

  • John Lockwood Level 5 Level 5 (6,180 points)

    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.

  • Paul B. Adams Level 1 Level 1 (10 points)

    Hi John, I really appreciate your help with this.

     

    In your post you state "delete LW4gLWUg  from the front of each generated value."

     

    My generated values are "LW4gLWUgrBCYFAo=" and "LW4gLWUgcHhlbGludXguMAo=" but in your eaxample above you use "rBCYFA==" and "cHhlbGludXguMA=="

     

    The ending characters differ: "==" in your examples and "o=" in my generated versions.

     

    Using your examples in my bootpd.plist still does not work with PXE boot -- the TFTP server is not found.

     

    Here is my bootpd.plist file using your example. Is there another error in the file? Do I have the options in the correct locaiton within the plist?

     

    <?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>no-dns-available.example.com</string>

                                  <key>dhcp_domain_name_server</key>

                                  <array>

                                            <string>172.16.152.10</string>

                                            <string>172.16.152.2</string>

                                  </array>

                                  <key>dhcp_domain_search</key>

                                  <array/>

                                  <key>dhcp_option_66</key>

                                  <data>

                                  rBCYFA==

                                  </data>

                                  <key>dhcp_option_67</key>

                                  <data>

                                  cHhlbGludXguMA==

                                  </data>

                                  <key>dhcp_router</key>

                                  <string>172.16.152.2</string>

                                  <key>lease_max</key>

                                  <integer>3600</integer>

                                  <key>name</key>

                                  <string>172.16.152.0 Ethernet</string>

                                  <key>net_address</key>

                                  <string>172.16.152.0</string>

                                  <key>net_mask</key>

                                  <string>255.255.255.0</string>

                                  <key>net_range</key>

                                  <array>

                                            <string>172.16.152.2</string>

                                            <string>172.16.152.253</string>

                                  </array>

                                  <key>selected_port_name</key>

                                  <string>en0</string>

                                  <key>uuid</key>

                                  <string>65C124B4-E3FD-4805-9A4D-23059026E365</string>

                        </dict>

              </array>

              <key>allow</key>

              <array/>

              <key>bootp_enabled</key>

              <false/>

              <key>deny</key>

              <array/>

              <key>detect_other_dhcp_server</key>

              <false/>

              <key>dhcp_enabled</key>

              <array>

                        <string>en0</string>

              </array>

              <key>netboot_disabled</key>

              <array>

                        <string>en0</string>

              </array>

              <key>old_netboot_enabled</key>

              <false/>

              <key>relay_enabled</key>

              <false/>

              <key>relay_ip_list</key>

              <array/>

              <key>timeServiceStarted</key>

              <string>2012-12-04 13:05:13 +0000</string>

    </dict>

    </plist>


  • John Lockwood Level 5 Level 5 (6,180 points)

    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 (40 points)

    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 (6,180 points)

    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 (40 points)

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

  • Paul B. Adams Level 1 Level 1 (10 points)

    John,

     

    I've been on the road for several weeks and only just got to test this out.

     

    It WORKS! I am now PXE booting VMs from OS X Server 2.2 DHCP with the following entries in my bootpd.plist:

     

    <key>dhcp_option_66</key>

    <data>

    rBCYFAo=

    </data>

    <key>dhcp_option_67</key>

    <data>

    cHhlbGludXguMAA=

    </data>

     

    Kudos, and thanks you for your help.

     

    Regards,

    Paul Adams.

    Vancouver BC, Canada.

  • John Lockwood Level 5 Level 5 (6,180 points)

    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 Level 1 Level 1 (0 points)

    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 Level 1 Level 1 (0 points)

    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 (6,180 points)

    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 Level 1 Level 1 (5 points)

    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

Previous 1 2 Next