1. Check whether you need to install firmware
Most wireless network cards also require firmware. The kernel will usually detect and load both automatically, if you get output like SIOCSIFFLAGS: No such file or directory it means you have to load the firmware manually. If you are not sure, use dmesg to query the kernel log to see if there is a firmware request from the wireless network card. The command is as follows:
#dmesg | grep firmware
2. Check the wireless network port
#iw dev
Interface, which is followed by the wireless network The name of the interface can also be viewed through the ip command.
#ip a
3. Activate the wireless network interface
#ip link set [name] up
In order to verify whether the interface is activated successfully, you can view the output of the following command:
#ip link show [name]
4. Check the wireless network connection status
#iw [name] link
It should show no connection at first
5. Scan for connectable wifi
#iw [name] scan | grep SSID
6. Connect The specified SSID
#wpa_supplicant -B -i wlp4s0 -c <(wpa_passphrase "[SSID]" "[PIN]")
wlp4s0 is the name of the personal wireless network. Replace the SSID with the name of the Wifi to be connected, and replace the PIN with the wireless password. Be careful to keep the quotation marks.
7. Use dhcp to obtain the IP allocation
#dhclient [name]
8. Test whether the IP is successfully obtained from the router
#ip a show [name]
If the IP is allocated, you can access the Internet.
You may still be unable to connect to the Internet after the operation, and the connection error is reported:
Successfully initialized wpa_supplicant Could not read interface p2p-dev-wlp4s0 flags: No such device nl80211: Could not set interface 'p2p-dev-wlp4s0' UP nl80211: deinit ifname=p2p-dev-wlp4s0 disabled_11b_rates=0 p2p-dev-wlp4s0: Failed to initialize driver interface P2P: Failed to enable P2P Device interface
Solution: Killall wpa_supplicant and reconnect.
Recommended tutorial:centos tutorial
The above is the detailed content of Centos cannot connect to wifi solution. For more information, please follow other related articles on the PHP Chinese website!