Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

remove code as it's in script

  • Loading branch information...
commit 775ca1bd16658411fff7610b083092accca512b5 1 parent 4efb55e
@dpavlin authored
Showing with 1 addition and 22 deletions.
  1. +1 −22 README.mkdn
23 README.mkdn
@@ -4,28 +4,7 @@ I don't have wifi connection at work, so I'm trying to use usb networking (as en
On laptop, I'm using following script on laptop after enabling USB tether in `Settings` > `Wireless & Networks` > `Tethering` to setup default route on Android through laptop's network and provide NAT for it.
- #!/bin/sh -x
- sudo id
- android=`adb shell ip addr list usb0 | grep 'inet ' | sed 's/^ *//g'`
- a_ip=`echo $android | cut -d" " -f2 | cut -d/ -f1`
- c_ip=`echo $a_ip | cut -d. -f-3`.1
- netmask=`echo $android | cut -d" " -f4`
- echo "Android $a_ip netmask $netmask -> $c_ip"
- sudo ifconfig usb0 $c_ip netmask $netmask up
- sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"
- sudo iptables -t nat -A POSTROUTING -s $a_ip -o br0 -j MASQUERADE
- adb shell ip route add default via $c_ip
- adb shell setprop net.dns1
- adb shell ping -c 1 $c_ip
- ping -c 1 $a_ip
This does work if tested with ping from `adb shell`, but Android still doesn't think it's connected to network and I'm getting "No network connection" error when using browser. However, network *does work* and after dismissing requestor I can use browser normally.
Please sign in to comment.
Something went wrong with that request. Please try again.