Wlan

From Linuxintro
Revision as of 16:44, 17 November 2013 by imported>ThorstenStaerk (→‎Activate the card)

This article explains how to connect to a wireless network with Linux. It has been tested with SUSE Linux 12.2. For the commands below you need to be logged in as root user.

Find out your devices

Find out what wlan devices you have

# hwinfo --wlan --short
network:                                                        
  wlan0                Ralink 802.11 bg WLAN

In this example, you have one wireless network device. It is named wlan0.

Activate the card

In this example we will use SUSE Linux 12.2 and a Conceptronic USB WLAN adapter with a RALink chipset. To activate the card, set it up with

yast2 lan

Yast will offer to install the packages iw and kernel-firmware as well. This is important because the firmware must fit to the drivers' version. So accept installing iw and both iw and kernel-firmware will be installed. Then yast will create a script /etc/sysconfig/ifcfg-wlan0 containing your device's parameters. If you select it, yast will also do everything around wpa-supplicant so you can use WPA secured WLAN.

This will allow you the next command you need to call:

ifup wlan0

And your device will be activated.

Find out your networks

To find out the networks you can access, use iwlist:

# iwlist wlan0 scanning
wlan0     Scan completed :
          Cell 01 - Address: 00:1D:7E:B4:E9:31
                    ESSID:"MYLAN"
                    Mode:Master
                    Channel:1
                    Frequency:2.412 GHz (Channel 1)
                    Quality=48/100  Signal level:-70 dBm
                    Encryption key:on
                    IE: WPA Version 1
                        Group Cipher : TKIP
                        Pairwise Ciphers (2) : CCMP TKIP
                        Authentication Suites (1) : PSK
                    IE: Unknown: 2D1A4C1003FFFF000000000000000000000000000000000000000000
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s
                              9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s; 36 Mb/s
                              48 Mb/s; 54 Mb/s
                    Extra:tsf=000001a52e792180
                    Extra: Last beacon: 764ms ago
          Cell 02 - Address: 00:0D:88:A0:BD:32
                    ESSID:"MYLAN"
                    Mode:Master
                    Channel:11
                    Frequency:2.462 GHz (Channel 11)
                    Quality=52/100  Signal level:-46 dBm
                    Encryption key:on
                    Bit Rates:1 Mb/s; 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s
                              9 Mb/s; 12 Mb/s; 18 Mb/s; 24 Mb/s; 36 Mb/s
                              48 Mb/s; 54 Mb/s
                    Extra:tsf=00000000058c6430
                    Extra: Last beacon: 116ms ago

In this example you have two cells of a wireless network with the ESSID MYLAN. The quality of the connection is 52%.

See also