Centos7 using a wireless WiFi connection

Source: Internet
Author: User
Tags get ip require dmesg

One: the command used

DMESG | grep firmware (see if there is a firmware request from the wireless card)

Iw

IW Dev (Find the wireless card port)

IW wlan0 Link (view wlan0 network Port wireless network connection)

IW wlan0 Scan | Grepssid (View Wi-Fi connection for WLAN0 network port)

Ip:

IP link set wlan0 up (opens the wireless port wlan0)

IP link Show wlan0 (shows wireless port Wlan0 connection)

IP addr Show Wlan0 (displays the assigned IP address, which is especially useful for viewing whether the IP address was successfully obtained automatically via DHCP)

Wpa_supplican:

Wpa_supplicant-b-I wlan0-c < (wpa_passphrase "SSID" "PSK") (Connection wireless network SSID, password PSK)

Dhclient

Dhclient wlan0 (assigning IP addresses to Wlan0)

To use the above command, simply replace the wlan0 directly with your own network port.


Second: The specific process:

1. See if you need to install firmware

Most wireless cards also require firmware. The kernel typically automatically detects and loads both, and if you get output like siocsifflags:no such file or directory, it means you have to manually load the firmware. If unsure, query the kernel log with DMESG to see if there is a firmware request from the wireless card. For example, if you have an Intel chipset, the output might be:
# 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 network port:

#iw Dev (The wireless network number is behind interface)

3. Activate the wireless network interface:
# IP Link Set wlan0 up
To verify that the interface is activated successfully, you can view the output of the following command:
# IP Link Show wlan0
3:wlan0: <BROADCAST,MULTICAST,UP,LOWER_UP> MTU Qdisc MQ State downmode Dormant group default Qlen Link/et Her 00:11:22:33:44:55 brdff:ff:ff:ff:ff:ff
The up in <BROADCAST,MULTICAST,UP,LOWER_UP> indicates that the interface has been successfully activated, and the subsequent state is not insignificant.

4. Check your wireless network connection:

#iw wlan0 Link
It should show no connection at first.

5. Scan for Connected WiFi
#iw Wlan0 Scan | grep SSID

Scan for available networks

6. Connect the specified SSID
# wpa_supplicant-b-I wlan0-c < (wpa_passphrase "SSID" "PSK")
Replace the SSID with the actual network name, and the PSK with the wireless password, keep the quotation marks.

7. Get IP assignment with DHCP:
# dhclient Wlan0

8. Test whether the IP was successfully acquired from the router (important)

#ip Addr Show Wlan0

If you have IP assigned, you can surf the Internet or have a ping direct test

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.