blob: b04fb48e347b81d35ec1c223371f07db093f93a9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
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
}
|