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

How to connect to wifi in centos?

coldplay.xixi
Release: 2020-07-29 14:40:40
Original
14218 people have browsed it

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
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 Specified SSID

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

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

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!

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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template