1

I'm using centOS 6.3 on virtualbox as guest OS on Win 7 host. My problem is when I use ifconfig command in terminal, I'm being thrown internal IP address(10.x.x.x). However, when I googled "my IP address" I got my actual IP address. The same thing happens when I type ipconfig in DOS prompt. Is there a way to get external IP address in those places?

1

What you describe as your "actual" IP address isn't, it is the IP address of your router, or anything else that got an IP address from your provider and acts as an intermediary for your computer to the internet. That is why your (windows) hosts provides an internal address as well.

Your VirtualBox host gives out IP addresses in the range 10.x.x.x by default and acts as another intermediary.

To get the external IP assigned to your router, you can use:

curl icanhazip.com

But be aware that such services can go out of business without notice. If that is a problem, setup a service yourself on a public server you have access to, or interface with your router to get its public IP address.

1

Another way to get your public ip address would be with this command

dig +short myip.opendns.com @resolver1.opendns.com

You can read a detailed explanation here https://askubuntu.com/questions/95910/command-for-determining-my-public-ip

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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