I have 2 devices:
- Android phone which runs VPNService and also has 3G connection. I use this device as a mobile hot spot.
- Android phone which connects to the 1st device as a client.
Both devices run Android 4.4.4
This is how I setup the VPNService:
mInterface = builder.setSession("MyVPNService")
.addAddress("1.0.0.1", 24)
.addRoute("0.0.0.0", 0)
.establish();
FileInputStream in = new FileInputStream(
mInterface.getFileDescriptor());
FileOutputStream out = new FileOutputStream(
mInterface.getFileDescriptor());
I assume that the 2nd device uses the 1st device as a default gateway.
When the 2nd device tries to browse the web, and I print out the captured packets from the in file descriptor in the 1st device, I don't see any traffic which should have come from the 2nd device.
Any idea why?