Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

When I visit a website (e.g. whatismyip.com) it states that my IP address is 13.151.xxx.xxx. However, when I run ipconfig, my IP address is 192.168.0.xx for IPv4 and my DNS adress is 202.xx.xxx.xx.

Why is there a difference? Also, how can I find the first IP address through the command line?

share|improve this question

2 Answers 2

up vote 6 down vote accepted

In Linux if you type ifconfig it shows your system IP address. And in the browser if you enter www.ipaddress.com it shows your Internet connection IP address.

In your case,

  • 192.168.0.x --> System IP address
  • 13.151.xxx.xxx. --->Internet connection.

Always the IP address shown in the ifconfig is the first IP address

share|improve this answer
    
If I have a web server running from 192.168.0.x, how do I access it from the outside? –  ladaghini Dec 29 '11 at 9:13
    
You can grant access to internal systems using Port Forwarding. With Port Forwarding your router would redirect incoming connections for TCP port 80 to port 80 on your internal machine. –  chuck Dec 29 '11 at 13:41

Your computer is behind a router that is using NAT to share a single connection to the Internet. I would setup an account with dyndns.com and install the client on your computer. Once that is done you should always be able to find the IP of your router with a dns query for "yourname".dyndns.com. Some routers also have dynamic dns clients built in.

share|improve this answer
    
if someone ask me what is my IP, which one should I answer? –  KMC Dec 29 '11 at 5:25
6  
Your external if they're not in your home. Your internal if you're connected to the same network –  Canadian Luke Dec 29 '11 at 5:36

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.