An IP address is a unique string of numbers separated by dots that identifies a network or the connections on a network. You will sometimes need to know your network’s or device’s IP when setting up and configuring a network or applications that run on that network.
Did you know there are external and internal IP addresses? The external or public IP usually identifies the network, while internal or local IPs identify the connection of a device inside the network.
You can find both IP addresses on your Mac using the Terminal application by typing a simple curl or ifconfig command.
My name is Eric, and I have worked with computer systems and networks for over 25 years. IP addresses are nothing new, and as a software engineer, I need to find and use them frequently. I can show you how to do this with a couple of straightforward commands.
Keep reading below if you would like to see how to find an IP address on Mac through Terminal.
- Two Types of IP Addresses
- How to Find Your IP Address on Mac
- Other Methods for Finding IP Addresses
Two Types of IP Addresses
For our discussion here, there are really two types of IP addresses that we need to worry about. There are internal (or local) and external (or public) addresses. We will be using different methods to find each of them so let’s quickly go over the difference between the two.
Internal or Local IP Addresses
Internal or local IPs are assigned within a network (like the one your router manages in your home). Each connection to a device inside a network has its own address. The connection can be to a laptop, desktop computer, printer, phone, etc. This category can be separated further into wireless and wired connections.
These IP addresses, for the most part, are only visible inside your home network.
External or Public IP Addresses
An external or public IP is the one that the network uses to connect to the outside world or the internet. Your home network probably has a wireless router, and the connection or address that router uses to connect to the internet is the external IP address.
The external IP address is visible to the outside world and is seen by every site you visit. It’s also attached to emails you send, instant messages, and anything else that goes outside your network unless you use a VPN to hide it.
Your external IP address can provide information to others, such as your location and internet service provider. It can be used for things like sending your local advertisements or preventing (or allowing) specific content through your ISP.
Your external or public IP is a unique address that identifies you and your online actions.
How to Find Your IP Address on Mac
As we have seen above, there are two types of IP addresses that we can look for, and each one has a different method to do so. See the sections below to see how to find each.
For each of these methods, you will first need to open the Terminal application if you don’t already have it opened.
Internal or Local
If you are looking for the IP address of your Mac and it is connected by Wi-Fi to the network, type the command shown below.
ipconfig getifaddr en0
After typing the command, you will see the internal or local IP address as shown above.
If you are looking for the IP address and your Mac is connected to the network by a wired connection, type the command shown below.
ipconfig getifaddr en1
After typing this command, you will see an output similar to the one above, but it will be a different IP address since it will be a different connection.
External or Public
You should only have one external or public connection for your network, which will be the IP that your router is connected to and is designated by your internet service provider. You can use the command below to find the external IP address.
After typing in the command, you will see the external or public IP address as shown above.
Other Methods for Finding IP Addresses
If you’re not comfortable using the Terminal application or prefer to use desktop tools, there are ways to find IP addresses without Terminal. You can even get applications from the AppStore that will retrieve the information for you.
The main focus of this article was finding it through Terminal, so I will not show all the other methods here, but I will offer a couple of examples.
Finding Internal or Local IP Addresses on your Desktop
One quick way to see the local IP address that your Mac is connected to is to look under your System Preferences. Just follow the steps below.
Step 1: Click on the System Preferences Icon.
Step 2: In the System Preferences window, click on Network.
Step 3: Here, you will see the local or internal IP address that your Mac is connected to.
You can see the IP address located in the image above in the red box. The actual IP is blurred out for privacy reasons.
Finding the External or Public IP address using Google
If you want to find your external or public IP address for the network you are on, it is as simple as opening a web browser and going to google.com. Then all you have to do is type the following into the search field.
What is my IP address?
You will see your IP address displayed at the top of the search results.
Below are a few questions that are frequently asked about finding IP addresses.
Does my IP address give my location?
Yes, websites and other applications can find your location from your IP address. This is why you often see ads on your computer for local establishments, and it also allows search engines like google to give you local results when searching places like restaurants or stores.
What is the difference between an IP address and a MAC address?
An IP address identifies the connection, but a MAC address is a unique identifier of the actual device. Your device will always have the same MAC address, but the IP address will change depending on where you are connected to the network.
Can I find my Mac’s MAC address?
Yes, I don’t have time to go into detail here, but basically, you can use the same method shown above with System Preferences and Network. Click on the Advanced button and then the Hardware tab, and you will see the MAC address.
While there are multiple ways to find both Public and Local IP addresses, using the Terminal application on your Mac is the quickest and most straightforward. Each requires only one easy command that anyone can type.
I hope the information above can help you find your IP address using Terminal. As usual, let me know if you have any questions or comments. I would love to hear from you.