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.
01Command
$ networksetup -listallhardwareports02What 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
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- NETWORKSETUP Command: Configure network settings in macOSEvidence: Documents -listallhardwareports and -getinfo for mapping services to device names and reading per-service configuration.
- Introduction to System Configuration Programming GuidelinesEvidence: Apple's system configuration framework documentation underlying network services and ports.
Last verified: 2026-09-17 · Category: System & Settings
06Related solutions
Erase the broken Spotlight database so macOS re-indexes your drive from scratch.
Read the serial number, model identifier and chip without opening About This Mac.
See how many charge cycles the battery has used and its health condition.