gregm
gregm

Reputation: 12159

How do I force my Android network to route port 80 network traffic to a wifi network that does not have internet access?

Scenario: (device: Pixel OS: Android 7.1.1, (also Galaxy 7, Android 7.0)

  1. App is connected to a local wifi network that does not have internet access
  2. Pixel phone is connected to LTE cellular data connection
  3. App requests a url like http://192.168.1.1:80/test Pixel phone routes that request to the LTE cellular data connection, presumably because it has internet connectivity and my wifi network does not.

I want to force the App to make the http://192.168.1.1:80/test request on the local wifi network even if it does not have external internet capabilities.

I am using Retrofit and Okhttp, and also have tried: org.apache.http.impl.client.AbstractHttpClient

Any ideas?

Upvotes: 1

Views: 1174

Answers (1)

Zac67
Zac67

Reputation: 2912

If 192.168.1.0/24 is a locally connected network, it should be routed automatically. If not, you'll need a routing table entry, e.g. 192.168.1.0/24 -> 192.168.99.1 (if your Wifi is 192.168.99.0/24 and .1 is the router in between).

Upvotes: -1

Related Questions