Reverse Tethering

From WebOS Internals
Revision as of 20:23, 29 December 2010 by Destinal (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Sometimes access to a WiFi or bluetooth LAN is unavailable and cellular data is just too slow or doesn't provide you with access to the desired networks.

Reverse tethering is a simple solution to share your PC's network connection with your Pre / webos device (typically over a USB cable via USB networking) It is called "reverse" to distinguish it from what most call tethering, which is sharing your device's mobile provider network with a PC.

First on webos device, if it is not done already, enable USBNet.

usbnet enable       (if usb networking is not already on)
reboot

On linux workstation: (enable NAT, turn on IP forwarding, assign an IP and activate the usb interface)

iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/ip_forward
ifconfig usb0 inet 192.168.0.2 up


(On webos device -- use novaterm, ssh, or terminal app)

route delete default
route delete default
route add default gw 192.168.0.2

(optional)   
echo nameserver 8.8.8.8  > /etc/resolv.conf

ping google.com