Zaurus:
SL-5500 (Collie)
Hentges.net ROM T7 (based on OpenZaurus 3.5.2)
PC:
Debian 3.1 "Sarge", Vanilla Kernel 2.6.11.6 (Should work with earlier 2.6 kernels, but note that the driver location has moved.)
Drivers:
Device Drivers -> USB Support -> USB Network Adapters
Set "Multi-purpose USB Networking Framework" as a Module and turn on "Embedded ARM Linux links (iPaq, ...)" and "Sharp Zaurus (stock ROMs)"
Rebuild your kernel or just "make; make modules_install" if you're feeling brave.
(In other words, CONFIG_USB_USBNET=m, CONFIG_USB_ARMLINUX=y and CONFIG_USB_ZAURUS=y)
This will make the "usbnet.ko" module.
PC-Side changes
Install the "hotplug" package.
Add the following line into /etc/hotplug/usb.distmap:
usbnet 0x003 0x04dd 0x8004 0x0000 0x0000 0x00 0x00 0x00 0x00 0x00 0x00 0x00000000
(That's one single line with Thirteen (13) white-space-delimited fields)
Now create the following file /etc/hotplug/usb/usbnet:
#! /bin/bash
typeset -i num
num=`ifconfig | grep usb0 | wc -l`
if [ $num -eq 0 ]; then
ifup usb0
else
ifdown usb0
sleep 1
ifup usb0
fi
and make it executable with "chmod +x /etc/hotplug/usb/usbnet"
Add the following to /etc/network/interfaces:
# USBd Interface to the Zaurus
# Statically configure the interface (i.e. no DHCP)
iface usb0 inet static
address 192.168.129.200 # Address of PC's end of link
pointopoint 192.168.129.201 # Address of Zaurus' end of link
netmask 255.255.255.255
# Now call some commands when the link comes up
up iptables -t nat -F # Flush the NAT table
up iptables -t nat -A POSTROUTING -j SNAT -o eth0 --to $addr
# Set up Source Network Address Translation (SNAT)
# Note:
# eth0 - Interface towards the internet.
# This can probably be ppp0 if the PC is dialled up.
# $addr - Set this to the address of the above interface.
up echo "1" > /proc/sys/net/ipv4/ip_forward
# Turn on IP Forwarding
# Now call some commands AFTER the link has gone down
post-down echo "0" > /proc/sys/net/ipv4/ip_forward
# Turn off IP Forwarding
post-down iptables -t nat -F # Flush the NAT table
# Optional IPv6 on interface
iface usb0 inet6 static
address 2001:618:429:cafe::5501 # Choose an address in your own block
# I have ...::5501 at this end and the
# Zaurus configured as ...::5500
netmask 128
mtu 1500
Zaurus-side changes
In Network Settings, for usbd0:
Turn ON "Automatically bring up"
Turn OFF "DHCP"
IP Address: 192.168.129.201 (To match pointopoint address above)
Subnet Mask: 255.255.255.0
Gateway: 192.168.129.200 (To match address on PC)
First DNS: Whatever you like
Second DNS: Whatever you like
Now, you should be able to just plug the Zaurus in. Hotplug will detect the SL-5500, load usbnet.ko, configure the interface and iptables will allow the Zaurus to connect to the internet.
NOTE: We've only used Source NAT so, while the Zaurus can access the internet (pull down ipks etc), it is not accessible to internet computers connecting to it. (That is, you won't be able to ping the Zaurus or connnect to any servers on the Zaurus from any computer other than the one at the end of the USB cable). Also note that you WILL want to tweak the lines in /etc/network/interfaces if you perform other NAT functions on the PC. Suggestions are welcome for more specific (and better) iptables commands.