Sunday, June 8, 2014

Checking and modifying external IP address inside my Ubuntu Virtual Box

Inside the Ubuntu host:
$ curl -s checkip.dyndns.org | sed -e 's/.*Address: //' | sed -e 's/<.*//'
46.126.152.130

On my Windows 7 guest I simply go to http://checkip.dyndns.org/:
Current IP Address: 46.126.152.130

So it's the same.

Now let's see if I can change that address in my Ubuntu host. I came across vpnbook.com which seems to be free and has a tutorial on how to do it in Ubuntu.

The first step is to install OpenVPN and configure it. Here's the page for 14.04 -- there is plenty of outdated documentation on the web which has wrong directories. However, don't do all the shell commands -- there is a much easier way.
List of allowed SSL country codes -- "CH" for Switzerland.

I spent 2-3 hours trying to get it to work, but couldn't. Then I found
http://ubuntuhandbook.org/index.php/2014/05/establish-openvpn-connection-ubuntu-1404/
and had it up and running in 2 minutes! Essentially it's about transferring all the parameters in the ovpn file to Ubuntu's Network Manager.
Now:
$ curl -s checkip.dyndns.org | sed -e 's/.*Address: //' | sed -e 's/<.*//'
93.115.84.195

But when Google [my ip] in my Windows host system, it is still:
Your public IP address is 46.126.152.130