As it turns out, this task was simpler than I expected. I got this to work with one of my two WRTSL54GS boxes and my laptop computer (Ubuntu Linux box).
First, I installed the necessary modules to get USB working, after that, I installed the usb-serial modules including the module for my pl2303 adapter:
ipkg install kmod-usb-serial kmod-usb-serial-pl2303
After that, I grabbed stty:
cd /bin
wget http://tobe.mine.nu/software/openwrt/stty.tgz
tar zxf stty.tgz
rm stty.tgz
chmod 775 stty
ln -s /lib/libc.so.0 /lib/libgcc_s.so.1
An uncompressed version of stty is available at http://projectdevel.homeip.net/files/OpenWRT/stty in case the site in the above code is offline. Since the power in the remote location is unreliable, the box may get turned off from time to time so I created a hotplug script for the serial adapter to automatically change the baud rate from 9600 kbaud to a faster value:
Contents of /etc/hotplug.d/usb/02-USB_Serial:
#!/bin/sh
# A script to increase the baud rate of a USB to Serial adapter on hotplug.
BAUD=115200
# Look for serial devices and then increase the baud rate:
if [ "$ACTION" = "add" ]
then
# search for last usb to serial assignment in syslog (/var/log/syslog.log or
DEV=`logread | grep -i ttyUSB | grep -io "usb/tts/[0-9]" | tail -n 1`
if [ "$DEV" != "" ]
then
`stty -F /dev/$DEV $BAUD -crtscts`
fi
fi
So, after that I had to make a two different ppp connections; one for the dial-in server and the dial-in client. The server keeps a ppp connection open, just waiting for a call (silent) and will resume listening after the connection is broken (persist):
Contents of /etc/ppp/peers/900MhzLink:
/dev/usb/tts/0 115200
persist
silent
crtscts
noauth
192.168.1.10:192.168.1.20
where 192.168.1.10 is the local IP and 192.168.1.20 is the remote IP. So, then it is just making a startup script to get the server up and running:
Contents of /etc/init.d/S98SerialPPP
#/bin/sh
pppd call 900MhzLink
Finally, we modify the routing rules (contents of /etc/firewall.user):
iptables -A FORWARD -i ppp0 -o eth1 -j ACCEPT
You could, of course, change eth1 back to $WAN so that everything is automatically configured but I hard-coded it since this is, at the moment, still in testing.
As for the client, I initiate the connection on the dial-in client manually so I type in:
pppd crtscts 192.168.2.20:192.168.2.10 /dev/usb/tts/0 115200
to get the ppp connection up and running. After that, I change the routing tables with:
route add default gw 192.168.2.10
There isn't much of a reason why this couldn't be done via an if-up script associated with the ppp0 interface but since I'm still testing, this is good enough for now. This should be enough to get anyone else most-of-the-way to a working bridge system anyway.
Edit: as it turns out, my client bought two ASUS WL-500GP v2 units that are supported only under (the trunk version of) Kamikaze so the remainder of my setup and configuration will be listed in that forum after everything is working.
(Last edited by bkloppenborg on 1 Jul 2008, 06:00)