[wplug] USB internet sharing / SSH tunnel?

Eric Cooper ecc at cmu.edu
Sun Jul 2 10:52:17 EDT 2006


On Sat, Jul 01, 2006 at 09:32:02PM -0700, Shane Liesegang wrote:
> I've got a PDA running Linux (an old Sharp Zaurus) connected to my PC 
> (running Ubuntu at the moment). The USB networking is fine and dandy, 
> and both machines can ping each other and SSH to each other. The problem 
> is getting the PDA to see the internet at large. After a few disastrous 
> attempts at bridging the USB connection to the Ethernet, I'm starting to 
> wonder if there's a better way.

Here's how I get my Zaurus on the net:

/etc/network/interfaces:
    ...
    allow-hotplug usb0
    iface usb0 inet static
	    address 192.168.129.1
	    netmask 255.255.255.0
	    up /root/zaurus.sh

/root/zaurus.sh (must be executable):
    #!/bin/sh
    iptables -t nat -F
    iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE
    sysctl -w net/ipv4/ip_forward=1

This should set up the routing automatically when you put the Z in its
cradle.  (There should probably be a "down ..." line in the usb0
stanza that undoes the iptables entries, but I've never bothered.)

-- 
Eric Cooper             e c c @ c m u . e d u


More information about the wplug mailing list