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 configure Wireless Network in Linux

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

Share

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

This article mainly shows you "how to configure a wireless network in Linux". The content is simple and clear. I hope it can help you solve your doubts. Let me lead you to study and learn this article "how to configure a wireless network in Linux".

1. Install wireless_tools and madwifipacman-S wireless_tools madwifi2. Check the status of the network card lsusbBus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hubBus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hubBus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hubBus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hubBus 002 Device 002: ID 093a:2510 Pixart Imaging, Inc. Optical MouseBus 001 Device 003: ID 0cf3:7015 Atheros Communications, Inc.

The network card is detected on the USB interface 001swap 003.

Iwconfiglo no wireless extensions.eth0 no wireless extensions.wlan0 IEEE 802.11bgn ESSID:off/any Mode:Managed Access Point: Not-Associated Tx-Power=0 dBm Retry long limit:7 RTS thr:off Fragment thr:off Encryption key:off Power Management:off

The wireless network card is wlan0

3. Activate the network card ifconfig wlan0 up

Because my network card must be activated before scanning, otherwise there will be an error in the next step of scan: wlan0 Interface doesn't support scanning.

4. Scan the network iwlist wlan0 scanwlan0 Scan completed: Cell 01-Address: 54:E6:FC:22:E1:D2 Channel:1 Frequency:2.412 GHz (Channel 1) Quality=53/70 Signal level=-57 dBm Encryption key:on ESSID: "TP-LINK_22E1D2" Bit Rates:1 Mb/s 2 Mb/s; 5.5 Mb/s; 11 Mb/s; 6 Mb/s 9 Mb/s; 12 Mb/s; 18 Mb/s Bit Rates:24 Mb/s; 36 Mb/s; 48 Mb/s 54 Mb/s Mode:Master Extra:tsf=000000292a41bd80 Extra: Last beacon: 960ms ago IE: Unknown: 000E54502D4C494E4B5F323245314432 IE: Unknown: 010882848B960C121824 IE: Unknown: 030101 IE: IEEE 802.11i/WPA2 Version 1 Group Cipher: CCMP Pairwise Ciphers (1): CCMP Authentication Suites (1): PSK IE: WPA Version 1 Group Cipher: CCMP Pairwise Ciphers (1): CCMP Authentication Suites (1): PSK

It is found that WPA2-PSK/WPA-PSK encrypts network TP-LINK_22E1D2, because the encryption mode is WPA-PSK, so you have to use wpa_supplicant instead of iwconfig wlan0 key xxx form, and iwconfig key mode is suitable for WEP.

5. Configure wpa_supplicant

Create a new file / etc/my_wpa_supplicant.conf

Ctrl_interface=/var/run/wpa_supplicantnetwork= {ssid= "TP-LINK_22E1D2" psk= "password"}

Because they all use the default configuration, the configuration file is very simple.

6. Connect wlan0 to the network and run wpa_supplicant-B-I wlan0-c / etc/my_wpa_supplicant.conf-B Background as daemon. Run-I interface-c configuration file 7. 0 as daemon in the background. Set the IP address ifconfig wlan0 192.168.1.131

Ifconfig View status

Wlan0 Link encap:Ethernet HWaddr 54:E6:FC:03:0D:6B inet addr:192.168.1.131 Bcast:192.168.1.255 Mask:255.255.255.0 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:95 errors:0 dropped:0 overruns:0 frame:0 TX packets:4 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:32434 (31.6Kb) TX bytes:576 (576.0 b) 8. Join the gateway to the route

My gateway is 192.168.1.1, add gateways accessed through wlan0

Route add default gw 192.168.1.1 dev wlan0

View statu

Kernel IP routing tableDestination Gateway Genmask Flags Metric Ref Use Iface192.168.1.0 * 255.255.255.0 U 000 wlan0default 192.168.1.1 0.0.0.0 UG 000 wlan09. Set up.

You only need to run the following command to launch later

Wpa_supplicant-B-I wlan0-c / etc/my_wpa_supplicant.confifconfig wlan0 192.168.1.131route add default gw 192.168.1.1 dev wlan010. Related command

Close the connection

Wpa_cli terminate

Connection statu

Wpa_cli status above is all the contents of this article "how to configure a Wireless Network in 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

Development

Wechat

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

12
Report