All pastes #253788 Raw Edit

Anonymous

public text v1 · immutable
#253788 ·published 2006-11-21 02:42 UTC
rendered paste body
#!/bin/sh /etc/rc.common

START=90

echo *** Starting GHB wireless ***

# Netzkonfiguration fuer earth

stop() {
        ifconfig eth0 down
        ifconfig ath0 down
        ifconfig ath1 down
        wlanconfig ath0 destroy
        wlanconfig ath1 destroy
}


emergency_interface() {
        # Emergency maintenance interface
        ifconfig eth0:0 192.168.250.250 netmask 255.255.255.0 up
}

start() {
        # Interface
        ifconfig eth0 141.28.15.39 netmask 255.255.255.224 up
        ifconfig eth0:1 141.28.15.33 netmask 255.255.255.224 up


        # WLAN Interfaces erzeugen #       wlanconfig ath0 create wlandev wifi0 wlanmode sta
#       wlanconfig ath1 create wlandev wifi1 wlanmode sta
        wlanconfig ath0 create wlandev wifi0 wlanmode adhoc
        wlanconfig ath1 create wlandev wifi1 wlanmode adhoc

        # 802.11a aktivieren
        iwpriv ath0 mode 11a
        iwpriv ath1 mode 11a

        # Diversity abschalten
        sysctl -w dev.wifi0.diversity=0
        sysctl -w dev.wifi1.diversity=0
        sysctl -w dev.wifi0.txantenna=1
        sysctl -w dev.wifi0.rxantenna=1
        sysctl -w dev.wifi1.txantenna=1
        sysctl -w dev.wifi1.rxantenna=1

        iwconfig ath0 essid GHB00
        iwconfig ath1 essid GHB11
        iwconfig ath0 channel 149
        iwconfig ath1 channel 165
        iwconfig ath0 enc 73f5d9ca460befd6184512abdc
        iwconfig ath1 enc ed90264bcab6529fab1037f4b1

        ifconfig ath0 141.28.15.81 netmask 255.255.255.252 up
        ifconfig ath1 141.28.15.85 netmask 255.255.255.252 up


        # Routing aktiviere
        route add -net 141.28.15.84 netmask 255.255.255.252 gw 141.28.15.82
        route add -net 141.28.15.88 netmask 255.255.255.248 gw 141.28.15.82
        route add -net 141.28.224.0 netmask 255.255.255.0 gw 141.28.15.82
        route add -net 141.28.227.0 netmask 255.255.255.0 gw 141.28.15.82
        route add -net 141.28.228.0 netmask 255.255.255.0 gw 141.28.15.82
#       route add default gw 141.28.15.62
        ip route add default via 141.28.15.62 dev eth0 src 141.28.15.33

}


boot() {
        stop
        emergency_interface
        start
}