14 replies
Sign in or join Beachball Help to reply.
- 0
John Lockwood ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
Antonio Rocco wrote:
HiHas 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 - 0
John Lockwood ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
Antonio Rocco wrote:
Hi JohnThanks 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?
- 0
John Lockwood ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
Antonio Rocco wrote:
HiHas 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 - 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
- 0
John Lockwood ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
Antonio Rocco wrote:
Hi JohnThanks 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?
- 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
- 0
John Lockwood ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
Antonio Rocco wrote:
Hi JohnThank 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. 🙂
- 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!
- 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> - 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 - 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 -base64pipe the string you want encoded to openssl, and you're done.
- 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> - 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 -base64pipe 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==
- 0
goulv1 ·
Imported from the Apple Support Forums via the Wayback Machine 🔗
Thanks both,
I will try this asap!
Regards,
Goulven