In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
It is believed that many inexperienced people don't know what to do about how to connect wifi through command in Linux system. Therefore, this paper summarizes the causes and solutions of the problem. Through this article, I hope you can solve this problem.
The first thing we do after we install the Linux system is to connect to the Internet. Most people choose to connect to the Internet through cable. This article will share with you about networking through the command line.
There are of course many ways to set up a connection to WiFi from the command line, but in this article, it is also suggested that I use the most basic method: use the programs and tools included in the "default package" that are included in any release. Or I prefer to use this method. The obvious advantage of using this method is that the operation can be reused on any machine with a Linux system. The bad thing is that it is relatively complicated.
First of all, I assume that you have correctly installed the drivers for the wireless network card. Without this premise, everything in the follow-up is like a mirror. If you do not install your machine correctly, you should look at the wikis and documentation about your release.
You can then check which interface supports the wireless connection with the following command:
Iwconfig generally speaking, the wireless interface is called wlan0. Of course, there are exceptions, but we will always use the general term in this tutorial.
Just in case, you need to make sure that the interface service is enabled:
Once sudo ip link set wlan0 up confirms that the wireless interface is working, you can scan the nearby wireless network with the following command:
$sudo iw dev wlan0 scan | less
According to the results of the scan, you can get the name of the network (its SSID), the strength of its information, and which security encryption it uses (e.g. WEP, WPA/WPA2). From now on, it will be divided into two routes: the situation is good, the situation is easy, and the situation is slightly more complicated.
If the network you want to connect to is not encrypted, you can connect directly with the following command:
$sudo iw dev wlan0 connect [Network SSID] if the network is encrypted with WEP, it is also very easy:
$sudo iw dev wlan0 connect [Network SSID] key 0: [WEP key] but if the network uses the WPA or WPA2 protocol, things will not be easy. In this case, you have to use a tool called wpasupplicant, which is not available by default. Then you need to modify the / etc/wpasupplicant/wpa_supplicant.conf file by adding the following line:
Network= {ssid= "[network ssid]" psk= "[password]" priority=1} I suggest you add it at the end of the file and make sure all other configurations are commented out. Note that SSID and password strings are case-sensitive. Technically, you can also think of the name of the access point as SSID, and if you use the wpa_supplicant tool, there will be an appropriate SSID to replace it.
Once the configuration file has been modified, start this command in the background:
$sudo wpa_supplicant-I wlan0-c / etc/wpa_supplicant/wpa_supplicant.conf finally, whether you connect to an open network or an encrypted secure network, you have to get an IP address. Simply use the following command:
Sudo dhcpcd wlan0 if all goes well, you should have obtained a new local IP through DHCP, which is done automatically in the background. If you want to confirm whether it is really connected, you can check it again by entering the following command:
Finally, I think it is necessary to repeat the check operation of the first step many times. You never know when your graphical user interface is down, or when you can't access your wireless connection, so get ready to test it with commands now.
What is Linux system Linux is a free-to-use and free-spread UNIX-like operating system, is a POSIX-based multi-user, multi-task, multi-threaded and multi-CPU operating system, using Linux can run major Unix tools, applications and network protocols.
After reading the above, have you mastered how to connect wifi through commands in the Linux system? If you want to learn more skills or want to know more about it, you are welcome to follow the industry information channel, thank you for reading!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.