basic linux wireless



View the related hardware
$ lshw -C network


$ lspci -s `lspci |egrep -i "wlan|802.11" |awk  '{print $1}'` -v


See the module used by your wireless network interface
# lspci -s `lspci |egrep -i "wlan|802.11" |awk  '{print $1}'` -v |grep modules |awk -F ': ' '{print $2}' |xargs -I{} grep {} /proc/modules
I know, I had too much coffee



Wireless Tools For Linux

iwconfig - list and manipulate the basic wireless parameters

eg:
$ iwconfig wlan0
wlan0     IEEE 802.11bg  ESSID:"duhpi"  
          Mode:Managed  Frequency:2.412 GHz  Access Point: D4:CA:6D:4F:9F:D2   
          Bit Rate=54 Mb/s   Tx-Power=20 dBm   
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Power Management:off
          Link Quality=65/70  Signal level=-45 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:3   Missed beacon:0



# iwconfig wlan0 txpower 15


# iwconfig wlan0
wlan0     IEEE 802.11bg  ESSID:"duhpi"  
          Mode:Managed  Frequency:2.412 GHz  Access Point: D4:CA:6D:4F:9F:D2   
          Bit Rate=54 Mb/s   Tx-Power=15 dBm   
          Retry  long limit:7   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality=60/70  Signal level=-50 dBm  
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:3   Missed beacon:0


iwlist - get detailed information from a wireless interface

eg: scan
# iwlist wlan0 scan


# iwlist wlan0 channel
wlan0     14 channels in total; available frequencies :
          Channel 01 : 2.412 GHz
          Channel 02 : 2.417 GHz
          Channel 03 : 2.422 GHz
          Channel 04 : 2.427 GHz
          Channel 05 : 2.432 GHz
          Channel 06 : 2.437 GHz
          Channel 07 : 2.442 GHz
          Channel 08 : 2.447 GHz
          Channel 09 : 2.452 GHz
          Channel 10 : 2.457 GHz
          Channel 11 : 2.462 GHz
          Channel 12 : 2.467 GHz
          Channel 13 : 2.472 GHz
          Channel 14 : 2.484 GHz
          Current Frequency=2.412 GHz (Channel 1)


iwspy - Get wireless statistics from specific nodes

iwpriv - Configure wireless interface private input and output control parameters



wpa_supplicant - Wi-Fi Protected Access client and IEEE 802.1X supplicant

Install on Debian based systems
# apt-get install wpasupplicant


An example /etc/network/interfaces client WPA2-PSK or WPA-PSK wireless if stanza
auto wlan0
iface wlan0 inet dhcp
        wpa-ssid duhpi
        wpa-psk  passkey

Prevent other users from reading your preshared key
# chmod 600 /etc/networ/interfaces


An example /etc/network/interfaces client WPA2-EAP or WPA-EAP wireless if stanza
auto wlan0
iface wlan0 inet dhcp
    wpa-conf /etc/wpa_supplicant/wpa_supplicant.conf
example wpa_supplicant.conf
# cat /usr/share/doc/wpasupplicant/examples/wpa2-eap-ccmp.conf
# WPA2-EAP/CCMP using EAP-TLS

ctrl_interface=/var/run/wpa_supplicant

network={
 ssid="example wpa2-eap network"
 key_mgmt=WPA-EAP
 proto=WPA2
 pairwise=CCMP
 group=CCMP
 eap=TLS
 ca_cert="/etc/cert/ca.pem"
 private_key="/etc/cert/user.p12"
 private_key_passwd="PKCS#12 passhrase"
}




use logical interfaces to switch Acess Points

An example wireless if stanza
auto wlan0

iface wlan_base inet dhcp
wpa-ssid hudpi
wpa-psk  keypass


Switch to wlan_base
# ifup wlan0=wlan_base




http://wireless.kernel.org/en/users/Documentation
Wireless Tools
http://w1.fi/wpa_supplicant
https://wiki.debian.org/WPA
Extensible_Authentication_Protocol




Basic Linux Wireless