Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to set up WiFi network in Arch Linux terminal

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

Editor to share with you how to set up the WiFi network in the Arch Linux terminal, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

If you are using another Linux distribution instead of Arch CLI, you may not be used to setting up WiFi in your terminal. Although the whole process is a little simple, I still want to talk about it. In, I will lead the novice through the step-by-step setup wizard to connect your Arch Linux to your WiFi network.

There are many programs in Linux to set up wireless connections, and we can use ip and iw to configure Internet connections, but it's a bit complicated for beginners. So we will use the netctl command, which is a command-line-based tool for setting up and managing network connections through configuration files.

Note: all settings require root permissions, or you can use the sudo command to do so.

Search the network

Run the following command to view your network interface:

Iwconfig

Run the following command to enable your network interface, if not:

Ip link set interface up

Run the following command to search for available WiFi networks. You can turn down the page to see.

Iwlist interface scan | less

Note: the interface in the command is the actual network interface previously obtained with iwconfig.

After scanning, if you do not use this API, you can run the following command to shut down:

Ip link set interface down

Use netctl to configure Wi-Fi:

Before using netctl to set up a connection, you must check the compatibility of your network card under Linux.

Run the command:

Lspci-k

This command is used to check whether the kernel has loaded your wireless network card driver. The output must look like this:

If the kernel does not load the driver, you must use a wired connection to install it. Here is the official wiki page of Linux Wireless Network: https://wireless.wiki.kernel.org/.

If your wireless card is compatible with Linux, you can use netctl configuration.

Netctl uses a configuration file, which is a file that contains connection information. There are both simple and difficult ways to create this file.

Simple way-Wifi-menu

If you want to use wifi-menu, you must install dialog.

1. Run the command: wifi-menu

two。 Choose your network

Wifi-menu to setup wifi in arch

3. Enter the correct password and wait

Wifi-menu setup wifi password in arch

If there is no connection failure message, you can confirm it with the following command:

Ping-c 3 www.google.com

Wow! If you see that you are ping, it means that the network setup is successful. You are now connected to WiFi under Arch Linux. If you have any questions, you can go back and start all over again. Maybe there's something missing.

Difficult way

This approach is a little more difficult than the wifi-menu command above, so I call it the difficult way. In the above command, the network configuration is generated automatically. In a difficult way, we will modify the configuration file manually. But don't worry, it's not that hard. Then let's get started!

1. First of all, you have to know the name of the network interface, usually wlan0 or wlp2s0, but there are many exceptions. To confirm your own network interface, enter the iwconfig command and write it down.

Scan wifi networks in arch linux cli

two。 Run the command:

Cd / etc/netctl/examples

There are many examples of different configuration files in this directory.

3. Copy the example configuration file that will be used to / etc/netctl/your_profile

Cp / etc/netctl/examples/wireless-wpa / etc/netctl/your_profile

4. You can use this command to view the contents of the configuration file: cat / etc/netctl/your_profile

View network profile in arch linux

5. Use vi or nano to edit the following parts of your configuration file:

Nano / etc/netctl/your_profile

-`Interface`: for example, `wlan0`

-`ESSID`: your wireless network name

-`key`: your wireless network password

Note:

If you don't know how to use nano, open the file, edit the place you want to modify, press ctrl+o, then press enter, and then press ctrl+x.

Edit network profile in arch

Run netctl

1. Run the command:

Cd / etc/netctlls

You will definitely see the configuration files generated by wifi-menu, such as wlan0-SSID;, or if you choose the difficult way, you will definitely see the configuration files you have created.

two。 Run the command to start the connection configuration: netctl start your_profile.

3. Test the connection with the following command:

Ping-c 3 www.google.com

The output looks like this:

Check internet connection in arch linux

4. *, you must run the following command: netctl enable your_profile.

Netctl enable your_profile

This will create and activate a systemd service, and then start it automatically when you power on. And cheer! You have configured the wifi network in your Arch Linux.

Other tools

You can also use other programs to set up a wireless connection:

Iw:

Iw dev wlan0 link-statu

Iw dev wlan0 scan-search the network

Iw dev wlan0 connect your_essid-Connect to an open network

Iw dev wlan0 connect your_essid key your_key-Connect to a WEP encrypted network using a hexadecimal key

Wpa_supplicant

Https://wiki.archlinux.org/index.php/WPA_supplicant

Wicd

Https://wiki.archlinux.org/index.php/wicd

NetworkManager

Https://wiki.archlinux.org/index.php/NetworkManager

The above is all the contents of the article "how to set up the WiFi network in the terminal of Arch Linux". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow 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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report