Benches macOS

14

DHCP, 'wpad' option 252

apple Verified

Imported from the Apple Support Forums via the Wayback Machine 🔗

Hi

Has anyone successfully managed to do this? Looking at "serveradmin settings dhcp" it's not there as an option. Any thoughts/advice warmly received.

Tony

14 replies

Sign in or join Beachball Help to reply.

  1. 0

    John Lockwood

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Antonio Rocco wrote:

    Hi

    Has anyone successfully managed to do this? Looking at "serveradmin settings dhcp" it's not there as an option. Any thoughts/advice warmly received.

    It is possible to define additional DHCP option codes and 'serve' them using Mac OS X Server's DHCP server. However the information needs to be encoded in 'data' format and not like standard DHCP fields as explicit text, integer, or IP address.

    Unfortunately, Apple do not provide an easy method for generating the data format equivalent. It is mostly but not completely a BASE64 encoded version.

    If you let me know what contents you want in this DHCP option code I might be able to generate the value for you. For example if you wanted it to contain "http://xxxxxx.xxxx.xx/yyy".

    By the way, regrettably Mac OS X as a client does not support using WPAD (Web Proxy Auto Discovery). I wish it did.

    Other readers might want to look at
    http://en.wikipedia.org/wiki/WebProxy_AutodiscoveryProtocol

  2. 0

    John Lockwood

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Antonio Rocco wrote:

    Hi John

    Thanks for getting back to me. I remember reading one of your posts a while back talking about BASE64 Something to do with a particular Phone model I think?

    The url is simple as you would expect:

    http://192.168.197.99/wpad.dat

    I knew about the lack of support for wpad in Safari etc. I read it in one of your previous posts! Most ad-hoc users will probably be using PCs anyway so not such an issue. For the rare ad-hoc mac I can always send a "networksetup" command via ARD.

    I'll be testing this on Thursday and if it works I'll mark it as solved. You could earn yourself extra brownie points if you wish John? I cross-posted over on the Unix Forum. If you reply there I'll mark it Helpful and if a success Solved as well as here.

    Tony

    For a URL like above, it is going to need to be an equivalent to a string. I therefore believe you will need the following

    <key>dhcp
    option252</key>

    <data>

    aHR0cDovLzE5Mi4xNjguMTk3Ljk5L3dwYWQuZGF0

    </data>

    Which Unix forum are you referring to?

  3. 0

    John Lockwood

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Antonio Rocco wrote:

    Hi

    Has anyone successfully managed to do this? Looking at "serveradmin settings dhcp" it's not there as an option. Any thoughts/advice warmly received.

    It is possible to define additional DHCP option codes and 'serve' them using Mac OS X Server's DHCP server. However the information needs to be encoded in 'data' format and not like standard DHCP fields as explicit text, integer, or IP address.

    Unfortunately, Apple do not provide an easy method for generating the data format equivalent. It is mostly but not completely a BASE64 encoded version.

    If you let me know what contents you want in this DHCP option code I might be able to generate the value for you. For example if you wanted it to contain "http://xxxxxx.xxxx.xx/yyy".

    By the way, regrettably Mac OS X as a client does not support using WPAD (Web Proxy Auto Discovery). I wish it did.

    Other readers might want to look at
    http://en.wikipedia.org/wiki/WebProxy_AutodiscoveryProtocol

  4. 0

    Antonio Rocco

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Hi John

    Thanks for getting back to me. I remember reading one of your posts a while back talking about BASE64 Something to do with a particular Phone model I think?

    The url is simple as you would expect:

    http://192.168.197.99/wpad.dat

    I knew about the lack of support for wpad in Safari etc. I read it in one of your previous posts! Most ad-hoc users will probably be using PCs anyway so not such an issue. For the rare ad-hoc mac I can always send a "networksetup" command via ARD.

    I'll be testing this on Thursday and if it works I'll mark it as solved. You could earn yourself extra brownie points if you wish John? I cross-posted over on the Unix Forum. If you reply there I'll mark it Helpful and if a success Solved as well as here.

    Tony

  5. 0

    John Lockwood

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Antonio Rocco wrote:

    Hi John

    Thanks for getting back to me. I remember reading one of your posts a while back talking about BASE64 Something to do with a particular Phone model I think?

    The url is simple as you would expect:

    http://192.168.197.99/wpad.dat

    I knew about the lack of support for wpad in Safari etc. I read it in one of your previous posts! Most ad-hoc users will probably be using PCs anyway so not such an issue. For the rare ad-hoc mac I can always send a "networksetup" command via ARD.

    I'll be testing this on Thursday and if it works I'll mark it as solved. You could earn yourself extra brownie points if you wish John? I cross-posted over on the Unix Forum. If you reply there I'll mark it Helpful and if a success Solved as well as here.

    Tony

    For a URL like above, it is going to need to be an equivalent to a string. I therefore believe you will need the following

    <key>dhcp
    option252</key>

    <data>

    aHR0cDovLzE5Mi4xNjguMTk3Ljk5L3dwYWQuZGF0

    </data>

    Which Unix forum are you referring to?

  6. 0

    Antonio Rocco

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Hi John

    Thank you once again. The Unix Forum I'm referring to is this one:

    http://discussions.apple.com/forum.jspa?forumID=735

    <Edited by Host>

    Tony

  7. 0

    John Lockwood

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Antonio Rocco wrote:

    Hi John

    Thank you once again. The Unix Forum I'm referring to is this one:

    http://discussions.apple.com/forum.jspa?forumID=735

    Do I get a "Helpful" for this?

    Tony

    Unfortunately as I did not open this question, I cannot give out rewards. 🙂

  8. 0

    goulv1

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Hi,

    could you please help me? I am trying to add :

    <data>192.168.1.25</data>

    Best regards!

  9. 0

    John Lockwood

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    goulv1 wrote:

    Hi,

    could you please help me? I am trying to add :

    <data>192.168.1.25</data>

    Best regards!

    Data fields cannot contain human-readable values. They have to be 'encoded' in to Data format.

    You need to tell me

    i. What DHCP option field it is supposed to be

    ii. What value (human version) it is supposed to be, presumable from the above you are trying to define a DHCP option field containing a TCP/IP address.

    As an example the following would be correct, and would contain your above IP address

    <key>dhcp
    option128</key>

    <data>

    wKgBGQ==

    </data>

  10. 0

    goulv1

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Thx for your answer :

    I would like to add :

    <key>dhcp
    option66</key>

    <data>192.168.1.25</data>

    <key>dhcp
    option120</key>

    <data>192.168.1.25</data>

    Regards,

    Goulven

  11. 0

    foilpan

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    for all these, do the following to get the encoded version:


    echo "192.168.1.25" | openssl enc -base64

    pipe the string you want encoded to openssl, and you're done.

  12. 0

    John Lockwood

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    goulv1 wrote:

    Thx for your answer :

    I would like to add :

    <key>dhcp
    option66</key>

    <data>192.168.1.25</data>

    <key>dhcp
    option120</key>

    <data>192.168.1.25</data>

    For sending the above as IP addresses the values you need are

    <key>dhcp
    option66</key>

    <data>

    wKgBGQ==

    </data>

    <key>dhcp
    option120</key>

    <data>

    wKgBGQ==

    </data>

    For sending as 'strings' the values would be

    <key>dhcp
    option66</key>

    <data>

    MTkyLjE2OC4xLjI1

    </data>

    <key>dhcp
    option120</key>

    <data>

    MTkyLjE2OC4xLjI1

    </data>

  13. 0

    John Lockwood

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    foilpan wrote:

    for all these, do the following to get the encoded version:


    echo "192.168.1.25" | openssl enc -base64

    pipe the string you want encoded to openssl, and you're done.

    Thanks for the above. It is not the method I have been using but I can see the above works for converting strings. For the benefit of others to decode it would be

    echo "MTkyLjE2OC4xLjI1Cg==" | openssl enc -d -base64

    The method I use, does pad out IP, and integer values, but does not seem to pad strings. Having tested decoding a string with and without padding, both produce the same decoded results, so either it does not matter, or openssl is clever enough to cope anyway. Openssl always pads strings when encoding.

    For the benefit of others again, IP addresses and Integers are not normally sent as strings. They are sent as encoded numbers as these use less space. Hence why the IP address of 192.168.1.25 would normally be encoded as wKgBGQ== rather than MTkyLjE2OC4xLjI1Cg==

  14. 0

    goulv1

    Imported from the Apple Support Forums via the Wayback Machine 🔗

    Thanks both,

    I will try this asap!

    Regards,

    Goulven