Android Phone as a VPN Gateway [Bypass Tethering Block]

Discussion in 'Mobile Devices' started by InsaneNutter, Sep 14, 2014.

  1. Mathew Dietrich

    Mathew Dietrich New Member

    Joined:
    Apr 28, 2015
    Messages:
    1
    Likes Received:
    0
    No DHCP

    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 :-)
     
  2. Markino

    Markino New Member

    Joined:
    Aug 25, 2016
    Messages:
    2
    Likes Received:
    0
    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?
     
  3. Markino

    Markino New Member

    Joined:
    Aug 25, 2016
    Messages:
    2
    Likes Received:
    0
    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?
     
  4. brn2drv99

    brn2drv99 New Member

    Joined:
    Oct 5, 2016
    Messages:
    1
    Likes Received:
    1
    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
     
    InsaneNutter likes this.
  5. tokthem

    tokthem New Member

    Joined:
    Apr 9, 2017
    Messages:
    4
    Likes Received:
    0
    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!
     
  6. InsaneNutter

    InsaneNutter Resident Nutter Staff Member

    Joined:
    Jun 1, 2007
    Messages:
    12,370
    Likes Received:
    3,762
    Location:
    Yorkshire, England
    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
     
  7. tokthem

    tokthem New Member

    Joined:
    Apr 9, 2017
    Messages:
    4
    Likes Received:
    0
    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.
     
  8. tokthem

    tokthem New Member

    Joined:
    Apr 9, 2017
    Messages:
    4
    Likes Received:
    0
    Solved: it's the VPN server that is slow in routing the traffic. The script work perfectly.
     
  9. InsaneNutter

    InsaneNutter Resident Nutter Staff Member

    Joined:
    Jun 1, 2007
    Messages:
    12,370
    Likes Received:
    3,762
    Location:
    Yorkshire, England
    Excellent i'm glad this is still working great.
     
  10. tokthem

    tokthem New Member

    Joined:
    Apr 9, 2017
    Messages:
    4
    Likes Received:
    0
    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
     

Share This Page