Free easy way to hide IP in Linux

You may need to change IP for anonymity or bypassing restrictions. There are so many ready-made solutions and ways to do this. From this article, you will get to know how to change IP in Linux. You will be acquainted with a couple programs, which help you to hide you IP extremely easy and fast. In addition, absolutely free.

These two apps hide your IP in traffic from console applications and from graphical ones (web browsers, for example). But you should always remember about programs that can go online making low-level queries, bypassing system functions. An example of such a program is Nmap.

To check my IP in the console I will use the command:

curl suip.biz/ip/

And to check IP in a web browser, I'll go to the page suip.biz, which besides IP shows the location on the map, as well as the Internet provider.

Automatically connect to a free VPN

UPDATED: autovpn2 and autovpn3 - scripts to automatically connect to a free VPNs

The first program is called autovpn. The essence of her work is that she gets a list of free VPN servers from the site and connects through one of them. It is possible to explicitly specify the country whose IP you need.

The program must be installed before use. Since it is not found in the standard Kali Linux repositories, we need to compile it from the source code. It's not difficult at all, but the autovpn program is written in the Go programming language, so you need to start by installing the Go compiler.

Open the .bashrc file in the user directory with any text editor:

gedit ~/.bashrc

And to create new environment variables, add the following lines to this file:

export GOPATH=/home/git/go
export GOROOT=/usr/local/src/go
export PATH=${PATH}:$GOROOT/bin:/home/git/go/bin

When you are ready, save your changes and close the file.

These changes will take effect after the reboot. Instead of restarting the computer, run:

source ~/.bashrc

The following command automatically detects and downloads the latest version of the Go language files:

wget `curl -s https://golang.org/dl/ | grep -E -o 'https://[a-z0-9./]{5,}go[0-9.]{3,}linux-amd64.tar.gz' | head -n 1`

Extract the downloaded archive:

tar zxf go*.linux-amd64.tar.gz

Change the directory to $GOROOT, which we specified in ~/.bashrc.

sudo mv go $GOROOT

To connect to VPN servers, the autovpn program uses openvpn. Install this package if it is not on your system:

sudo apt-get install openvpn

Next, install autovpn:

git clone https://github.com/adtac/autovpn
cd autovpn
go build autovpn.go
sudo mv autovpn /usr/local/bin/
cd

Everything is ready. If the Go compiler is no longer needed, you can remove it from the system.

The program does not have options. As argument you enter ISO 3166-1 alpha-2 (the two-letter country code, through whose VPN you want to connect).

If after starting the program quickly quits without connecting to the VPN, this could mean:

  • You entered the country code incorrectly
  • Missing VPN from selected country

You can give a country if you want. For example, if you want to connect to a server in Japan:

sudo autovpn JP

Check your ip in console and web browser.

To stop using VPN, press CTRL + c. The program asks if you want to try another VPN, if you want to reconnect via another VPN server, then press y, if you want to quit the program, type n.

Now each time you want to change the IP simply run:   

sudo autovpn

or:

sudo autovpn COUNTRY_CODE

If the country code is not specified, then the program tries to connect to the VPN from the US (sometimes not available - so just select any other country).

Command to redirect all traffic through Tor

The second program I want to talk about is called TorIptables2. TorIptables2 routes all traffic on a standalone machine through Tor. Once this is set up, every network application will make its TCP connections through Tor; no application will be able to reveal your IP address by connecting directly.

To run the program you need installed and running Tor:

sudo apt-get install tor
sudo systemctl start tor

If you want, you can add the Tor service to startup:

sudo systemctl enable tor

Next:

git clone https://github.com/ruped24/toriptables2
cd toriptables2/
sudo mv toriptables2.py /usr/local/bin/
cd
toriptables2.py -h

Program options:

-h, --help   show this help message and exit
-l, --load   This option will load tor iptables rules
-f, --flush  This option flushes the iptables rules to default

To redirect all TCP traffic over the Tor network, run:

sudo toriptables2.py -l

For direct Internet connections (without using the Tor network) run:

sudo toriptables2.py -f

The Tor network works so that your external IP changes from time to time. If you want to change it immediately (if you do not like the country that dropped out, or if the Tor node is too slow), then run the command:

sudo kill -HUP $(pidof tor)

Conclusion

Both programs require a small installation, but once configured, you can change your IP at any time in seconds, choosing IP from any country, or using the Tor network for communication. Both of these methods allow you to bypass restrictions based on IP.

Recommended for you:

4 Comments to Free easy way to hide IP in Linux

  1. tru says:

    thank you. Been using the 2nd option.

  2. Finnegan says:

    i found it helpfull.. going to try tommorow……. God Bless you

  3. ulagu says:

    https://github.com/adtac/autovpn has been removed from Github.  Is there an alternative that works in the same was as decribed above?

Leave a Reply

Your email address will not be published. Required fields are marked *