4

I want to know how it can be possible to manage the traffic of the clients connected to my android hotspot. The two mainly features I want to achieve are:

  • Deny/allow the internet access to clients.
  • Measure the amount of data consumed by client.

I'm using VpnService that allows me to point all my device traffic to a tun interface. I can see every IP packet passing trough the tunnel coming from my device, But after trying a lot (many days), I assumed that is impossible to see the android hotspot's traffic. According to my knowledge, it could be because the layer of the android hotspot is below of the VpnService and the packets are sent transparently out of the tunnel. am I right ?

The VPN interface is built as:

mInterface = builder.setSession("MyVpnServiceSession")
        .addAddress("10.0.0.2", 32)
        .addRoute("0.0.0.0", 0)
        .establish()

Please, somebody knows how can I achieve these features using (or not) VpnService or other solution ?

Thanks

PS. Answer must work for NON-ROOTED devices

crgarridos
  • 8,758
  • 3
  • 49
  • 61

0 Answers0