I. command dmesg | grepfirmware (check whether there are firmware requests from the wireless network adapter) iw: iwdev (find the wireless network card port) iwwls1link (view the wireless network connection of the wls1 network port) iwwls1scan
I. commands used
Dmesg | grep firmware (see if there are any firmware requests from the wireless network adapter)
Iw:
Iw dev (search for wireless network ports)
Iw wls1 link (view the wireless network connection of the wls1 network port)
Iw wls1 scan | grep SSID (View wifi accessible to the wls1 network port)
Ip:
Ip link set wls1 up (enable the wireless network port wls1)
Ip link show wls1 (display wls1 connection of wireless network port)
Ip addr show wls1 (displays assigned ip addresses, especially for checking whether ip addresses are automatically obtained through dhcp successfully)
Wpa_supplican:
Wpa_supplicant-B-I wlp3s0-c <(wpa_passphrase "ssid" "psk") (connect to the wireless network ssid, password psk)
Dhclient:
Dhclient wls1 (assign an IP address to wls1)
To use the preceding command, you only need to replace wls1 with your own network port.
II. specific process:
-
Check whether the firmware needs to be installed.
Most wireless NICs still need firmware. The kernel will usually automatically detect and load the two. if you get output similar to SIOCSIFFLAGS: No such file or directory, it means you have to manually load the firmware. If you are not sure, use dmesg to query the kernel log to see if there are any firmware requests from the wireless network adapter. For example, if you have an Intel chipset, the output is probably like this:
# Dmesg | grep firmware
Firmware: requesting iwlwifi-5000-1.ucode
If no output is available, the system's wireless chip does not require firmware.
-
View wireless network ports:
# Iw dev)
-
Activate the wireless network interface:
# Ip link set wls1 up
To check whether the interface is successfully activated, you can view the output of the following command:
# Ip link show wls1
3: wls1: Mtu 1500 qdisc mq state DOWN mode DORMANT group default qlen 1000 link/ether 00: 11: 22: 33: 44: 55 brd ff: ff
"UP" indicates that the interface is successfully activated, and the state DOWN after it does not matter.
-
View wireless network connection information:
# Iw wls1 link
At the beginning, no connection is displayed.
-
Scan accessible wifi
# Iw wls1 scan | grep SSID
Scan available networks
-
Connect to the specified SSID
# Wpa_supplicant-B-I wlp3s0-c <(wpa_passphrase "ssid" "psk ")
Replace ssid with the actual network name, and psk with the wireless password. keep quotation marks.
-
Use dhcp to obtain IP address allocation:
# Dhclient wlp3s0
-
Test whether the ip address is obtained from the router successfully (important)
# Ip addr show wls1
If an ip address is assigned, you can access the Internet or ping the ip address to test the connection.
Reference: http://www.blackmoreops.com/2014/09/18/connect-to-wifi-network-from-command-line-in-linux/ https://wiki.archlinux.org/index.php/Beginners%27_guide_ (% E7 % AE % 80% E4 % BD % 93% E4 % B8 % AD % E6 % 96% 87)
This article is from the "technical life" blog, please be sure to keep this source http://hgmz123.blog.51cto.com/9413337/1634805