
Your Mac’s local IP address identifies it on the current network, such as your home Wi-Fi or office Ethernet network. The quickest Terminal method is:
- Open Terminal.
- Run:
ipconfig getifaddr en0
- Read the result. If your Mac is using Wi-Fi and the command returns an address such as
192.168.1.24, that is the Mac’s local IPv4 address on that network.
The interface name may differ. On many Macs, en0 is Wi-Fi, but you can verify the active interface before relying on it.
What a local IP address is
A local IP address is assigned to your Mac by the network’s router or another DHCP server. It allows devices on the same local network to communicate with one another.
Common private IPv4 address ranges include:
192.168.x.x10.x.x.x172.16.x.xthrough172.31.x.x
A local IP address is different from your public IP address. Your public address identifies your internet connection to websites and online services; the commands in this guide find addresses assigned to your Mac on local network interfaces.
A Mac can have more than one local address if it is connected to multiple networks, such as Wi-Fi and Ethernet, or if it has active virtual network interfaces.
Find the local IP address with ipconfig
The ipconfig command can retrieve the IPv4 address assigned to a specific network interface. It only displays the address; it does not change your network settings.
Find the address on the common Wi-Fi interface
First, run the command for en0:
ipconfig getifaddr en0
If en0 is the active interface with an IPv4 address, Terminal prints that address on its own line. If it prints nothing, en0 may not be connected, may not be the interface currently carrying network traffic, or may not have an IPv4 address.

This command is safe to run. It does not disconnect Wi-Fi, renew your lease, or modify any settings.
Check another interface
If en0 does not return an address, try en1:
ipconfig getifaddr en1
This also only reads the address assigned to the specified interface. Do not assume that en1 is always Wi-Fi; interface assignments can vary between Macs and network configurations.
Identify the active interface with route
When you do not know which interface is being used for the default network connection, use route:
route get default
The command asks the routing table which interface handles the default route—the route normally used to reach destinations outside the local network. Look for a line beginning with interface:. Its value may be en0, en1, or another interface.
For example, if the output identifies en0, retrieve its IPv4 address with:
ipconfig getifaddr en0
Replace en0 with the interface name shown by your own command. Both commands only inspect network information and do not change the Mac’s configuration.

The default route is useful when you want the address associated with the connection currently used for general network traffic. It may not show every address assigned to the Mac.
List all addresses with ifconfig
Use ifconfig when you need to inspect every network interface and its assigned addresses:
ifconfig
The output is grouped by interface. For each interface, look for an inet line. The address immediately following inet is an IPv4 address.
Do not confuse these entries:
inetis an IPv4 address.inet6is an IPv6 address.127.0.0.1is the loopback address, which points back to the Mac itself and is not the address other devices normally use to connect to it.169.254.x.xis a self-assigned IPv4 address. It often indicates that the Mac did not receive an address from the network’s DHCP server.192.168.x.x,10.x.x.x, and addresses in the private172.16.x.x–172.31.x.xrange are commonly local network addresses.
ifconfig is a read-only diagnostic command in this use. It does not alter interfaces or disconnect the Mac.
If the output is long, filter it to show IPv4 lines:
ifconfig | grep 'inet '
This command passes the output of ifconfig to grep, which keeps lines containing inet. The trailing space helps avoid matching inet6. It still may include the loopback address and addresses belonging to virtual or inactive interfaces, so check the interface headings when choosing the relevant result.

