简体   繁体   English

连接到无法上网的WiFi网络时如何使用3G网络?

[英]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. 有时,我仅需要将Nexus 5连接到WiFi网络即可与其他设备共享某些文件,但是该网络无法访问Internet。 I would like to use 3G for data connection while the phone is connected. 连接手机后,我想使用3G进行数据连接。 Obviously I have root access. 显然,我具有root用户访问权限。 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 -n确定哪些路由可用

route add default gw <<ip address>> - replace with the gateway's IP address that you want to be the default. route add default gw <<ip address>> -用您想要成为默认网关的IP地址替换。 Make sure to run this command as root or with sudo. 确保以root或sudo身份运行此命令。

I'm not familiar with Android shell access or the internals of how Android manages its networking. 我不熟悉Android Shell访问或Android如何管理其网络的内部知识。 For all I know, the entire 3G Internet connection may shut down by default when you are on wifi. 据我所知,当您使用wifi时,默认情况下,整个3G Internet连接可能会关闭。 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). 如果所有其他方法都失败了,您还可以考虑将“移动热点”应用程序用于手机,并让设备与您连接(作为奖励,它们也可以访问Internet)。

More information on viewing default gateway with route command 有关使用route命令查看默认网关的更多信息

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 WIFI或3G网络更改时的BroadcastReceiver - BroadcastReceiver when WIFI or 3G network change Android:在广播接收器中连接到wifi / 3g时检查网络连接返回未连接 - Android: Checking network connectivity return not connected when connected to wifi/3g in Broadcast receiver 当用户连接到 WiFi 网络(可以访问互联网)时,是否有监听器? - Is there a listener for when a user gets connected to a WiFi network (with internet access)? 如果没有连接wifi或互联网3G,如何提醒? - How to alert pop up if no wifi or Internet 3G connected? FusedLocationProviderClient 无法通过 3G 或 4G 网络获取 GPS 位置,除非先连接到 WIFI 网络 - FusedLocationProviderClient cannot get GPS location over 3G or 4G network unless first connected to WIFI network 当支持 Internet 的 WiFi 网络可用时,如何使 Android 连接到无法访问 Internet 的 IoT WiFi AP? - How do I keep Android connected to an IoT WiFi AP with no internet access when an internet-enabled WiFi network is available? 即使连接到WIFI,如何从3G强制使用互联网? - How to force using internet from 3G even when connected to WIFI? 当wifi或3g网络状态改变时,BroadcastReceiver - BroadcastReceiver when wifi or 3g network state changed Android设备上如何检查wifi或3g网络 - how to check wifi or 3g network is available on android device 带有3G和WIFI网络的Android客户端应用 - Android Client App with 3G and WIFI Network
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM