With the rapid development of wireless networks, many devices offer the ability to connect to wireless networks.
So what is the WiFi in Linux in the end how to configure, connect it??
Before we start the configuration, we'll talk about the IW family. IW is a common Wi-Fi Configuration tool under Linux, with corresponding libraries and source code on the Internet. The full name is Wirelesstools.
Configure the WiFi module and connect to the appropriate wireless network process: Use the IWPRIV command primarily
1. Scan for available wireless networks:
[CPP]View Plaincopy
- Iwlist wifi-name Scanning
Wherein Wifi-name is the name of the wireless network card, such as the network card eth0 is the system default network card name, Wifi-name can be viewed with ifconfig, generally ra0.
2. Look at the network information you are scanning, and configure it as the type of network you want to connect to. The following network is scanned:
[HTML]View Plaincopy
- Iwlist ra0 Scanning
- = = =>rt_ioctl_giwscan (one) BSS returned, data->length = 1427
- RA0 Scan Completed:
- Cell 01-address:c4:ca:d9:1d:9e:a0
- protocol:802.11b/g/n
- ESSID: ""
- Mode:managed
- frequency:2.412 GHz (Channel 1)
- quality=7/100 Signal level=-87 dBm Noise level=-82 dBm
- Encryption Key:off
- Bit rates:54 MB/s
- Cell 02-address:fc:75:16:a1:a9:16
- protocol:802.11b/g/n
- ESSID: "Jxj_rd"
- Mode:managed
- frequency:2.452 GHz (Channel 9)
- quality=94/100 Signal level=-53 dBm Noise level=-92 dBm
- Encryption Key:on
- Bit rates:54 MB/s
- IE:WPA Version 1
- Group Cipher:tkip
- Pairwise ciphers (2): TKIP CCMP
- Authentication Suites (1): PSK
- Ie:ieee 802.11I/WPA2 Version 1
- Group Cipher:tkip
- Pairwise ciphers (2): TKIP CCMP
- Authentication Suites (1): PSK
- Cell 03-address:c4:ca:d9:02:2a:70
- protocol:802.11b/g/n
- ESSID: ""
- Mode:managed
- frequency:2.462 GHz (Channel 11)
- quality=83/100 Signal level=-57 dBm Noise level=-92 dBm
- Encryption Key:off
- Bit rates:54 MB/s
- Cell 04-address:14:d6:4d:75:ca:9c
- protocol:802.11b/g/n
- ESSID: "Liangym"
- Mode:managed
- frequency:2.472 GHz (Channel 13)
- quality=100/100 Signal level=-27 dBm Noise level=-92 dBm
- Encryption Key:on
- Bit rates:54 MB/s
- IE:WPA Version 1
- Group cipher:ccmp
- Pairwise ciphers (1): CCMP
- Authentication Suites (1): PSK
- Ie:ieee 802.11I/WPA2 Version 1
- Group cipher:ccmp
- Pairwise ciphers (1): CCMP
- Authentication Suites (1): PSK
As above: The value of the Essid item is the name of the wireless network, such as "Jxj_rd" above. If the value is null, the option to hide the Essid is checked in the no-line by check box.
Essid is very critical, if it is hidden, it is not unable to connect, but need to crack, use other tools, very troublesome. As to how to crack, not the content described in this article, interested friends can search online.
Get the information of the network, the next step is to configure the connection options. To connect "JXJ_RD" as an example, let's look at the specific process:
(1) Set the type of network to connect to:
[HTML]View Plaincopy
- Iwpriv ra0 set networktype=Infra
(2) Set the security mode of the wireless network to be connected:
[HTML]View Plaincopy
- Iwpriv ra0 set authmode=WPA2PSK
(3) Set the network encryption mode: (CCMP is AES)
[HTML]View Plaincopy
- Iwpriv ra0 set encryptype=TKIP
(4) Set the password for the connection: ******** is the password for the encrypted network
[HTML]View Plaincopy
- Iwpriv ra0 set wpapsk=*******
(5) Connect to the network: There are two ways:
<1> with iwpriv command
[HTML] view Plaincopy
- Iwpriv ra0 set ssid=jxj_rd
<2> with iwconfig command
[HTML] view Plaincopy
- Iwconfig RA0 Essid Jxj_rd
At this point, if the password is correct, you can connect to the network jxj_rd. If you are not sure, you can use the command to view the status:
[HTML] view Plaincopy
- Iwpriv RA0 Connstatus
Of course, you can also use the Iwconfig command to view the status, here no longer repeat.
Simple application of Iwpriv (Iwlist, iwconfig) under Linux