This guide explains how to identify all relevant network information on
macOS using terminal commands.
It is designed to work correctly even when multiple network interfaces
are present (Wi-Fi, Ethernet, VPN, and system interfaces).
All information in this guide can be obtained using standard system commands available on macOS.
Applies to Mac computers using:
This guide helps you identify:
Network information on macOS is obtained using the following commands:
ifconfig
route -n get default
These commands display all network interfaces and routing information on the system.
ifconfig
The output is divided into blocks, one per network interface.
Each block in the output represents one network interface.
Common interface names on macOS include:
en0
Usually the Wi-Fi interface (most common on laptops)
en1 / en2
Ethernet or additional network adapters
utun0, utun1, utunX
VPN interfaces (only present when a VPN is connected)
lo0
Loopback interface (ignore)
bridgeX, awdl0, llw0
System or virtual interfaces (ignore)
Most systems show many interfaces. This is normal.
In most cases, use:
Ignore interfaces that:
inet addresslo0, bridge, awdl, or llwIf a VPN is connected, one or more utun interfaces will appear separately.
The local IP address identifies the Mac inside the local network.
To find it:
en0)inetExample:
inet 192.168.1.42 netmask 0xffffff00 broadcast 192.168.1.255
Meaning:
Typical local IP ranges:
The router IP address is obtained using:
route -n get default
Example output:
gateway: 192.168.1.1
Meaning:
A VPN IP address exists only when a VPN connection is active.
To find it:
utun0, utun1, utun2, etc.inet value under that interfaceExample:
utun4: inet 100.96.12.34 netmask 0xffffffff
Notes:
utun interface appears, no VPN is connectedThe MAC address uniquely identifies a network interface.
To find it:
etherExample:
ether ac:de:48:00:11:22
Important notes: