Detail how centos7 USES wireless wifi connections

  • 2020-05-14 05:50:43
  • OfStack

When using centos, I haven't tried using wifi. They are all wired. Today, I installed centos7 on my laptop and found that there was no such thing as wifi. So I inquired 1 data.

1. Commands used

dmesg | grep firmware (see if there is any firmware request from the wireless card)

iw:


   iw dev( Look for the wireless bayonet )
   iw wls1 link( To view wls1 Port wireless network connection )
   iw wls1 scan | grep SSID( To view wls1 Net mouth can be connected wifi)

ip:


   ip link set wls1 up( Will wireless network port wls1 open )
   ip link show wls1( Display wireless port wls1 connectivity )
   ip addr show wls1( Display allocated ip Address, especially to see if it was successfully passed dhcp Get it automatically ip address ) 

wpa_supplican:


wpa_supplicant -B -i wlp3s0 -c <(wpa_passphrase "ssid" "psk") ( Connect to wireless network ssid The password psk)

dhclient:


dhclient wls1( for wls1 distribution ip address )

To use the above command, simply replace wls1 with your own interface

2. Specific process:

1. Check if you need to install firmware

Most wireless CARDS also require firmware. Kernel 1 will automatically detect and load both, and if you get something like SIOCSIFFLAGS: No such file or directory output, that means you have to manually load the firmware. If in doubt, query the kernel log with dmesg to see if there are any firmware requests from the wireless card. For example, if you have an Intel chipset, the output will look something like this:


# dmesg | grep firmware
firmware: requesting iwlwifi-5000-1.ucode

If there is no output, the system's wireless chip does not require firmware.

2. Check the wireless port:


#iw dev(interface This is followed by the wireless slogan )

3. Activate the wireless network interface:


# ip link set wls1 up 

To verify that the interface was activated successfully, you can view the output of the following command:


# ip link show wls1
3: wls1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc mq state DOWN mode DORMANT group default qlen 1000 link/ether 00:11:22:33:44:55 brd ff:ff:ff:ff:ff:ff 

< BROADCAST,MULTICAST,UP,LOWER_UP > UP in UP indicates that the interface has been successfully activated, while state DOWN is irrelevant.

4. Check the wireless network connection:


#iw wls1 link

You should start with connectionless

5. Scan the connectable wifi


#iw wls1 scan | grep SSID

Scan the available network

6. Connect to the specified SSID


   ip link set wls1 up( Will wireless network port wls1 open )
   ip link show wls1( Display wireless port wls1 connectivity )
   ip addr show wls1( Display allocated ip Address, especially to see if it was successfully passed dhcp Get it automatically ip address ) 
0

Replace ssid with the actual network name and psk with the wireless password, keep the quotes.

7. Obtain IP allocation with dhcp:


   ip link set wls1 up( Will wireless network port wls1 open )
   ip link show wls1( Display wireless port wls1 connectivity )
   ip addr show wls1( Display allocated ip Address, especially to see if it was successfully passed dhcp Get it automatically ip address ) 
1

8. Test whether ip was successfully obtained from the router (important)


   ip link set wls1 up( Will wireless network port wls1 open )
   ip link show wls1( Display wireless port wls1 connectivity )
   ip addr show wls1( Display allocated ip Address, especially to see if it was successfully passed dhcp Get it automatically ip address ) 
2

If you have ip assigned, you can go online, or you can have ping tested directly


Related articles: