Centos cannot connect to wifi solution

Release: 2020-03-31 14:37:39
Original
9143 people have browsed it

Centos cannot connect to wifi solution

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
Copy after login

2. Check the wireless network port

#iw dev
Copy after login

Interface, which is followed by the wireless network The name of the interface can also be viewed through the ip command.

#ip a
Copy after login

3. Activate the wireless network interface

#ip link set [name] up
Copy after login

In order to verify whether the interface is activated successfully, you can view the output of the following command:

#ip link show [name]
Copy after login

indicates that the interface is successfully activated. Among them, [name] corresponds to the name of the wireless network interface, the same below.

4. Check the wireless network connection status

#iw [name] link
Copy after login

It should show no connection at first

5. Scan for connectable wifi

#iw [name] scan | grep SSID
Copy after login

6. Connect The specified SSID

#wpa_supplicant -B -i wlp4s0 -c <(wpa_passphrase "[SSID]" "[PIN]")
Copy after login

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]
Copy after login

8. Test whether the IP is successfully obtained from the router

#ip a show [name]
Copy after login

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
Copy after login

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!