Questions about IP

Discussion in 'Mac Basics and Help' started by OldMarketMeg, Dec 26, 2016.

  1. OldMarketMeg, Dec 26, 2016
    Last edited: Dec 26, 2016

    OldMarketMeg macrumors member

    OldMarketMeg

    Joined:
    Dec 19, 2016
    Location:
    Omaha
    #1
    From Terminal, how do I find my IP address?

    Based on some things I was researching last night, it appears there are a bunch of different types of IPs. :eek:
     
  2. OldMarketMeg thread starter macrumors member

    OldMarketMeg

    Joined:
    Dec 19, 2016
    Location:
    Omaha
    #3
    When I run that, I get a bunch of garbage on my screen.

    Where is my IP?

    (In Windows I think you type ipconfig and it just displays your IP and nothing more.)
     
  3. bcave098 macrumors 6502

    bcave098

    Joined:
    Sep 6, 2015
    Location:
    Northern British Columbia
    #4
    You'll need to be specific with Terminal. Your command should be "ipconfig getifaddr" then then interface name (such as en0, which you can get from ifconfig). It will come back with only the IP address.
     
  4. OldMarketMeg thread starter macrumors member

    OldMarketMeg

    Joined:
    Dec 19, 2016
    Location:
    Omaha
    #5
    What is en0? I could use a little more guidance, please.
     
  5. bcave098 macrumors 6502

    bcave098

    Joined:
    Sep 6, 2015
    Location:
    Northern British Columbia
    #6
    en0 is the first (Ethernet/Wi-Fi) network interface's name.
     
  6. OldMarketMeg thread starter macrumors member

    OldMarketMeg

    Joined:
    Dec 19, 2016
    Location:
    Omaha
    #7
    And that returns nothing
     
  7. jerwin macrumors 65816

    Joined:
    Jun 13, 2015
    #8
    en0 is your ethernet port. If you use 802.11, the relevant interface might be en1.

    Code:
    Typhon:~ jeremy$ ipconfig getifaddr en0
    
    Typhon:~ jeremy$ ipconfig getifaddr en1
    
    192.168.1.151
    
    However, if your ip address belongs to a private network block, you'll need to query your router for the public facing address. Routers vary.

    I'm able to access mine by typing http://192.168.1.1 in my browser. Obviously, this varies depending on which private network you're on, but it's very often obtained by replacing the last octet with a one.- 10.0.0.1, 172.16.0.1 etc, etc.
     
  8. OldMarketMeg thread starter macrumors member

    OldMarketMeg

    Joined:
    Dec 19, 2016
    Location:
    Omaha
    #9
    I connect to the internet using a wireless hotspot. So what do I use?
     
  9. jerwin macrumors 65816

    Joined:
    Jun 13, 2015
    #10
    probably en1 or en2.
     
  10. OldMarketMeg thread starter macrumors member

    OldMarketMeg

    Joined:
    Dec 19, 2016
    Location:
    Omaha
    #11
    If I run ipconfig getifaddr en1 then I get 192.168.1.xx

    What does that number represent?
     
  11. JohnDS macrumors 65816

    Joined:
    Oct 25, 2015
    #12
    It is a private IP address being handed out by the router. It is not visible from the internet.

    Exactly what is it you are trying to find out and why?

    If you want to know the IP address that is exposed to the internet, just go to http://whatismyip.com

    Just be aware, that that is actually the IP address assigned to your router. The router acts as a gateway and then uses Network Address Translation ("NAT") to provide individual private IP addresses to all devices on the local LAN. These IP addresses will have IP's in the form 192.168.x.x, but are used only on the local LAN and are not visible to the internet.
     
  12. OldMarketMeg thread starter macrumors member

    OldMarketMeg

    Joined:
    Dec 19, 2016
    Location:
    Omaha
    #13
    Yesterday I reading up about DNS and found some very interesting (and scary) websites about privacy. Unfortunately I accidentally closed my browser last night before bed and erased some of these unbookmarked sites. However, one that I remember was a site called DoILeak.

    This site or another related one talked about this thing called "WebRTC IP Leak".

    The first thing I am trying to understand is what are the different types of IP addresses a person can have?

    For example, on my Mac I use a wireless hotspot to connect to the Internet since I travel a lot and like the security that my own hot spot provides.

    When I ran that test above, combined with trying various commands in Terminal, I saw all of these different IP addresses and don't understand what they represent.

    Does that help you understand where I am going with my questions? :(
     
  13. JohnDS macrumors 65816

    Joined:
    Oct 25, 2015
  14. OldMarketMeg thread starter macrumors member

    OldMarketMeg

    Joined:
    Dec 19, 2016
    Location:
    Omaha
    #15
    It must apply because I leaked!
    --- Post Merged, Dec 26, 2016 ---
    I am lost...

    I do not have a router. I have my Mac and a hot spot!

    Does my hot spot have an IP address?
     
  15. bcave098 macrumors 6502

    bcave098

    Joined:
    Sep 6, 2015
    Location:
    Northern British Columbia
    #16
    Everything connected to the internet has an IP address and everything that can share an Internet connection (at the consumer level anyway) works as a router.
     
  16. OldMarketMeg thread starter macrumors member

    OldMarketMeg

    Joined:
    Dec 19, 2016
    Location:
    Omaha
    #17
    So you imply that my Mac has an IP, and my hot spot has an IP, and if I use a VPN then that has an IP, right?

    Does anything else I use have an IP?

    If I go to Starbucks to have a coffee and respond to posts on MacRumors, then does the free Wi-Fi I am using have an IP too?

    (Trying to learn more an=bout how networking works.) ;)
     
  17. bcave098 macrumors 6502

    bcave098

    Joined:
    Sep 6, 2015
    Location:
    Northern British Columbia
    #18
    Yes.

    (If it's online it has an IP address. Think of IP addresses like physical mailing addresses, you need one to get mail, or data)
     
  18. OldMarketMeg, Dec 26, 2016
    Last edited: Dec 26, 2016

    OldMarketMeg thread starter macrumors member

    OldMarketMeg

    Joined:
    Dec 19, 2016
    Location:
    Omaha
    #19
    So an IP of 192.168.1.xx is a "private" IP and that is used by my "router" to identify computers in my personal network?
     
  19. mfram macrumors 65816

    Joined:
    Jan 23, 2010
    Location:
    San Diego, CA USA
    #20
    Yes, everything connected to the Internet must have an IP address. But, believe me, it gets complicated quickly.
    Because IPv4 addresses have essentially been used up, there are "public" IPv4 addresses and "private" IPv4 addresses. Those computers with private IPv4 addresses must be connected to routers that have public addresses. Often times when your computer is using a private address there's no direct way for another computer to talk to your computer unless your computer talked to it first. As I said, it gets complicated. It also provides some level of security.
    Then there is IPv6. A newer form of addressing that alleviates the public/private routing issue. Your computer may have multiple IPv6 addresses. For example, your cellphone likely has several IPv6 addresses associated with it already. My iPhone currently has 3 global IPv6 addresses associated with it from Verizon.
    --- Post Merged, Dec 26, 2016 ---
    Yes, 192.168.x.y is one range of addresses assigned to mean private addresses. There are a few other ranges as well.
     
  20. OldMarketMeg thread starter macrumors member

    OldMarketMeg

    Joined:
    Dec 19, 2016
    Location:
    Omaha
    #21
    So in the IPv4 world, my hot spot servess as a router, and any computer connected to it has a "private" IP that the hot spot/router uses to identify it?

    So if I had three computers hooked up to my hot spot, then they might have private IPs like 192.168.1.1 and 192.168.1.2 and 192.168.1.3, right?
     
  21. mfram macrumors 65816

    Joined:
    Jan 23, 2010
    Location:
    San Diego, CA USA
    #22
    Yes, that's correct. One of the main reason private addresses are used is because it allows multiple devices to share one public address.
     
  22. JohnDS macrumors 65816

    Joined:
    Oct 25, 2015
    #23
    Exactly, although 192.168.1.1 is usually the private IP address of the router. (The router has two IP addresses -- a public IP address to connect to the internet and a private IP address to connect to the devices on the internal LAN.)
     
  23. mfram macrumors 65816

    Joined:
    Jan 23, 2010
    Location:
    San Diego, CA USA
    #24
    IP addresses are generally associated with IP interfaces. Every active interface will have at least one IP address associated with it. For example, your cellphone will have an address assigned to the WiFi interface and a different one assigned to the cellular interface assuming both are active. The routing rules help determine which interface (and thus which address) to use with every connection.
     
  24. wrldwzrd89 macrumors G5

    wrldwzrd89

    Joined:
    Jun 6, 2003
    Location:
    Solon, OH
    #25
    Yes. There's also, confusingly, THREE different private address spaces. 192.168.0.0 to 192.168.255.255 is one of them. 172.16.1.1 to 172.31.255.255 is another one that's less commonly used. The third one is the entire 10.x.x.x space, frequently found in enterprise settings (or anywhere else where there's MANY computers). Have you heard of the "tracert" (trace route) command? Try it with a domain, like, say, "forums.macrumors.com", and the Terminal will print out the route your packets are taking to get there from here (your computer). Each one of those stops along the way is either a router or server of some sort, and has an IP address of its own.

    And then there's the whole world of IPv6... which is a similar, yet WAY larger beast than IPv4.
     

Share This Page