简体   繁体   中英

How to use 3G network when connected to a WiFi network with no internet access?

sometimes I have to connect my Nexus 5 to a WiFi network only to share some files with other devices, but this network does not have Internet access. I would like to use 3G for data connection while the phone is connected. Obviously I have root access. Is there any way to achieve this? (Not necessary a simple way)

My phone isn't rooted and I don't have a shell installed on it to test, but off the top of my head maybe this could help?

route -n - determine what routes are available

route add default gw <<ip address>> - replace with the gateway's IP address that you want to be the default. Make sure to run this command as root or with sudo.

I'm not familiar with Android shell access or the internals of how Android manages its networking. For all I know, the entire 3G Internet connection may shut down by default when you are on wifi. If all else fails, you could also consider a "mobile hotspot" app for your phone, and have the devices connect to you (as a bonus, they would have Internet access too).

More information on viewing default gateway with route command

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM