Find Your IP Address On A Mac
Why Do I Need To Know My IP Address?
If you’re doing home networking, you may need to know your IP address. For e.g.
if you want to exchange files between your Mac and windows PCs, you will need to
know your Mac IP address. It’s good to know the command to find out your
IP address. This post is about using the ifconfig Terminal command.
If you are familiar with the windows command ipconfig, the Terminal ifconfig is very similar.
Where Is ifconfig?
To bring up ifconfig, click on Finder – Applications – Utilities – Terminal. The Terminal window will
appear. At the prompt type in ifconfig and hit Enter. You will see something like this:
lo0: flags=8049mtu 16384 inet6 ::1 prefixlen 128 inet6 fe80::1%lo0 prefixlen 64 scopeid 0x1 inet 127.0.0.1 netmask 0xff000000 gif0: flags=8010 mtu 1280 stf0: flags=0<> mtu 1280 en0: flags=8863 mtu 1500 ether 00:25:4b:bb:ad:d8 media: autoselect status: inactive en1: flags=8863 mtu 1500 ether 00:25:00:46:ff:5b inet6 fe80::225:ff:fe46:ff5b%en1 prefixlen 64 scopeid 0x5 inet 192.168.1.6 netmask 0xffffff00 broadcast 192.168.1.255 media: status: active fw0: flags=8863 mtu 4078 lladdr 00:25:4b:ff:fe:bb:ad:d8 media: autoselect status: inactive vnic0: flags=8843 mtu 1500 ether 00:1c:42:00:00:08 inet 10.211.55.2 netmask 0xffffff00 broadcast 10.211.55.255 media: autoselect status: active vnic1: flags=8843 mtu 1500 ether 00:1c:42:00:00:09 inet 10.37.129.2 netmask 0xffffff00 broadcast 10.37.129.255 media: autoselect status: active
ifconfig Format
The leftmost column displays device names followed by a colon. The ones we’re interested in
are the ones that have a status of “active” where I have boldfaced the active
sessions for my Mac. Where you see the line that begins with inet, the ip address is right next
to it. For this Mac, there are three ip addresses that can address it: 192.168.1.6, 10.211.55.2
and 10.37.129.2
Device Names
There *is* some rhyme or reason to the device names. The en0 device is for the wired ethernet
connection on my Mac. At the moment it is not being used and hence its status is inactive.
The en1 device refers to my Air Port (wireless) connection. The vnic0 device is a virtual
network interface card zero; the vnic1 device is a second virtual interface. The lo0 device is
testing the loopback, the default “address” used to test the ip configuration of a workstation.
The fw0 device refers to the firewire interface. I’m not sure what the gif0 and stf0 are for; these could
be “addressed” in a future post. No pun intended : ). Any of the active
ip addresses will work when addressing my Mac, but I would consider the en0 device the main
ip address since it is assigned to the Air Port.
IP Address Defined
The simplest definition that I can think of for an ip address is that it is similar to a house address.
When two devices are communicating with each other, each needs to know the other’s address to find
it. Each address is a series of four octets separated by periods. ww.xx.yy.xx Each octet ranges from
0 to 255. The address that your workstation is assigned is dependent upon the “network” that it’s in.
For most home router networks, they usually begin with 192 dot something. This is only used for home networks.
If you have a static ip address from your internet provider, it will most likely be some other number
combination.
Every device on the internet has to have an ip address. Even places like google and yahoo have
addresses. How do you find their address? You can go to Terminal and do a ping of the url.
For e.g. ping www.google.com; then hit control-z to stop sending bytes.
TomsMacBookPro:~ Tom$ ping www.google.com PING www.l.google.com (74.125.95.147): 56 data bytes 64 bytes from 74.125.95.147: icmp_seq=0 ttl=53 time=26.834 ms 64 bytes from 74.125.95.147: icmp_seq=1 ttl=53 time=24.630 ms 64 bytes from 74.125.95.147: icmp_seq=2 ttl=53 time=25.069 ms 64 bytes from 74.125.95.147: icmp_seq=3 ttl=53 time=25.810 ms 64 bytes from 74.125.95.147: icmp_seq=4 ttl=53 time=35.377 ms ^Z [4]+ Stopped ping www.google.com TomsMacBookPro:~ Tom$
To test the ip address, if you bring up your browser and type in
http://74.125.95.147 google should come up.
If you enjoyed this article, you may also like:
Is it me or did this article make you want to buy an iPad?
Is it me or did this article make you want to buy an iPad?
Thanks
Thanks
Hey can I use some of the information here in this post if I reference you with a link back to your site?
Reynaldo,
Yes you may reference my information as long as you reference where you received it from. Your welcome. Tom