Simple application of Iwpriv (Iwlist, iwconfig) under Linux

Source: Internet
Author: User

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
    1. 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
  1. Iwlist ra0 Scanning
  2. = = =>rt_ioctl_giwscan (one) BSS returned, data->length = 1427
  3. RA0 Scan Completed:
  4. Cell 01-address:c4:ca:d9:1d:9e:a0
  5. protocol:802.11b/g/n
  6. ESSID: ""
  7. Mode:managed
  8. frequency:2.412 GHz (Channel 1)
  9. quality=7/100 Signal level=-87 dBm Noise level=-82 dBm
  10. Encryption Key:off
  11. Bit rates:54 MB/s
  12. Cell 02-address:fc:75:16:a1:a9:16
  13. protocol:802.11b/g/n
  14. ESSID: "Jxj_rd"
  15. Mode:managed
  16. frequency:2.452 GHz (Channel 9)
  17. quality=94/100 Signal level=-53 dBm Noise level=-92 dBm
  18. Encryption Key:on
  19. Bit rates:54 MB/s
  20. IE:WPA Version 1
  21. Group Cipher:tkip
  22. Pairwise ciphers (2): TKIP CCMP
  23. Authentication Suites (1): PSK
  24. Ie:ieee 802.11I/WPA2 Version 1
  25. Group Cipher:tkip
  26. Pairwise ciphers (2): TKIP CCMP
  27. Authentication Suites (1): PSK
  28. Cell 03-address:c4:ca:d9:02:2a:70
  29. protocol:802.11b/g/n
  30. ESSID: ""
  31. Mode:managed
  32. frequency:2.462 GHz (Channel 11)
  33. quality=83/100 Signal level=-57 dBm Noise level=-92 dBm
  34. Encryption Key:off
  35. Bit rates:54 MB/s
  36. Cell 04-address:14:d6:4d:75:ca:9c
  37. protocol:802.11b/g/n
  38. ESSID: "Liangym"
  39. Mode:managed
  40. frequency:2.472 GHz (Channel 13)
  41. quality=100/100 Signal level=-27 dBm Noise level=-92 dBm
  42. Encryption Key:on
  43. Bit rates:54 MB/s
  44. IE:WPA Version 1
  45. Group cipher:ccmp
  46. Pairwise ciphers (1): CCMP
  47. Authentication Suites (1): PSK
  48. Ie:ieee 802.11I/WPA2 Version 1
  49. Group cipher:ccmp
  50. Pairwise ciphers (1): CCMP
  51. 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
    1. Iwpriv ra0 set networktype=Infra


(2) Set the security mode of the wireless network to be connected:

[HTML]View Plaincopy
    1. Iwpriv ra0 set authmode=WPA2PSK


(3) Set the network encryption mode: (CCMP is AES)

[HTML]View Plaincopy
    1. Iwpriv ra0 set encryptype=TKIP


(4) Set the password for the connection: ******** is the password for the encrypted network

[HTML]View Plaincopy
    1. Iwpriv ra0 set wpapsk=*******

(5) Connect to the network: There are two ways:

<1> with iwpriv command

[HTML] view Plaincopy
  1. Iwpriv ra0 set ssid=jxj_rd

<2> with iwconfig command

[HTML] view Plaincopy
  1. 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
  1. 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.