Map Wi-Fi to en0 with networksetup -listallhardwareports

See every network hardware port, its BSD device name, and its MAC address — the key to most networksetup commands.

macOSnetworknetworksetupDiagnosticsLow risk
Run `networksetup -listallhardwareports` to list ports, then `networksetup -getinfo "Wi-Fi"` for one service's IP details.

01Command

Command
$ networksetup -listallhardwareports

02What it does

Almost every networksetup verb takes a service name, but tools like tcpdump and ifconfig use BSD devices — -listallhardwareports is the bridge that maps 'Wi-Fi' to en0 and shows each port's MAC address. `-getinfo <service>` prints the configured IP, subnet, router, and DNS for that service, whether from DHCP or manual setup. This is the fastest first step when scripting interface-specific network changes.

03Risk

RiskLow risk

04Undo

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

05Sources

Last verified: 2026-09-17 · Category: System & Settings

06Related solutions