Map Interface Names with networksetup -listallhardwareports

Print the hardware port table linking enX devices to service names and MAC addresses.

macOShardwarenetworksetupLow risk
Run `networksetup -listallhardwareports` to see each Hardware Port, its enX device, and Ethernet address.

01Command

Command
$ networksetup -listallhardwareports

02What it does

Nearly every networksetup command needs a service name, while most system tools report device names like `en0` — this command is the bridge between the two worlds. It also reveals which port is Wi-Fi, Thunderbolt, or a VPN's virtual adapter, and prints each port's MAC address for DHCP-reservation or filtering work. Its three-line blocks parse cleanly with awk, making it a favorite first step in network scripts.

03Risk

RiskLow risk
!Warning: The service name shown here is what other networksetup commands expect; using the device name (en0) instead usually fails.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

Last verified: 2026-09-17 · Category: Network

06Related solutions