android 手机通过 usb 共享电脑网络
2017-03-15 16:04
936 查看
此文版权属于作者
所有,任何人、媒体或者网站转载、借用都必须征得作者本人同意!
参考:How to set up reverse tethering over USB?
1、Connect Android device via USB.
2、Enable USB tethering. To do so, go to
Settings → More... → Tethering & mobile hotspot → Usb tethering.
3、At host machine, the usb tethering connection may be detected by the network manager.
Its name will be something like "Wired connection 2" (or 3).
You must edit it's "IPV4/Method" to "Shared to other computers".
3.1、Without the network manager, you will have to do it manually:
$ sudo ifconfig usb0 10.42.0.1 netmask 255.255.255.0
$ echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward
3.2、modify iptables with
$ sudo iptables -t nat -A POSTROUTING -j MASQUERADE
4、At Android device
$ adb shell su -c "ifconfig rndis0 10.42.0.2 netmask 255.255.255.0"
$ adb shell su -c "route add default gw 10.42.0.1 dev rndis0"
所有,任何人、媒体或者网站转载、借用都必须征得作者本人同意!
参考:How to set up reverse tethering over USB?
1、Connect Android device via USB.
2、Enable USB tethering. To do so, go to
Settings → More... → Tethering & mobile hotspot → Usb tethering.
3、At host machine, the usb tethering connection may be detected by the network manager.
Its name will be something like "Wired connection 2" (or 3).
You must edit it's "IPV4/Method" to "Shared to other computers".
3.1、Without the network manager, you will have to do it manually:
$ sudo ifconfig usb0 10.42.0.1 netmask 255.255.255.0
$ echo 1 | sudo tee /proc/sys/net/ipv4/ip_forward
3.2、modify iptables with
$ sudo iptables -t nat -A POSTROUTING -j MASQUERADE
4、At Android device
$ adb shell su -c "ifconfig rndis0 10.42.0.2 netmask 255.255.255.0"
$ adb shell su -c "route add default gw 10.42.0.1 dev rndis0"
相关文章推荐
- android手机通过USB共享电脑网络
- Android手机通过USB共享电脑网络
- Linux下完美驱动HTC Android手机的Internet传输(通过USB共享电脑网络)
- 〖Linux〗通过USB连接,共享Linux上的网络,使用Android手机上网。
- Android手机如何通过USB共享网络给Mac?
- Android手机通过USB网络共享限速
- Android手机利用USB共享网络通过Ubuntu连接网络
- 手机或pad通过usb共享网络给电脑
- [Android]手机通过USB绑定共享电脑网络
- 如何将手机wifi网络通过USB共享给电脑使用
- Android手机如何通过USB共享网络给Mac?
- G1 Android手机通过USB线共享电脑的网络上网
- 手机通过蓝牙共享网络给电脑上网
- Ubuntu下android手机通过usb连接电脑,显示"???????????? no permissions"问题
- Ubuntu下android手机通过usb连接电脑,显示"???????????? no permissions"问题
- ubuntu通过蓝牙共享网络给Android手机
- 新手守则——Android手机通过USB连接电脑无法连接到Eclipse的情况
- Android杂谈--通过DDMS实现电脑与Android设备(如手机,平板)的网络连接、截图