[Q] Reverse Tethering blocks VPN connection - Android General

I can browse on my rooted phone through my PC internet connection (via USB).
The steps are:
Connect device to Wi-Fi *(On HTC M7 enabling USB tethering without any live connection will not create usb0 interface)*
Enable USB Tethering
Add default GW to usb0
Disconnect Wi-Fi
On my PC (Windows) I just bridge both connections.
Everything works except VPN connection, since when trying to "protect" (VpnService method) a socket from the VPN tunnel it fails!
I can see on ConnectivityService.java #3589 (xref) and probably the fail reason, I'm looking for a workaround.

Related

[REQ] Reverse wired tethering

Before i start i want to let people know YES I DO HAVE A WIRELESS ROUTER!! So please do not respond telling me to just go buy a router.
REQUEST - Reverse wired tethering. I.E. Sharing PC's iNet connection with your phone via USB.
REASON - My university's wireless is locked down and does not allow mobile phones, pda's to connect up to our wireless without submitting MAC for approval. Looking to sync certain apps without using my data connection.
I dont know if anyone has played around with trying to get this working or not. I know its a small market of people who may be interested in this, but for certain places (CANADA) where data charges are WAY to expensive this could be handy for students at UNI where wireless is not an option.
get a second wifi adapter on your laptop, and share your uni wireless network connection with the second wifi adapter. Use a hidden SSID, then no one will know what is going on
This was asked a couple of times before here and I remember people saying you couldn't reverse the tethering.You could try though.
alexperkins said:
get a second wifi adapter on your laptop, and share your uni wireless network connection with the second wifi adapter. Use a hidden SSID, then no one will know what is going on
Click to expand...
Click to collapse
Thats a good idea xD
Hey guys,
I have been trying to find a way to do this for a long time.
The best solution i have found (actually the only solution) is Connectify. The only downside is you must have Win7.
What it does is turns your wifi adapter into a HotSpot, even if you are using wifi to get the net in the first place. Its a great tool and should be what your after.
http://www.connectify.me/
memphisraynz said:
Hey guys,
I have been trying to find a way to do this for a long time.
The best solution i have found (actually the only solution) is Connectify. The only downside is you must have Win7.
What it does is turns your wifi adapter into a HotSpot, even if you are using wifi to get the net in the first place. Its a great tool and should be what your after.
http://www.connectify.me/
Click to expand...
Click to collapse
thank you so much for this
Your best solution is the WiFi adapter. You could most likely get away with a SOCKS proxy over USB, possibly using adb, but it would be complicated, unstable, and messy.
I still don't know you just don't use your wireless router. I assume they have wired. Clone your PC's mac address and hook it up. Universities are retarded with that crap. They have the worst networks and security.
If no wired, then what podunk place is it? haha
Even if they had only wireless , you could set up a wlan client and repeat it. DDWRT, etc, ftw.
Just get backtrack for your laptop and spoof your mac to all 0 then grab connect to the network at your school the spoofed mac will allow you to browse so long as no other encyption is on the network such as WEP or WPA.
then you can try to flood all the ports on the network so no one else can connect then spoof your phones mac by conneecting to your laptop through wireless as an adhoc connection and while staying connected through adhoc load a second server through the same wireless network card and you can connect to the achools network again. and walla...
death1246 said:
Just get backtrack for your laptop and spoof your mac to all 0 then grab connect to the network at your school the spoofed mac will allow you to browse so long as no other encyption is on the network such as WEP or WPA.
then you can try to flood all the ports on the network so no one else can connect then spoof your phones mac by conneecting to your laptop through wireless as an adhoc connection and while staying connected through adhoc load a second server through the same wireless network card and you can connect to the achools network again. and walla...
Click to expand...
Click to collapse
so simple, i dunno why i didnt think of that. thanks! lol
Well its quit simple once you learn your way around linux...
If you have any experience with *nix, you may want to look at Cyanogen's original usb tether shell script:
http://github.com/cyanogen/android_vendor_cyanogen/blob/master/bin/usb-tether
Basically you could use the internet connection sharing function that comes with all popular OSes and access your uni's network on your phone. You must have Cyanogen mod or another mod using his kernel. Not yet working on OSX for some reason. Tested under Windows 7.
First you'll need to figure out what IP address range your computer's DHCP server is using. This is normally fixed for each OS. For Windows 7, it's always 192.168.137.0/24.
For OSX or Linux, you can setup connection sharing (for some other connection because we don't have the USB interface yet) and ifconfig.
Second is to enable the USB connection on the phone's side. Type the following command in any console program, like Connectbot. (You must use a console program as opposed to adb because you will lose USB debugging once the USB network interface is enabled.)
Code:
su
cd /sys/devices/virtual/net/usb0
ifconfig usb0 192.168.137.200 mask 255.255.255.0
echo 1 > enable
The first line makes you the superuser. (Skip if the command prompt is #)
The second line land you in usb0's directory under sys. We'll need to type the disable command later, so it's easier if we're here.
The third line brings up the virtual usb network interface and sets its IP address.
The IP address should be in the same network (i.e. IP address range) you obtained in step 1. Say if the original is 192.168.137.1 in a /24, you can use 192.168.137.2 through 192.168.137.254
This actually enables the usb interface.
You will now see a new network adapter is recognized by your computer. Set up connection sharing to share your internet TO that adapter.
Make sure you have connection by pinging your computer from your phone.
For example:
ping 192.168.137.1
Now you'll have to change the routes so traffic go through the USB cable instead of the mobile network.(# is the command prompt, do not enter)
# busybox route
check the line starting with "default". Write down the ip address after it; call it IP1.
# getprop net.dns1
Call the IP returned IP2.
Code:
busybox route del default gw IP1
busybox route add -host IP2 rmnet0
busybox route add default gw 192.168.137.1
The first line deletes the old default route via the mobile network.
The second line adds an "exception" for your carrier's DNS server.
The third line adds the new route via USB. You should replace the address at the end with the IP address from the first step.
Your network should be working now. Test by visiting some website that is only available on campus or by traceroute.
You must make sure the mobile network is always connected though. This is because domain names are still resolved by your mobile carrier. If you ever lose your mobile connection, the routing table will be changed as well.
To disconnect:
Make sure you're still in /sys/devices/virtual/net/usb0.(Use pwd if unsure.)
Code:
netcfg usb0 down
echo 0 > enable
The usb interface will disappear on your computer.
Now switch the phone to airplane mode and back to re-enable mobile network.
The disconnect step should always restore your phone's state.
// This is written at 3am, so use it at your own risk...
help?
look at this
http://superuser.com/questions/91699/spoof-mac-address-from-ip-command
bg
It's really sad that Android can't reverse tether. If you want to use your laptop's AdHoc connection you have to do serious hacking to the tiwlan.ini and the wpa_supplicant.conf. There is no way to connect via bluetooth ar USB.
I'm seriously considering WP7 now for my next OS of choice... A nd for everyone saying "go buy a router" - go buy a router and stick it up your .... nose.
Hi,
I have the same problem. No WiFi in my work and no WiFi in my current home (a Resident Hall). There's no possibility to buy a WiFi router, of course. I tried to hack the system to connect ad-hoc networks but it didn't work.
I have found some interesting resources:
sluniverse.com/php/vb/blogs/psyke+phaeton/1042-making-android-phone-use-your.html
letsgoustc.spaces.live.com/blog/cns!89AD27DFB5E249BA!877.entry
I have a HTC Magic with the ADP-DRC83 hacked ROM with Usb tethering integrated. But usb0 interface in the mobile is configured to provide Internet connection (as gateway) to the PC, not the reverse functionality: connecting the mobile to Internet through the PC. So, all I need is to change the gateway in Android and then configure a NAT-DNS in my linux PC (easy with iptables and dnsmasq). But, I don't know how automatize the process exactly.
digitaljeff said:
but for certain places (CANADA) where data charges are WAY to expensive this could be handy for students at UNI where wireless is not an option.
Click to expand...
Click to collapse
Wind will be launching in vancouver soon.
$35 unlimited data.
Silly ragin' cajun.
Ok, now it works. Here it's my procedure for a HTC Magic (Sapphire) without any APN previously configured from Telecom provider and ROM CSDIv4.
In the mobile by using Better Terminal:
Code:
su
cd /sys/devices/virtual/net/usb0
echo 1 > enable
ifconfig usb0 192.168.2.2 mask 255.255.255.0
busybox route add default gw 192.168.2.1
setprop net.dns1 8.8.8.8
In the linux computer:
Code:
sudo sysctl -w net.ipv4.ip_forward=1
sudo iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
sudo iptables -A FORWARD -i usb0 -j ACCEPT
sudo ifconfig usb0 192.168.2.1 netmask 255.255.255.0
Android Market downloads and location service don't work but I think is possible if you switch on the WiFi.
Update: Syncronization, Android Market downloads and location service don't work even the WiFi antenna is switched on. I have added the iptables commands also.
Well gosh, reverse wireless tethering is so much simpler
There are another similar thread: http://forum.xda-developers.com/showthread.php?t=522498

[Q] [openvpn, cm7] Hotspot not functional when openvpn is connected

I'm using CM7 stable (7.0.3) with a Nexus One.
When I enable the hotspot feature without having the phone connected to my openvpn server, my laptop (connected to the hotspot) connects to the web fine. The phone's internet connection works fine as well.
But when I enable the feature while connected to the openvpn server, even though the internet works on the phone, my laptop connects to the hotspot but cannot send/receive any data. I can ping my phone from my laptop, but pings go unanswered for example to google.com or 8.8.8.8...
Does anyone have any idea what's going on here, how I can troubleshoot or how I can fix the problem?
PS. I'd like to have the phone connected to my openvpn server rather than my laptop while using the hotspot as the laptop's openvpn connection is unstable when using the phone's hotspot (I do't know why).
Thanks!
I think the problem is the Gateway used by the laptop to connect to the internet. When you activate the hotspot the laptop will use to connect to the internet as gateway the ip provided by 3G. When you activate the VPN the gateway is changed but the laptop can't tell that and it uses the wrong IP address.

[Q] NAT and router in Android

Hi,
I want some software or command-line commands to make my Samsung Galaxy Note N7000 (android 2.3.6) temporarily as NAT router. But I dont want tethering or make phone as wifi router, but instead as wifi client. I want connect to internet through 3g and then route and NAT all incoming packets from wifi connection to 3g. So, my client computer is in LAN, in LAN I have wifi router, computer client connects to internet through: computer client --> LAN router --> phone wifi-client (phone wifi client makes connection to wifi router) --> phone NAT and routing --> phone 3G network connection --> internet.
Thanx.

How can I share mobile data to connected wifi thru network bridge in Andoird 6.0

Hello Experts,
I am not a super expert but working on it on own interest basis.
My situation is,
I have one broadband connection thru ADSL+wireless router.
Normally my PC & other android devices at home are connected to wireless router of broadband.
Sometimes, this broadband connection fails for a couple of days.
I have one Android 6.0 mobile device which have unlimited data plan, but other android devices like mobile, Tabs does not have data connection.
During that time,
I create a hotspot & share to other wireless devices, but my PC does not connect until I connect thru USB tether.
Is it possible ??
To make a bridge in android 6.0 MM, between data connection & wi-fi ?? (I will connect it to wireless router with out hotspot), & set the DNS & gateway manually in the PC & wireless router.
What I have already done
Connected my mobile having data conn to win 10 PC with USB tether & PC is also connected to adsl router thru LAN.
Now,
I have checked the address of USB tether network IP (192.168.XX.XX), gateway (192.168.XX.XX) & DNS (192.168.XX.XX).
Then I created a bridge connection at PC between ADSL LAN & Tether Connection. Set above mentioned IP, gateway & DNS at created bridge connection.
Then I logged in into ADSL router,
Changed its IP from 192.168.1.1 to 192.168.XX.XX ( matching with USB tether conn except last digit).
Then I connected all my android devices to ADSL router wireless network & manually set the DNS address to every network same as USB tether DNS.
profit :
Not much, But I am getting a strong wifi network signal from ADSL compared to mobile hotspot & all my devices connected to internet being at different places of home with different people.
My above query was to get rid of USB tether in this situation.
Thank you for reading all above & suggestions if any.
[email protected] said:
Hello Experts,
I am not a super expert but working on it on own interest basis.
My situation is,
I have one broadband connection thru ADSL+wireless router.
Normally my PC & other android devices at home are connected to wireless router of broadband.
Sometimes, this broadband connection fails for a couple of days.
I have one Android 6.0 mobile device which have unlimited data plan, but other android devices like mobile, Tabs does not have data connection.
During that time,
I create a hotspot & share to other wireless devices, but my PC does not connect until I connect thru USB tether.
Is it possible ??
To make a bridge in android 6.0 MM, between data connection & wi-fi ?? (I will connect it to wireless router with out hotspot), & set the DNS & gateway manually in the PC & wireless router.
What I have already done
Connected my mobile having data conn to win 10 PC with USB tether & PC is also connected to adsl router thru LAN.
Now,
I have checked the address of USB tether network IP (192.168.XX.XX), gateway (192.168.XX.XX) & DNS (192.168.XX.XX).
Then I created a bridge connection at PC between ADSL LAN & Tether Connection. Set above mentioned IP, gateway & DNS at created bridge connection.
Then I logged in into ADSL router,
Changed its IP from 192.168.1.1 to 192.168.XX.XX ( matching with USB tether conn except last digit).
Then I connected all my android devices to ADSL router wireless network & manually set the DNS address to every network same as USB tether DNS.
profit :
Not much, But I am getting a strong wifi network signal from ADSL compared to mobile hotspot & all my devices connected to internet being at different places of home with different people.
My above query was to get rid of USB tether in this situation.
Thank you for reading all above & suggestions if any.
Click to expand...
Click to collapse
Yez and yes, search Hack5 in youtube and find the video relating to wifi pineapples( the bridge/router) and you will find everything you need , along with EasyTether pro(works fully tested to bypass tethering restrictions) . I dont know how the pineapple/router works but I know EasyTether uses adb to take and make a usb tethered connrection, then with a moderate-advanced setup(ie. wifi pineapple) you will be broadcasting wifi to any device you need. The only downside is you have to usb tethr to the pineapple at all timez to make a usable wifi,So in my opinikn best to buy anothr $45 a mnth plan especially 4 tethering, tho Im just now switching to a ISP for my internet it did the job, i even freelanced for awhile all remotely using the hotspot/created wifi/bridged connection.Hope that hellps brutha
Th
Tks...Bro...
I did it long before without spending a single penny.
I simply used network hack and bluffed the pc and other devices...It is working like charm....

Can't access home network when phone is usb tethered?

My android phone is usually on wifi at home. My laptop has some wifi chip/antennae issues so I have to either connect to the network via a lan port or, alternatively, use android phone usb tethering. If I am connected via the latter, on the laptop I observe that I cannot connect to the router network - I cannot even access the router login page.
I don't know a simple term for this feature. I guess it works like a network switch. But is there any app that, when enabled would help me connect my laptop (when usb-tethered) to the wifi network?

Categories

Resources