Home >Operation and Maintenance >CentOS >How to connect to wifi in centos?

How to connect to wifi in centos?

coldplay.xixi
coldplay.xixiOriginal
2020-07-29 14:40:4014213browse

How to connect to wifi in centos: first you need to install the firmware and check the wireless network port; then activate the wireless network interface and scan the connectable wifi, the code is [#iw [name] scan | grep SSID]; Finally, connect to the specified SSID and use dhcp to obtain the IP allocation.

How to connect to wifi in centos?

How to connect centos to wifi:

1. Check whether you need to install firmware

Mostly 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]

4b99d0c9d2b011e15884379016854d62 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

It should show no connection at first

5. Scan for connectable wifi

#iw [name] scan | grep SSID

6. Connect Specified SSID

#wpa_supplicant -B -i wlp3s0 -c <(wpa_passphrase "[SSID]" "[PIN]")

Replace the SSID with the Wifi name 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.

Recommended related tutorials: centos tutorial

The above is the detailed content of How to connect to wifi in centos?. For more information, please follow other related articles on the PHP Chinese website!

Statement:
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