Centos7 wireless Wi-Fi connection

Source: Internet
Author: User
I. command dmesg | grepfirmware (check whether there are firmware requests from the wireless network adapter) iw: iwdev (find the wireless network card port) iwwls1link (view the wireless network connection of the wls1 network port) iwwls1scan

I. commands used

Dmesg | grep firmware (see if there are any firmware requests from the wireless network adapter)

Iw:

Iw dev (search for wireless network ports)

Iw wls1 link (view the wireless network connection of the wls1 network port)

Iw wls1 scan | grep SSID (View wifi accessible to the wls1 network port)

Ip:

Ip link set wls1 up (enable the wireless network port wls1)

Ip link show wls1 (display wls1 connection of wireless network port)

Ip addr show wls1 (displays assigned ip addresses, especially for checking whether ip addresses are automatically obtained through dhcp successfully)

Wpa_supplican:

Wpa_supplicant-B-I wlp3s0-c <(wpa_passphrase "ssid" "psk") (connect to the wireless network ssid, password psk)

Dhclient:

Dhclient wls1 (assign an IP address to wls1)

To use the preceding command, you only need to replace wls1 with your own network port.


II. specific process:

  1. Check whether the firmware needs to be installed.

    Most wireless NICs still need firmware. The kernel will usually automatically detect and load the two. if you get output similar to SIOCSIFFLAGS: No such file or directory, it means you have to manually load the firmware. If you are not sure, use dmesg to query the kernel log to see if there are any firmware requests from the wireless network adapter. For example, if you have an Intel chipset, the output is probably like this:
    # Dmesg | grep firmware
    Firmware: requesting iwlwifi-5000-1.ucode
    If no output is available, the system's wireless chip does not require firmware.

  2. View wireless network ports:

    # Iw dev)

  3. Activate the wireless network interface:
    # Ip link set wls1 up
    To check whether the interface is successfully activated, you can view the output of the following command:
    # Ip link show wls1
    3: wls1: Mtu 1500 qdisc mq state DOWN mode DORMANT group default qlen 1000 link/ether 00: 11: 22: 33: 44: 55 brd ff: ff
    "UP" indicates that the interface is successfully activated, and the state DOWN after it does not matter.

  4. View wireless network connection information:

    # Iw wls1 link
    At the beginning, no connection is displayed.

  5. Scan accessible wifi
    # Iw wls1 scan | grep SSID

    Scan available networks

  6. Connect to the specified SSID
    # Wpa_supplicant-B-I wlp3s0-c <(wpa_passphrase "ssid" "psk ")
    Replace ssid with the actual network name, and psk with the wireless password. keep quotation marks.

  7. Use dhcp to obtain IP address allocation:
    # Dhclient wlp3s0

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

    # Ip addr show wls1

    If an ip address is assigned, you can access the Internet or ping the ip address to test the connection.

 

Reference: http://www.blackmoreops.com/2014/09/18/connect-to-wifi-network-from-command-line-in-linux/ https://wiki.archlinux.org/index.php/Beginners%27_guide_ (% E7 % AE % 80% E4 % BD % 93% E4 % B8 % AD % E6 % 96% 87)

 

This article is from the "technical life" blog, please be sure to keep this source http://hgmz123.blog.51cto.com/9413337/1634805

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.