On Fri, Nov 28, 2003 at 10:36:31PM +0100, BenEBoy wrote:
I finally gotten round to trying to get my zaurus to connect properly with linux (i.e. without me having to manually set the IP address) and have hit a problem. Using the instructions someone here sent me a while back I set up hotplug to grep the output of 'ifconfig' for 'usb0' when module usbnet is loaded. The usb network isn't created until I hit 'sync' on the cradle, so of course when hotplug runs when I put the PDA in the cradle usb0 doesn't exist so nothing happens.
Any ideas anyone (using knoppix BTW with a 2.4.21 kernel)? I'm playing with a daemon that (I assume) will poll for the existance of the USB network every so often and set it up if it finds one, but I don't really want another daemon taking up memory
<disclaimer> I have had a few beers, you may want to double check with me tomorrow if this doesn't work or i missed something big out</disclaimer>
You lucky boy :) I just made my Zaurus play nicely with my Debian unstable box the other day... Although I am running openzaurus on mine.
Ok, my instructions are for kernel 2.4.22 (stock debian kernel) on debian unstable.
First off add a line
CDCEther
to /etc/hotplug/blacklist to stop the wrong network module getting loaded when it sees the Z. When you stick the Z in the cradle and push the sync button you should then see usb0 when you do an ifconfig -a. Then I have added this
iface usb0 inet static address 192.168.129.200 netmask 255.255.255.255 pointopoint 192.168.129.201 up route add -host 192.168.129.201 usb0 mapping hotplug
to /etc/network/interfaces which should bring the interface up when the Z is put into the cradle and the button pressed and configure it with some sane(ish) data. I then have a script /etc/network/if-up.d/50zaurus to enable network masquerading for the Z (if you do this make sure you make the script executable or it won't work and you will swear at your computer for half an hour and then feel silly ;)) anyhow the script says
#!/bin/sh
case $IFACE in usb0) echo 1 > /proc/sys/net/ipv4/ip_forward
iptables -t filter -F FORWARD iptables -t filter -P FORWARD DROP iptables -t filter -A FORWARD -s $IF_POINTOPOINT/$IF_NETMASK -j ACCEPT iptables -t filter -A FORWARD -d $IF_POINTOPOINT/$IF_NETMASK -j ACCEPT iptables -t nat -F PREROUTING iptables -t nat -P PREROUTING ACCEPT iptables -t nat -F POSTROUTING iptables -t nat -P POSTROUTING ACCEPT iptables -t nat -F OUTPUT iptables -t nat -P OUTPUT ACCEPT iptables -t nat -A POSTROUTING -s $IF_POINTOPOINT/$IF_NETMASK -o eth0 -j MASQUERADE ;; esac
with all of this in place a Debian box running unstable should see the Z when you plug it into the cradle and push the sync button. Of course you will need to make sure that you have usb and hotplug working correctly already or this won't work :)
HTH Adam