start on G_NOKIA_READY
console output
script
ifconfig usb0 up 192.168.99.1/24
modprobe ipt_MASQUERADE
iptables -A POSTROUTING -t nat -o gprs0 -j MASQUERADE
echo 1 > /proc/sys/net/ipv4/conf/all/forwarding
end script
config_lan0=( "dhcp" )
config_usb0=( "noop" "noop" )
dhcpcd_lan0="-q -t 10"
modules_wlan0=( "wpa_supplicant" "iproute2" "!plug" )
dhcpcd_wlan0="-q -t 15"
config_ferret="dhcp"
config_nibylandia="dhcp"
config_avantis_wifi="dhcp"
#config_arach="10.0.4.10/24"
config_arach="dhcp"
preup() {
if [[ "${IFACE}" = "lan0" ]]; then
if [[ $(/sbin/iwconfig wlan0|awk '/ESSID:/ { gsub(/.*ESSID:/, ""); print $1 }') = "\"arach\"" ]]; then
eselect rc stop net.wlan0
fi
fi
if [[ "${IFACE}" = "usb0" ]]; then
/etc/init.d/net.lan0 status 2> /dev/null > /dev/null || \
/etc/init.d/net.wlan0 status 2> /dev/null > /dev/null
if [[ ! $? -eq 0 ]]; then
ifconfig usb0 up 192.168.99.100/24
route add default gw 192.168.99.1
echo nameserver 8.8.8.8 > /etc/resolv.conf
/usr/bin/sleep 5
su - arachnist -c "ssh 192.168.99.1 dbus-send --type=method_call \
--system --dest=com.nokia.icd /com/nokia/icd com.nokia.icd.connect \
\"'string:Plus GSM INTERNET GPRS'\" uint32:0"
fi
fi
}
predown() {
if [[ "${IFACE}" = "lan0" ]]; then
/etc/init.d/net.wlan0 status > /dev/null 2>&1 || \
eselect rc start net.wlan0
fi
}
iptables -D <rule> 2>/dev/null || true iptables -A <rule>
iptables -D <rule> 2>/dev/null || true iptables -A <rule>