Running Slackware Linux on Thinkpad T61

Wireless Configuration in Slackware Linux for ThinkPad T61

Author: Cowyn Li

Enable wireless support and iwl3945 driver in the kernel. You could check my kernel config for T61.

There is a program called wicd, which is worth a try if your are looking for a GUI network management solution. Otherwise, the following content is for your reference.

  $ sudo grep -v ^# /etc/wpa_supplicant.conf 

  ctrl_interface=/var/run/wpa_supplicant
  ctrl_interface_group=0
  eapol_version=1
  ap_scan=0
  fast_reauth=1

  network={
    key_mgmt=IEEE8021X
    eap=PEAP
    identity="xxx"
    password="xxx"
    phase1="peaplabel=0"
    phase2="auth=MSCHAPV2"
  }
        
  $ sudo grep -v ^# /etc/wpa_supplicant.wireless.conf 

  ctrl_interface=/var/run/wpa_supplicant
  fast_reauth=1

  network={
    ssid="xxx"
    scan_ssid=1
    key_mgmt=WPA-EAP
    eap=PEAP
    identity="xxx"
    password="xxx"
    phase1="peaplabel=0"
    phase2="auth=MSCHAPV2"
  }

  network={
    ssid="xxx"
    scan_ssid=1
    key_mgmt=WPA-PSK
    psk="xxx"
  }
        

I don't use the /etc/rc.d/rc.wireless script comes from Slackware Linux, I made one script of my own:

$ cat ~/bin/ipswitch

  #!/usr/bin/env bash
  #
  # Written for switching network profiles
  # by Cowyn Li <cowynli_#_gmail.com>

  TMP=$HOME/tmp/ipswitchreply

  # Turn off the interface:
  interfaceoff() {
    if [ -s "/var/run/dhcpcd-eth0.pid" ]; then
      dhcpcd -k eth0
    fi
    if [ "$(ifconfig|egrep '^eth0')" ]; then
      ifconfig eth0 down
    fi
    if [ "$(ifconfig|egrep '^ppp0')" ]; then
      /usr/sbin/pppoe-stop
    fi
    if [ -s "/var/run/pppoe.conf-pppoe.pid.pppd" ]; then
      /usr/sbin/pppoe-stop
    fi
    if [ "$(ifconfig|egrep '^wlan0')" ]; then
      ifconfig wlan0 down
    fi
    if [ -S /var/run/wpa_supplicant/wlan0 -a \
                  -s /var/run/wpa_supplicant.wireless.pid ]; then
      kill $(cat /var/run/wpa_supplicant.wireless.pid)
    fi
    if [ -S /var/run/wpa_supplicant/eth0 -a \
                  -s /var/run/wpa_supplicant.pid ]; then
      kill $(cat /var/run/wpa_supplicant.pid)
    fi
  }

  # Manage WPA daemon:
  wpadaemon_wireless() {
    ifconfig wlan0 0
    if [ ! -S /var/run/wpa_supplicant/wlan0 ]; then
      wpa_supplicant -B -Dwext -iwlan0 \
                  -c/etc/wpa_supplicant.wireless.conf \
                  -P/var/run/wpa_supplicant.wireless.pid
    fi
  }

  wpadaemon_wired() {
    if [ ! -S /var/run/wpa_supplicant/eth0 ]; then
      wpa_supplicant -B -Dwired -ieth0 \
                  -c/etc/wpa_supplicant.conf \
                  -P/var/run/wpa_supplicant.pid
    fi
  }

  # Dialog
  dialog --title "Network Profile Switch Tool (ipswitch version 0.1)" \
    --default-item "wifi-linksys" \
    --menu "\nPlease select the profile below and press ENTER to continue.\n \
    \nWhich option would you like?\n" \
    20 85 9 \
      "pppoe" "Ethernet connection via PPPoE" \
      "eth-dhcp" "DHCP through ethernet connection" \
      "eth-ali" "Ethernet connection in Alibaba Inc. office" \
      "wifi-linksys" "Wireless connection to my Linksys AP" \
      "wifi-ali" "Wireless connection in Alibaba Inc. office" \
      "wifi-tk" "Wireless connection in Taikang office" \
      "wifi-mmidc" "Wireless connection of Alimama CNC IDC at Binjiang" \
      "interface-off" "Turn off all active network interfaces (except lo)" \
      "exit" "Exit IPswitch" 2> ${TMP}
        if [ ! $? = 0 ]; then
          rm -f ${TMP}
          dialog --clear
          exit
        else
          REPLY="$(cat ${TMP})"
          rm -f ${TMP}
          case "${REPLY}" in
            pppoe)
              interfaceoff
              pppoe-start
              ;;
            eth-dhcp)
              interfaceoff
              dhcpcd -d -t 30 eth0
              ;;
            eth-ali)
              interfaceoff
              wpadaemon_wired
              dhcpcd -d -t 30 eth0
              ;;
            wifi-linksys)
              interfaceoff
              wpadaemon_wireless
              iwconfig wlan0 essid xxx
              sleep 1
              dhcpcd -d -t 30 wlan0
              ;;
            wifi-ali)
              interfaceoff
              wpadaemon_wireless
              iwconfig wlan0 essid xxx
              sleep 1
              dhcpcd -d -t 30 wlan0
              ;;
            wifi-mmidc)
              interfaceoff
              ifconfig wlan0 0
              iwconfig wlan0 essid xxx
              iwconfig wlan0 key xxx
              ifconfig wlan0 x.x.x.x netmask x.x.x.x up
              route add default gw x.x.x.x wlan0
              ;;
            wifi-tk)
              interfaceoff
              ifconfig wlan0 0
              iwconfig wlan0 essid xxx
              iwconfig wlan0 key xxx
              dhcpcd -d -t 30 wlan0
              ;;
            interface-off)
              interfaceoff
              ;;
            exit)
              dialog --clear
              exit
          esac
        fi
        

Back to Index of Running Slackware Linux on ThinkPad T61.


Valid XHTML | ©2010 dOtImes.cOm, All rights reserved. | Creative Commons | Powered by Slackware, Nginx. Posted and Maintained by Cowyn Li
Last Update: Monday, 2010-06-08, 17:30, UTC+8.