Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Find the source of DCHP-provided addresses via script' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Find the source of DCHP-provided addresses via script
Authored by: operator207 on May 21, '08 08:50:18AM
10.5.2 MBP Penryn:


>cat get-dhcp-server-ip.sh
#!/bin/sh
echo "en0 DHCP -- Ethernet"
ipconfig getoption en0 server_identifier
echo " "
echo "en1 DHCP -- Wireless"
ipconfig getoption en1 server_identifier


Output:

>./get-dhcp-server-ip.sh
en0 DHCP -- Ethernet
ipconfig_get_option failed, (os/kern) failure

en1 DHCP -- Wireless
10.4.1.113


Maybe you guys are not looking at the correct interface? ipconfig -a

[ Reply to This | # ]
Find the source of DCHP-provided addresses via script
Authored by: Peter_T on May 21, '08 12:32:19PM

I might misunderstand the tip, but isn't the source of a dhcp provided ip adress part of the info in system profile (under the network part)?



[ Reply to This | # ]
Find the source of DCHP-provided addresses via script
Authored by: owsla on May 21, '08 06:32:55PM

Yup! Verified on 10.5.2



[ Reply to This | # ]
Find the source of DCHP-provided addresses via script
Authored by: RickoKid on Jun 08, '08 08:47:05AM
Yes it is - I never knew that! Anyway - I've updated the script to get rid of some of the bugs, and it now uses system_profiler so the interface names should be right and it should work on most versions of Mac OS X.

The updated script is on my blog: http://www.torrfamily.org/tumbleseed/products/dhcp-server-lookup/

---
Visit my technology (and Apple in particular) blog at http://tumbleseed.torrfamily.org/

[ Reply to This | # ]