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

Applies to Mac computers using:


What information you will find

This guide helps you identify:


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

  1. Open Terminal
  2. 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:

Most systems show many interfaces. This is normal.


Which interface should you use?

In most cases, use:

Ignore interfaces that:

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:

Example:

inet 192.168.1.42 netmask 0xffffff00 broadcast 192.168.1.255

Meaning:

Typical local IP ranges:


Router (gateway) IP address

The router IP address is obtained using:

route -n get default

Example output:

gateway: 192.168.1.1

Meaning:


VPN IP address

A VPN IP address exists only when a VPN connection is active.

To find it:

Example:

utun4: inet 100.96.12.34 netmask 0xffffffff

Notes:


MAC address (hardware address)

The MAC address uniquely identifies a network interface.

To find it:

Example:

ether ac:de:48:00:11:22

Important notes: