• Skip to primary navigation
  • Skip to main content
Sal Ferrarello
  • About Sal Ferrarello
  • Speaking
  • Connect
    Mastodon GitHub Twitter (inactive)
You are here: Home / Computing / Find Your Local IP Address
Speaking: Sal is one of the speakers at WordCamp Montclair on June 24, 2023 and tickets are only $25!

Find Your Local IP Address

Last updated on November 13, 2013 by Sal Ferrarello

Find Your Local IP Address on Your Mac

ipconfig getifaddr en0 (primary)
or
ipconfig getifaddr en1 (secondary)

How do I know which to use?

It is common for Mac laptops to have one (wireless only) or two (wired and wireless) network connections.  When a wired connection is present, it is the primary connection (with wireless as secondary).  When there is only wireless, that is the primary connection.

Windows Machine

From the command line: ipconfig

Why would you want to find your local IP address?

My use case is I develop websites locally on my machine (i.e. instead of running on a server on the internet, the website I’m working on is just on my machine).  I can load these sites at http://localhost/ or http://127.0.0.1/, which works great.  However, I also need to test the sites on IE (since occasionally IE does not render the same as other browsers).  To this end, I’m running Virtual Box with an instance of Windows 7 on my machine.  The problem occurs when I try to load the local site in Virtual Box at http://localhost/, this does not work.  Inside Virtual Box localhost refers to my Virtual Machine not my real machine running it (this is starting to feel a little like Inception).  The solution is not to load the site at localhost nor 127.0.0.1 but instead to use the IP address assigned to my machine by the local network.  For example currently my machine is at http://192.168.1.105/ on my local network.  Solved.  New problem, how do I determine the IP address on my local network.

Sal Ferrarello
Sal Ferrarello (@salcode)
Sal is a PHP developer with a focus on the WordPress platform. He is a conference speaker with a background including Piano Player, Radio DJ, Magician/Juggler, Beach Photographer, and High School Math Teacher. Sal can be found professionally at WebDevStudios, where he works as a senior backend engineer.

Share this post:

Share on TwitterShare on FacebookShare on LinkedInShare on EmailShare on Reddit

Filed Under: Computing Tagged With: network

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Copyright © 2023 · Bootstrap4 Genesis on Genesis Framework · WordPress · Log in