How to find my computer's IP Address?

1

I'm a total noob about TCP/IP, now reading some document (Sams Teach Yourself TCP/IP in 24 hours). However, I still don't get some concepts.

First of all, when I type "what's my ip address" in Google, it shows an address starting with 88.225 something, cool, but when I make this search from another computer in my home, it shows the exact same ip address. So it is probably the router's address for my ISP, right?

So how do I find my computer's (or network adapter's) ip address?

P.S. (a long one)

I need to know this because I want to setup a Unity Masterserver, in my old pc, which has ubuntu server installed. So any help about Ubuntu server - public(or static?) ip address setup is also much appreciated. But again, maybe everything will work if I know the public ip address of that machine.

That machine shows an ip like 192.168.1.36, and I can connect to it from my computer (connected to the same router) but of course not from another location. So I need to know it's "real(?)" ip address.

Thanks !

P.S. 2:

Neither ipconfig in windows' cmd, nor ifconfig in Ubuntu Server terminal gives useful information. They just print IP's that start with 255.255, and 192.168..

P.S 3:

There is obviously something so simple, that I don' know, and you assume that I know. But I don't know what it is:) I'll just write my guesses here. Please tell me if they are irrelevant.

  • Should I setup a static-ip instead of using DHCP. If so, how?
  • Should I somehow "figure out" my IP from that "88.225.." one, combined with my "local ip" ?

jeff

Posted 2013-07-27T15:12:55.623

Reputation: 489

Question was closed 2013-07-27T15:32:00.800

Your question is a little confusing. Do you want to set up a server that is reachable from the outside (i.e. "the Internet"), and not just your network? – slhck – 2013-07-27T15:22:21.693

Yes, of course. But that's the side question, really. I need the basics first. How do I know what my reachable-from-outside IP is? – jeff – 2013-07-27T15:23:27.373

http://checkip.dyndns.org/ will tell you your public IP at the moment. Whether or not it belongs to just you is up to your isp. – dbasnett – 2013-07-27T15:26:54.590

1Your "reachable-from-outside" IP is the one with 88.225. It helps to ask about the actual problem you're facing, since that'll give you the better answer. – slhck – 2013-07-27T15:28:21.907

@dbasnett thanks, but it prints the same ip. I just don't get it. So should I request a special - static ip from my ISP ? – jeff – 2013-07-27T15:29:30.700

1

I think your question can be answered by: What is port forwarding and what is it used for?

– slhck – 2013-07-27T15:30:31.543

@slhck you are definitely right, but I really don't know what the problem is. So when I type that ip, I will connect to my home network. But which computer in the home network ? Should I do port forwarding and connect to a certain socket ? edit: I saw your new comment. browsing that thread now. Thanks ! – jeff – 2013-07-27T15:30:32.440

Yes, that's precisely what you need to do. Your router will then forward all requests that are made to your public (outside) IP to an internal (192.168…) one, e.g. the Ubuntu server. – slhck – 2013-07-27T15:33:00.367

Ok, thanks @slhck (not for closing my question :) ) But for all the help. I cannot upvote anyone, so thank you all. – jeff – 2013-07-27T15:35:14.540

Get ipv4, ipv6 Address: ifconfig eth | grep inet Get default GW (gateway): ip route | grep default install cURL: sudo apt-get install curl Get public IP address: curl http://checkip.dyndns.org 2> /dev/null| perl -pe 's,.*Address: (\d+\.\d+\.\d+\.\d+).*,$1,' – STTR – 2013-07-27T16:18:29.423

Answers

2

Strictly speaking, your computer doesn't have an IP address that's reachable from outside. It only has a private IP address somewhere in the 192.168.0.0/16 range. It doesn't matter if it's assigned statically or by DHCP.

(The 255.255.x.x thing is probably a netmask, used to determine which IP addresses belong to the same LAN.)

Only the router has a public IP address, and it's the same one that Google and various other websites tell you. When your computer sends any packets to the Internet, the router changes the sender's address from the internal one to the router's public one (performs NAT). When receiving packets, it searches its NAT table for matching addresses and TCP/UDP ports, and changes the recipient's address back to the internal one.

However, if there are no matches – for example, if someone outside is trying to create a new connection – then the router doesn't know which internal address to use, and usually just drops the packet. This is what I meant by "doesn't have an address that's reachable from outside". Of course, it's possible to create static forward rules, e.g. "connections to TCP port 22 → internal address 192.168.42.1".

user1686

Posted 2013-07-27T15:12:55.623

Reputation: 283 655

The router may or may not have a public IP. An ISP may have layers of routers with private IP's. – dbasnett – 2013-07-27T15:48:49.003

1

Usually one would find his or her own IP address by looking at the configuration on the computer. E.g. on windows type ipconfig. On OSx, BSD, Linuxes, ... use ifconfig.

As to you getting just one IP. I strongly suspect that:

  1. Your IP is 192.168.1.100 or similar (which is the default DHCP range for IPs in most SoHo devices)
  2. That you only have one non RFC 1918 IP (aka one real public routable IP) and that your home setup is using a terrible kludge called NAT to work around this.

[Post edits]

Yes, of course. But that's the side question, really. I need the basics first. How do I know what my reachable-from-outside IP is?"

There are at least three ways to do that:

  1. Go to another computer and ask it where your are coming from. (The wehatis myIP website makes it easy by putting that information in a webpage. That 88.225.x.x IP is your public IP.
  2. Check your providers modem. It will list wich IP it is using (even if it got the IP via DHCP from your ISP).

Hennes

Posted 2013-07-27T15:12:55.623

Reputation: 60 739

I take the opportunity to comment. Sorry. Because My comment in question's not visible. Get ipv4, ipv6 Address: ifconfig eth | grep inet Get default GW (gateway): ip route | grep default install cURL: sudo apt-get install curl Get public IP address: curl http://checkip.dyndns.org 2> /dev/null| perl -pe 's,.*Address: (\d+\.\d+\.\d+\.\d+).*,$1,' Thank you. – STTR – 2013-07-27T16:26:35.507