Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to route all traffic coming from tethering?

I'm working on some test project, basically I want to route all traffic when I'm in hotspot mode into a fixed address. I have the IP range for example 192.168.0.0/24 I don't know if I can use iptables without root or JNI functions (can't find any that match what I want) Thinking out of the box is very welcomed (DNS, low level packet broadcast on client connect etc...)

Any Idea?

EDIT: How Android and iOS detect a Network Portal?

source : https://sudoroom.org/wiki/Mesh/Firmware/Splash_page They try to HTTP GET on

iOS: http://www.apple.com/library/test/success.html and expect a 200 if not behind portal

Android: http://clients3.google.com/generate_204 and expect a 204 status when not behind portal, any other status is a portal

So, how can I respond correctly to those detections?

like image 494
TecHunter Avatar asked Apr 29 '14 17:04

TecHunter


People also ask

Can ISP detect tethering?

Save this answer. Yes, they can still detect it. They will be able to see the multiple MAC addresses. If you want to hide the number of machines accessing the internet from your router, you need to set up a SOCKS proxy server on your computer.

Does tethering reduce speed?

In many cases a tethered internet connection will be slower than a regular internet connection.

What does unrestricted tethering mean?

If you're on an Unlimited data deal, you can tether your phone as much as you want with no extra cost. People on Three's Essential and Pay As You Go contracts have to pay extra to tether their phone.


1 Answers

The easiest approach is to enable a socks proxy when configuring the wifi AP you are connecting to. This varies depending on the version of android, but it is typically something like:

  1. Touch and hold the wifi network you want to connect to.
  2. A dialogue box should pop-up. In that dialogue box, select advanced.
  3. Find the proxy option and enter in the IP and port of the server you want to forward traffic to.

Android speaks SOCKS and so long as your proxy speaks SOCKS as well, you are good to go. If you root the device you can (depending on your version of Android), configure this proxy automatically. See, for instance, AdBlock Plus for Android which does exactly that.

If you don't want to go the proxy route you may be able to manually set ebtables rules if your device is rooted. This is significantly more work as you have to be careful not to mess up the NAT'ing that your device is already doing.

like image 119
Clarus Avatar answered Oct 02 '22 21:10

Clarus