Apple - How can I find my IP address - not my company's router, but my local machines
I used:
ipconfig getifaddr en1
There are several methods...
...but some methods give different kinds of IP addresses. Make sure you know which kind of IP address you need. For many (most?) purposes, the public IP address is what's required.
- Your public IP address is the one people on the internet will see. (This is usually what people mean if they don't specify which kind of IP address.)
- Your local IP address is the one that your router uses to communicate with you on your local area network.
Note: in certain situations, your local IP address may be the same as your public IP address.
Here's a few ways to get each kind of IP address:
#1: From the WiFi menubar -- gives your LOCAL IP address
Hold option and click on the WiFi icon in the menubar at the top-right corner of your screen. You will see a special menu that lists, among many other things, your IP Address.
#2: From Network Preferences -- gives your LOCAL IP address
There are two ways to get to Network Preferences:
- Click on the WiFi icon in the menubar, then select "Network Preferences"
- Go to the System Preferences (either on your Dock at the bottom of the screen or by searching for it with Spotlight), then open "Network".
You'll see your IP address as shown:
#3: From a terminal (Method A) -- gives your LOCAL IP address
Fire up your favorite terminal (e.g. Mac OS X comes with one called Terminal), and type the following:
ipconfig getifaddr en0
if connected via a wireless connection.ipconfig getifaddr en1
if connected via ethernet.ipconfig getifaddr en3
if connected via a Thunderbolt-to-ethernet adaptor.
#4: From a terminal (Method B) -- gives your PUBLIC IP address
Fire up your favorite terminal (e.g. Mac OS X comes with one called Terminal), and type curl http://ipecho.net/plain; echo
.
#5: From a browser -- gives your PUBLIC IP address
There are many websites you can use that will tell you your public IP address. The simplest is probably a Google search for "what is my ip address".
I can't believe nobody has suggested the simplest method of all, only 2 clicks (or 3 if your adapter isn't at the top of the list).
Click System Preferences, click Network.
It will display the IP address of the adapter under Status to the right of the network adapters. If your device isn't at the top (which will be the default selected) then simply click on the one with the green status. It's going to be either Wi-Fi or Ethernet.