ipconfig getifaddr en0Print the local IPv4 address of en0 (Wi-Fi on most Macs).
When to use it
You need your local IP to connect other devices to your Mac (file sharing, a dev server, printers) or to set up port forwarding. You need your public IP for remote access, allow-lists and support requests.
Steps
Local IP in System Settings
Open System Settings › Network, click Wi-Fi (or your Ethernet adapter), then Details › TCP/IP. The IP Address field is your local address; Router is your gateway.Local IP in Terminal
en0 is Wi-Fi on most Macs; Ethernet adapters are en1, en2 and so on. Nothing printed means that interface has no address.ipconfig getifaddr en0All addresses with ifconfig
ifconfig lists every interface with its IPv4 (inet) and IPv6 (inet6) addresses.ifconfig en0 | grep inetYour public IP
Websites see your router's public address, not your local one. Ask a service for it: curl -s https://api.ipify.org.dig +short txt ch whoami.cloudflare @1.1.1.1
Output explained
ipconfig getifaddr en0 prints just the address, such as 192.168.1.23.
ifconfig en0 shows more:
en0: flags=8863<UP,BROADCAST,SMART,RUNNING,SIMPLEX,MULTICAST> mtu 1500
ether a6:c7:2b:7c:db:e4
inet6 fe80::5f:daca:262:290f%en0 prefixlen 64 secured scopeid 0xe
inet 192.168.1.23 netmask 0xffffff00 broadcast 192.168.1.255
inet6 2001:db8:452b:8d00:dd9c:206e:79c:6f02 prefixlen 64 autoconf temporary
- inet is the IPv4 address. netmask 0xffffff00 is 255.255.255.0 in hex, a /24.
- inet6 fe80::… is the link-local IPv6 address every interface has.
- inet6 … temporary is a privacy address macOS uses for outgoing IPv6 connections and rotates regularly.
- ether is the MAC address; with Private Wi-Fi Address it's a random, locally administered one.
Options and variations
| Flag | Meaning | Example |
|---|---|---|
| ipconfig getifaddr IF | IPv4 address of one interface | ipconfig getifaddr en0 |
| ipconfig getpacket IF | DHCP details: address, router, DNS, lease time | ipconfig getpacket en0 |
| route -n get default | Which interface and gateway carry internet traffic | route -n get default |
| networksetup -getinfo SERVICE | IP, subnet mask and router for a network service | networksetup -getinfo Wi-Fi |
Common errors
| Error | Cause | Fix |
|---|---|---|
| ipconfig getifaddr en0 prints nothing | en0 isn't your active interface, or it has no address | Run route -n get default to see the active interface, then use it. |
| Address starts with 169.254 | DHCP failed and macOS assigned itself a link-local address | Renew the DHCP lease or restart the router. |
Do it in the app
LightAtom's Map starts every arc at your home location, taken from your time zone or set by you.
Frequently asked questions
How do I find my IP address on a Mac?
System Settings › Network › Wi-Fi › Details › TCP/IP shows your local IP. In Terminal, ipconfig getifaddr en0 prints it. For the public IP, run curl -s https://api.ipify.org.
What's the difference between my local and public IP?
The local IP (like 192.168.1.23) identifies your Mac on your home network. The public IP belongs to your router and is what websites see. Several devices share one public IP.
Is ipconfig the same as on Windows?
No. On a Mac, ipconfig is a different tool for DHCP and interface info (getifaddr, getpacket). The macOS equivalent of Windows ipconfig /all is ifconfig.
Which interface is Wi-Fi on my Mac?
Usually en0. Run networksetup -listallhardwareports to see each hardware port and its device name.