Find the address for a specific network service
networksetup can display details for a named network service, such as Wi-Fi or Ethernet. To list the service names configured on the Mac, run:
networksetup -listallnetworkservices
This command lists configured network service names. It does not change them.
To display the IPv4 address for Wi-Fi, run:
networksetup -getinfo Wi-Fi
Look for the line labeled IP address. The service name must match the name shown by -listallnetworkservices. If your Mac uses a different service name, substitute that exact name. For example, the command structure is:
networksetup -getinfo "Service Name"
Quotation marks are useful when a service name contains spaces. Replace Service Name with the real name; do not run the example unchanged unless that is actually the service name on your Mac.
To inspect Ethernet instead, first confirm its configured service name, then use the same pattern:
networksetup -getinfo Ethernet
These commands report configuration details and do not modify the network service. Avoid commands such as -setmanual, -setdhcp, or -setnetworkserviceenabled unless you specifically intend to change network behavior and understand how to restore it.
Which Terminal method should you use?
Use the method that matches what you need:
- Quick answer for a likely Wi-Fi connection:
ipconfig getifaddr en0 - Find the interface used by the default route:
route get default - Inspect all interfaces and addresses:
ifconfig - View the address through a named service such as Wi-Fi:
networksetup -getinfo Wi-Fi
For ordinary troubleshooting, start with route get default, then use the interface it reports with ipconfig getifaddr. This avoids guessing whether en0 or another interface is currently active.
If you are diagnosing a specific application or connection, identifying the Mac’s address is only one part of the process. You may also need to inspect active connections or determine whether a particular port is being used.
Troubleshooting
ipconfig getifaddr prints nothing
An empty result usually means the selected interface has no IPv4 address. Check the default route:
route get default
Then run ipconfig getifaddr with the interface shown after interface:. If there is no default route, check whether Wi-Fi or Ethernet is connected in System Settings.
The result starts with 169.254
A 169.254.x.x address is self-assigned. It generally means the Mac did not obtain a normal address from the network’s DHCP server. Check the network connection, verify the router is available, and reconnect to the network if necessary.
Do not manually replace the address unless you know the network’s required settings. A manual address can create conflicts with another device or prevent access to the network.
Several addresses appear
This can happen when Wi-Fi, Ethernet, a VPN, virtual machines, containers, or other network services are active. Use:
route get default
The interface shown for the default route is usually the best starting point for the Mac’s current primary connection. If you need to connect to a device on a particular network, choose the address belonging to that network’s interface instead.
You need an IPv6 address
The basic ipconfig getifaddr command returns an IPv4 address. To inspect IPv6 addresses, use:
ifconfig
Look for inet6 under the relevant interface. IPv6 addresses are longer and commonly include colon-separated hexadecimal groups. Link-local IPv6 addresses beginning with fe80:: are limited to the local network segment and may require a scope identifier when used in commands.
The address changes
Addresses assigned by DHCP can change after reconnecting to a network, restarting the router, or allowing the DHCP lease to be renewed. Do not treat a local IP address as permanent unless the network administrator has configured a reservation or static assignment.
You are trying to find your public IP address
These commands show addresses assigned to local interfaces. They do not show the public address assigned to your internet connection. A router typically performs network address translation, so the Mac’s local address and the connection’s public address are different.
You need to connect from another device
Confirm that both devices are on the same network and that the service you want to use is running on the Mac. A local address alone does not make an application reachable. macOS firewall settings, the application’s listening address, permissions, VPN software, and router isolation can all affect connectivity.
For related diagnostics, you can inspect open network connections with this Terminal guide.
Frequently Asked Questions
What is the fastest command to find a Mac’s local IP address?
Try:
ipconfig getifaddr en0
If it returns nothing, use route get default to identify the active interface and run ipconfig getifaddr with that interface.
Is en0 always Wi-Fi?
No. en0 is a network interface name, but its role can vary by Mac and configuration. Verify the active interface with:
route get default
Can I find the local IP address without changing anything?
Yes. ipconfig getifaddr, route get default, ifconfig, and networksetup -getinfo are diagnostic commands when used as shown here. They read network information and do not change settings.
Why does my Mac have more than one local IP address?
Your Mac may have multiple active interfaces or network services. Wi-Fi, Ethernet, VPNs, virtual machines, and other software can each create interfaces or addresses.
Is a local IP address private?
A local address is generally not directly routable across the public internet. However, it still identifies your Mac within the local network, so avoid sharing network details unnecessarily and use appropriate account security.
Final Thoughts
For a quick check, run ipconfig getifaddr en0. If that produces no result, run route get default to identify the active interface, then query that interface with ipconfig getifaddr. Use ifconfig when you need a complete view of the Mac’s network interfaces and addresses.