Knowing your Mac's IP address is important for setting up a network or sharing files, here's two different ways to find your IP address in Mac OS X; an easy way through the GUI and a more technical approach with the command line. These methods will be the same whether you are connected via ethernet or wireless.
This works the same in all versions of OS X on all Macs.
This is how to find the IP address of your Mac through the Terminal, this is often the quickest way for those that are more technically inclined.
The other command line option is to use: ipconfig getifaddr en1 which reports back only your en1 (usually wireless) IP address. You can change this to en0 for wired/ethernet too. I have heard ipconfig is not supported in all versions of Mac OS X so I did not recommend this as the first choice. However, using ipconfig you can also set your IP address from the command line.
This will instantly report back your external IP address. We covered this command when finding your external IP address in the past.
Gosh, why are you misinforming largely clueless people?
This in NOT one's Mac's IP address (on the net), it's a *LOCAL* address within the local area network, e.g. when you have a wireless router connected to your cable/DSL-modem. The address 192.168.0.0 is always the main node, usually the one built into the router, and you can have up to 254 other units connected to the same net (=capacity of the last component in the address; they are assigned in turn).
Try this, you'll immediately see the difference. And quit serving misinformation on the net, there's enough of such there already.
You don't know the difference between a local and external IP? Obviously the IP on a LAN is different.
The purpose of the article is to inform Mac users how to find their IP addresses. You often need to know what a local IP is for local file and print sharing (particularly true with a Windows & Mac OS X network), but the article covers finding both local and external IP addresses.
Perhaps you missed the last part of the article which discusses using curl to find an external IP address.
Thanks to you and not the 1st person who posted I could configure my internet.
I think that the problem is that ianf isn't a native speaker of English. I certainly understood the intent of the article, though some of it is still not clearly written after two plus years of scrutiny.
it should be noted that the address 192.168.0.0 is NOT ALWAYS the main node. It is certainly possible to be limited to fewer than 254 other addresses, or far, far more addresses. And IP addresses are not necessarily assigned "in turn" (though they usually are).
Where's 'hostname -i' like on linux when you need it?
This works on Linux too.
Or any of the other wonderful methods already posted.
Very good overview and explanation! I did not have any issues with the description provided. All of them worked and revealed the expected results! Thanks for that article.
I liked some of the alternatives since ifconfig en0 only gives me ipv6 address. So I though I'd add this for getting the LAN ipv4 address.