summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'app-pda/qtopia-desktop-bin/files/usb0.conf')
-rw-r--r--app-pda/qtopia-desktop-bin/files/usb0.conf32
1 files changed, 32 insertions, 0 deletions
diff --git a/app-pda/qtopia-desktop-bin/files/usb0.conf b/app-pda/qtopia-desktop-bin/files/usb0.conf
new file mode 100644
index 000000000000..b04fb48e347b
--- /dev/null
+++ b/app-pda/qtopia-desktop-bin/files/usb0.conf
@@ -0,0 +1,32 @@
+# Add this stanza to /etc/conf.d/net to configure the Zaurus cradle
+# with the standard static IP address. You may need to set the MTU
+# on the Zaurus side to match the usb0 interface here. If the MTU
+# shows as MTU:1494 then add the following line to /etc/network/interfaces
+# on the Zaurus in the 'iface usbd0' section:
+# up ifconfig usbd0 mtu 1494
+
+config_usb0=( "null" )
+
+postup() {
+ local iface=${1}
+ if [ ${iface} == usb0 ] ; then
+ ifconfig usb0 192.168.129.200 netmask 255.255.255.0 up
+ route add -net 192.168.129.0 usb0
+ if interface_exists "eth0" ; then
+ iptables -t nat -F
+ ip=`ifconfig eth0 | grep 'inet addr'|cut -d: -f2|cut -d' ' -f1`
+ # where ${ip} is your desktop ethernet address
+ iptables -t nat -A POSTROUTING -j SNAT -o eth0 --to ${ip}
+ echo 1 > /proc/sys/net/ipv4/ip_forward
+ fi
+ fi
+ return 0
+}
+postdown() {
+ local iface=${1}
+ if [ ${iface} == usb0 ] ; then
+ iptables -t nat -F
+ echo 0 > /proc/sys/net/ipv4/ip_forward
+ fi
+ return 0
+}