Network Information on macOS
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.
Supported systems
- macOS Ventura
- macOS Sonoma
- Newer macOS versions
Applies to Mac computers using:
- Wi-Fi
- Ethernet
- VPN connections
What information you will find
This guide helps you identify:
- Local IP address (LAN)
- Router (gateway) IP address
- VPN IP address (if connected)
- MAC address (hardware address)
- The correct network interface to use
Commands used
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.
How to run the commands
- Open Terminal
- Run:
ifconfig
The output is divided into blocks, one per network interface.
Understanding network interfaces
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.
Which interface should you use?
In most cases, use:
- en0 → Wi-Fi (most common)
- en1 or en2 → Ethernet (if using a cable)
Ignore interfaces that:
- Do not show an
inetaddress - Are named
lo0,bridge,awdl, orllw - Are clearly system or virtual interfaces
If a VPN is connected, one or more utun interfaces will appear separately.
Local IP address (LAN)
The local IP address identifies the Mac inside the local network.
To find it:
- Locate the active enX interface (usually
en0) - Identify the line starting with
inet
Example:
inet 192.168.1.42 netmask 0xffffff00 broadcast 192.168.1.255
Meaning:
- 192.168.1.42 → local IP address
Typical local IP ranges:
- 192.168.x.x
- 10.x.x.x
- 172.16.x.x
Router (gateway) IP address
The router IP address is obtained using:
route -n get default
Example output:
gateway: 192.168.1.1
Meaning:
- 192.168.1.1 → router (default gateway)
VPN IP address
A VPN IP address exists only when a VPN connection is active.
To find it:
- Look for interfaces named
utun0,utun1,utun2, etc. - Identify the
inetvalue under that interface
Example:
utun4: inet 100.96.12.34 netmask 0xffffffff
Notes:
- VPN IP is different from the local IP
- If no
utuninterface appears, no VPN is connected
MAC address (hardware address)
The MAC address uniquely identifies a network interface.
To find it:
- Use the same enX interface used for the local IP
- Identify the line starting with
ether
Example:
ether ac:de:48:00:11:22
Important notes:
- Wi-Fi and Ethernet adapters have different MAC addresses
- MAC addresses do not change between networks
- VPN interfaces use virtual addresses