# # Original File # ------------- # http://www.Linux-Sec.net/Wireless/Install-HowTo/madwifi.txt # http://www.Linux-Sec.net/Wireless/Install-HowTo/NetGear.WG311.Install.sh.txt ( this file ) # # # 10-Dec-03 amo Install Wireless PCI card ( Netgear WQG311 -- 802.11g ) # 19-Dec-03 amo Allow for 2.6.0 vs 2.4.23 kernels # 02-Jan-04 amo Added slackware/redhat switch # 04-Jan-04 amo Converted to stop|start format, iwconfig, iwpriv commands # 18-Apr-04 amo Renamed wl.install.sh to NetGear.WG311.Install.txt # 19-Apr-04 amo Install latest iwconfig ( beta27 ) # 20-Apr-04 amo Separate out the commands # # # # Define the Wireless Network # ---------------------------- # CHANNEL=1 ESSID="WL.Linux-Sec.net" INTERFACE="ath0" IPADDR="192.168.11.12" KEY="02468" # # Set the card in master mode - for AccessPoint MODE="Master" NETMASK="255.255.255.0" # # # Determine broadcast and network addresses from the IP address and netmask: # # 192.168.11.255 # BROADCAST=`ipmask $NETMASK $IPADDR | cut -f 1 -d ' '` BROADCAST=192.168.11.255 # # 192.168.11.0 # NETWORK=`ipmask $NETMASK $IPADDR | cut -f 2 -d ' '` NETWORK=192.168.11.0 # # # Set up the WiFi card # echo "Configuring Wireless: ${INTERFACE}:" # if [ `uname -r` = "2.6.0" ]; then # WLAN="/lib/modules/`uname -r`/net/wlan.ko" HAL="/lib/modules/`uname -r`/net/ath_hal.ko" PCI="/lib/modules/`uname -r`/net/ath_pci.ko" # else # WLAN="/lib/modules/`uname -r`/net/wlan.o" HAL="/lib/modules/`uname -r`/net/ath_hal.o" PCI="/lib/modules/`uname -r`/net/ath_pci.o" # fi # # # First stop the network # ----------------------- # stop () { # echo "" echo "this hangs the machine ... exiting " echo "" # if [ -f /etc/redhat-release ]; then /etc/rc.d/init.d/network stop fi # if [ -f /etc/slackware-version ]; then ifconfig ath0 down fi # # # Unload the wireless modules # # == hangs the machine # # rmmod ath_pci # rmmod wlan # rmmod ath_hal # } # stop # # # # Load the wireless modules and add the wireless routes # ----------------------------------------------------- # start() { # # Add the wireless drivers # ------------------------ insmod $WLAN # insmod $HAL # insmod $PCI # # # Restart with the wirless network ( ath0 ) # -------------------------------- if [ -f /etc/redhat-release ]; then # /etc/rc.d/init.d/network start # # other end of the wireless connection # route add -net 192.168.11.0 gw 192.168.11.11 netmask 255.255.255.0 ath0 fi # if [ -f /etc/slackware-version ]; then # # # Set up as a 'master' iwconfig ath0 mode $MODE essid "$ESSID" channel $CHANNEL # # # Define the Access Point on ath0 # ------------------------------- ifconfig ${INTERFACE} ${IPADDR} broadcast ${BROADCAST} netmask ${NETMASK} # # route add -net $NETWORK gw $GATEWAY netmask $NETMASK ath0 # # # autoselect from 11a/b/g (default) iwpriv ${INTERFACE} mode 0 # iwconfig ${INTERFACE} key ${KEY} # fi # } # start # # # case "$1" in # "start") start ;; # "stop") stop ;; # "status") # echo "" echo "ifconfig -v" ifconfig -v # # echo "" echo "lsmod" lsmod # -------- # Module Size Used by Tainted: P # ath_pci 30736 1 # ath_hal 109792 1 [ath_pci] # wlan 37056 1 [ath_pci] ;; *) echo "" echo "Usage: $0 < stop|start|status >" echo "" exit 1 esac # # # End of file