Network Interface Names - MacOS?

Greetings -

I am trying to get user recognizable network interface names (ethernet, WiFi, Airport, etc). Yes, I know that MBS can provide it, but this is a “pro bono” project and I can’t justify the cost of MBS.

On Windows, “ipconfig” from the shell gives me entries such as (with x’s in potentially sensitive values)

Ethernet adaptor Local Area Connection:
Connection-specific DNS Suffix : bee.oregonstate.edu
Link-local IPv6 Address : fe80::xxxx:xxxx:xxxx:xxxx%xx
IPv4 Address :128,xxx,xxx,xxx
Subnet Mask :255.255.254.0
Default Gateway :128.xxx.xxx.xxx

On MacOS, ipconfig is noted as “It should only be used in a test and debug context. Using it for any other purpose is strongly discouraged. Public API’s in the SystemConfiguration framework are currently the only supported way to access and control the state of IPConfiguration.” The comparable appears to be ifconfig. “ifconfig -l” gives a list of installed interfaces, such as

$ifconfig -l
io0 gif0 stf0 en1 en0 fw0

And an “ifconfig -m en0”, which the man pages says is supposed to give a “a capabilities list and all of the supported media for the specified interface” gives

10-196-58-11:~ jameswagner$ ifconfig -m en0
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
ether 00:1e:c2:0e:1c:63
media: autoselect
status: inactive
supported media:
media autoselect
media 10baseT/UTP mediaopt half-duplex
media 10baseT/UTP mediaopt full-duplex
media 10baseT/UTP mediaopt full-duplex mediaopt hw-loopback
media 10baseT/UTP mediaopt full-duplex mediaopt flow-control
media 100baseTX mediaopt half-duplex
media 100baseTX mediaopt full-duplex
media 100baseTX mediaopt full-duplex mediaopt hw-loopback
media 100baseTX mediaopt full-duplex mediaopt flow-control
media 1000baseT mediaopt full-duplex
media 1000baseT mediaopt full-duplex mediaopt hw-loopback
media 1000baseT mediaopt full-duplex mediaopt flow-control
media none
10-196-58-11:~ jameswagner$

So far, I have not found anything that maps user recognizable names (those seen in System Preferences >> Network, for example) to interfaces. Xojo, and RS before it, is miserable in this regard (sorry, it just is). Can anyone suggest something other than MBS that would produce user recognizable names? Perhaps some other shell command? Or, MacOSLib? A way to access those “Public API’s in the SystemConfiguration framework”? Or anything else?

Many thanks
Jim Wagner
Oregon Research Electronics
and Bio & Eco Engineering, Oregon State University

There’s the “networksetup” command which can get and set a number of network related things.

Try this to start:

networksetup -listallhardwareports

Ahh, thanks - That does it!

Appreciate the suggestion.

Jim