Android Phone as a VPN Gateway [Bypass Tethering Block]

No DHCP

Thank you for the guide, very useful - I'm able to make my tethering connection go through my vpn which goes through my mobile internet... With a bit of wrangling.

Do you know of any way to make DHCP work correctly? Currently, it appears DHCP on the phone is returning the VPN servers IP instead of a local IP... I want to use this for Chromecast, which doesn't like static configurations.

Also, I'm using the built in Android VPN system - I just had to change tun0 with ppp0.

EDIT: I just noticed that if I turn off the VPN, DHCP works and WiFi connects. If I turn the VPN back on, the connection will go through the VPN. This should solve the chromecast issue :)

Liam

I am experiencing the same problem. Basically everything that was on the WiFi network before enabling the VPN works great (already has a DHCP lease), but no new devices can connect after the VPN has been enabled (fails at "Obtaining IP Address").

Everything in my household is DHCP. If anyone knows how to get the DHCP working again while connected your skillz would be much appreciated :-)
 
Not sure if anyone is still looking at this thread, but:

I'm trying to get this to work. If I paste the script into terminal emulator, all seems to be working until this line:
ip route add 192.168.43.0/24 dev wlan0 scope link table 61
I get the error message: RNETLINK answers: Invalid argument.

Does anyone have any ideas?
 
Okay, I realised I might have misread the instructions for the script which take the WLAN0 ip of 192.168.43.1 and convert it to 192.168.43.0 for the script.

So I changed my script from 192.168.1.1 to 192.168.1.0 and my Invalid argument error is gone. But now when I try to connect to the wifi hotspot with another device, the device gets stuck on Obtaining IP address.

Does anyone know how to fix that issue?
 
usb0 over rmnet0 instead

Code:
iptables -t filter -F FORWARD
iptables -t nat -F POSTROUTING
iptables -t filter -I FORWARD -j ACCEPT
iptables -t nat -I POSTROUTING -j MASQUERADE
ip rule add from 192.168.43.0/24 lookup 61
ip route add default dev [B]tun0[/B] scope link table 61
ip route add 192.168.43.0/24 dev usb[B]0[/B] scope link table 61
ip route add broadcast 255.255.255.255 dev [B]usb0[/B] scope link table 61


This works great for routing the data over the VPN connection. I modified it slightly to work with usb tethered data instead of wifi hotspot, but it's the same idea as your post (wlan0 is now usb0).

There are some limitations to having the VPN always on on the phone (namly, sites like Craigslist & Netflix wont work). What modifications need to be made to simply run all usb tethered data over the phone's default rmnet0 connection instead? Then I'd run a VPN per client as needed.

Thanks
 
Not sure if anyone is still reading this thread. I follow exactly the instruction and get my client device to connect to my wifi hotspot without receiving any SMS asking me to buy tether pass. I guess I made it in the 1st part. However, though my client device is connected to my wifi hotspot. There are no internet in the connection. What did I miss out? Someone pls help!
 
Are you using a VPN hosted at your home? if so you need to set the DNS IP address on the device connected via WiFi to be the same as your home routers IP address.

If your using a 3rd party VPN you can ask them which DNS server you should use on your client device, however Google's DNS servers should work: 8.8.8.8 or 8.8.4.4
 
I am using openvpn. I have change to the openvpn server IP as the DNS, as well as used Google DNS . However, still no internet in the client device.
 
Solved: it's the VPN server that is slow in routing the traffic. The script work perfectly.
 
Anyone manage to get chromecast to connect to wifi tether over vpn? Because this tweak will need to set the client device on static IP. And there is no way to set a static IP on chromecast.
Someone pls share your opinion
 

About Digiex

Digiex is a technology and gaming forum, founded in 2004 by InsaneNutter and Nimrod. Digiex has served the internet community with breaking news, detailed guides, exclusive downloads and a popular discussion forum. A small, friendly community of like‑minded people has developed over the years. People are encouraged to register and participate in on‑going discussions.

Get Social

Back
Top Bottom