In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
Xiaobian to share with you how to use the Nmgli command to connect WiFi in Linux terminals, I believe most people still do not know how, so share this article for everyone's reference, I hope you have a lot of harvest after reading this article, let's go to understand it together!
The nmcl command is a command after redhat7 or centos7. This command can complete all configuration work on the network card, and can be written to the configuration file and take effect permanently.
First check the name of the network device using the following command. From the output of this command, the device name/interface is wlp1s0, as shown.
$ iw devphy#0Interface wlp1s0ifindex 3wdev 0x1addr 38:b1:db:7c:78:c7type managed
Next, check the Wi-Fi device connection status using the following command.
iw wlp2s0 linkNot connected.
The output from the top of the device is not connected to any network, run the following command to scan for available Wi-Fi networks.
sudo iw wlp2s0 scancommand failed: Network is down (-100)
Considering the output of the above command, the network device/interface is in the DOWN state and you can turn it ON (UP) using the ip command as shown in the figure.
$ sudo ip link set wlp1s0 up
If the following error occurs, it means that your Wifi is hard to block on your laptop or computer.
RTNETLINK answers: Operation not possible due to RF-kill
To remove or unblock, you need to run the following command to resolve the error.
$ echo "blacklist hp_wmi" | sudo tee /etc/modprobe.d/hp.conf$ sudo rfkill unblock all
Then try turning on the network device again, and this time it should work.
$ sudo ip link set wlp1s0 up
If you know the ESSID of the Wi-Fi network you want to connect to, go to the next step, otherwise issue the following command to scan for available Wi-Fi networks again.
$ sudo iw wlp1s0 scan
Finally, connect to the Wi-Fi network using the following commands, where Hackernet (Wi-Fi network SSID) and localhost22 (password/pre-shared key).
$ nmcli dev wifi connect Hackernet password localhost22
Once connected, verify the connection by ping the external computer and analyzing the ping output as shown.
$ ping 8.8.8.8PING 8.8.8.8 (8.8.8.8) 56(84) bytes of data.64 bytes from 8.8.8.8: icmp_seq=1 ttl=48 time=61.7 ms64 bytes from 8.8.8.8: icmp_seq=2 ttl=48 time=61.5 ms64 bytes from 8.8.8.8: icmp_seq=3 ttl=48 time=61.6 ms64 bytes from 8.8.8.8: icmp_seq=4 ttl=48 time=61.3 ms64 bytes from 8.8.8.8: icmp_seq=5 ttl=48 time=63.9 ms^C--- 8.8.8.8 ping statistics ---5 packets transmitted, 5 received, 0% packet loss, time 4006msrtt min/avg/max/mdev = 61.338/62.047/63.928/0.950 ms
That's it! I hope this article helped you set up your Wi-Fi network from the Linux command line. As always, if you found this article useful, please share your thoughts in the comments section below.
The above is "Linux terminal how to use Nmgli command to connect WiFi" all the content of this article, thank you for reading! I believe that everyone has a certain understanding, hope to share the content to help everyone, if you still want to learn more knowledge, welcome to pay attention to the industry information channel!
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.