iwlist wlan0 scan
From: http://linux-wiki.cn/wiki/%E6%97%A0%E7%BA%BF%E7%BD%91%E5%8D%A1%E9%85%8D%E7%BD% AE
This article describes how to manually configure a wireless network card on the Linux command line interface. Currently, most popular releases support convenient configuration with the network-manager graphical interface, without the original method described in this article.
The following describes how to configure a wireless network in the command line by using commands such as iwconfig and ifconfig. The problem is that the wireless NIC driver has been correctly installed and recognized by the system.
General idea
The general idea of work is as follows:
- Enable the power of the wireless network card with iwconfig, and find the wireless network in the area
- Connect to the corresponding Wireless Network
- Enable the wireless network card through ifconfig and obtain the IP address (if DHCP is used)
Note:
Assume that the wireless network is identified as wlan0. If your network card is not identified as wlan0, you can modify it during the operation. Specific Process
1. Power on the wireless network card
iwconfig wlan0 txpower on
2. List wireless networks in a region
iwlist wlan0 scan
3. If you want to connect to the network myhome (that is, the network where Essid is myhome), enter the command
iwconfig wlan0 essid "MyHome"
If the network is encrypted and the password is 0123456789, enter the command
iwconfig wlan0 essid "MyHome" key 0123-4567-89
4. If it is normal, enter
iwconfig wlan0
You can see the parameters of the normal connection. 5. enable wireless Nic
ifconfig wlan0 up
6. If the IP address is obtained through DHCP, use dhclient or dhcpcd to obtain the IP address.
dhclient wlan0
Or
dhcpcd wlan0
7. Now the wireless network adapter can be used normally.
PS: When a wireless network card finds a signal but cannot connect to the network using a command line, you can enable "network connection" and manually set network point SSID, password, and other parameters in the wireless bar, automatically connect after saving and exiting ()