Android Hotspot and VPN Setup

Ensuring your Hotspot Clients Connect via VPN

If you’ve subscribed to a VPN service and own an Android phone, you would have most likely gone to the Google Play Store and downloaded the VPN provider’s app. After installing, it’s usually a matter of launching the app and entering some credentials before you start surfing with an obfuscated IP address.

Let’s say you’re out in a public place with your laptop and phone. Your phone is connected to your cellular/mobile data provider, and you want to setup your phone as a WiFi Hotspot and connect to it using your laptop. You also, want to ensure that as you surf from your laptop, websites you visit will see your VPN’s Public IP — not your real IP.

Unfortunately, even if you are running your VPN subscriber’s app on your phone and connect your laptop to the Hotspot, your laptop’s Public IP address will be the “real” IP address, i.e. the one that has been assigned by your Cellular/Mobile data provider.

If your Android phone is rooted, then you can find several free apps that’ll allow you to setup the VPN Hotspot on your phone. This would allow web traffic of all your Hotspot clients to be routed through the VPN connection offered by your Hotspot. Under the covers, these apps most likely manipulate the routing table on your Android device, and implementing this capability would require root access to the Android OS.

If your phone is not rooted and are after a workaround, then read on. I’ll explain one approach to get things working as they should.

Solution Overview

For the setup to work, we need an intermediary link. A proxy server that runs on the Android phone. The proxy server binds to the “virtual VPN” adapter/Public IP on the Android phone. Clients connecting to the Hotspot can then be configured to use the proxy server so that traffic from the clients is relayed via the proxy server to the VPN adapter. Your Hotspot clients will then publicly display the IP address of your VPN provider.

The setup we aim to achieve looks like this:

Image for post
Image for post
VPN Hotspot Solution

Install Apps on Android Hotspot/Phone

On your phone, go to Play Store and install the following apps:

  • Proxy Server (free/ad sponsored)
  • Thunder VPN

If you already have a VPN provider and have the corresponding VPN app already installed on your phone, then you can skip downloading of Thunder VPN.

Don’t launch the apps just yet.

Image for post
Image for post
Download “Thunder VPN” and “Proxy Server” from the Google PlayStore

Check Public IP before Configuring your Hotspot

Before we do any config for the apps, let’s check the current Public IP address of phone while it’s connected to cell/mobile data provider.

  • Go to your web browser on your phone and do a “my ip” Google search. You should get a result back showing your Public IP
  • Make a note of this, this is your current Public IP address that’s assigned by your mobile/cell data provider
Image for post
Image for post

Configure Android Proxy App (“Proxy Server”)

Now launch “Proxy Server” app and click on the “+” to add a server. This will display a new config screen for your new proxy server.

Image for post
Image for post

Enter details as show below. I have chosen a Server name that matches my Hotspot name. Hit the back “<” button and save your changes.

Image for post
Image for post

Launch and Connect “Thunder VPN”

On your Android phone, launch Thunder VPN (as shown below) and check your Public IP after successfully you’re connected. The Public IP address is 205.185.117.190, which confirms that our true IP has been obfuscated.

Image for post
Image for post

Enable Android Hotspot

You can now enable your Android Mobile Hotspot.

Image for post
Image for post

Start Android Proxy Server

Open the Proxy Server app on your Android phone and start the server.

Image for post
Image for post

Once the server shows a status of Running, tap on “Info” to display the server details.

Image for post
Image for post
Image for post
Image for post
Proxy Info

Connect your HotSpot Client (Laptop)

From your Wireless network list, you should see your Hotspot Network displayed (in my case, the Hotspot Network is named “MyHS”). Select your Hotspot from the list and enter your network key to connect.

Image for post
Image for post

Once connected, click on the properties of the network.

Image for post
Image for post

The network properties will be displayed.

Image for post
Image for post

We can also find the “Gateway” for this connection via the network properties for the WiFi Adapter that’s connected to the Hotspot.

Image for post
Image for post

The Default Gateway matches the IP address that listed in the “Info” panel of our Proxy Server app as shown earlier on.

If you go ahead and check the Public IP address of your laptop, you will discover that it still shows the IP assigned by your mobile/cell data provider, i.e. your “real” IP.

Image for post
Image for post

So we have one more step left before we can connect through the Hotspot VPN IP, and that is to configure our Web Browser proxy settings.

Configure HotSpot Client Proxy Settings

I am using Firefox so my proxy settings would look like this:

Image for post
Image for post

After making the changes and performing a Public IP address check of my laptop:

Image for post
Image for post

My laptop is now connected to the HotSpot and displays the Public IP address of the VPN provider (“Thunder VPN”).

Written by

Primarily a Learner/Coder with interests in Python, Cloud Technologies, Security and Automation. Pandas munching on Bamboo sticks give me the “Giggles” :))

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store