Analysis to collect IP, MAC Address, and DHCP Status for Mac Computers

Up above are many of the pieces of the relevance used to build up to the final answer, but to really understand it all, you really need to start with the “end” and work backwards.

This is what you want, but for all, unfiltered:

strings "ConfigMethod" of dictionaries "IPv4" of dictionaries of values of entries of dictionaries "NetworkServices" of dictionaries of files "/Library/Preferences/SystemConfiguration/preferences.plist"

the result on my system:

A: DHCP
A: PPP
A: DHCP
A: DHCP
A: DHCP
A: DHCP

The final answer is the same, just filtering out everything except for the current connection in the current set.

The screenshot you provided was very helpful to help me figure out what needed to be filtered out, why, and how to go about it.

1 Like