ArchLinux Wireless Networking Tutorial

Source: Internet
Author: User

I am a student party, so I do not understand the wired way, the school generally use mentohust with dynamic IP network, or directly connected to WiFi, here are some ways to introduce wireless networking, mainly including public WiFi and with WEP or WPA or WPA2PSK encrypted wifi. , this blog is all about the WiFi connection under console operation.

1 Preparation phase

This blog will introduce four ways to connect WiFi, need to install Iw,wireless_tools (both can choose only one) and wpa_supplicant, of course, the landlord only download the IW and wpa_supplicant.

#pacman-S IW wireless_tools wpa_supplicant

The connection steps for WiFi are:

• To obtain the available wireless card, #ifconfig -A can view the wireless network card via the command, the following assumption is Wlan0

• Interface activation:#ifconfig wlan0 up or #ip link set wlan0 up

• Configure WiFi: use Iw,wireless_tools,wpa_supplicant, etc.

• IP Address assignment:

• Dynamic IP, automatically assigned at this time:#dhcpcd wlan0

• Static IP, required:

#ip addr Add 192.168.0.2/24 dev Wlan0 can also join the broadcast address into the #ip addr add 192.168.0.10/24 broadcast 192.168.0.255 Dev Wlan0

#ip route add default via 192.168.0.1

Where 192.168.0.2 is the IP address, 24 is the subnet mask

• Turn off WiFi

Here are the "Configure WiFi" and "Turn off WiFi".

2 configuring wifi2.1 to connect to a public network and WEP encrypted network

In this case, only the IW or wireless_tools can be used, and the following are their terminal command explanations:

For example, suppose you want to connect a public network named Hit-wlan, just use the command:

#iw Dev wlan0 connect hit-wlan or #iwconfig wlan0 Essid Hit-wlan

For example, to scan nearby hotspots, you can use commands:

#iw dev wlan0 scan or #iwlist wlan0 Scan

2.2 Connecting WPA2PSK or WPA encrypted network

This is the case of most wifi, assuming that the name of the WiFi (that is, Essid) is test, the password is 123456, then the Wpa_supplicant tool comes in handy, in order to configure the following command:

#wpa_passphrase test "123456" >/etc/wpa_supplicant.conf

#wpa_supplicant-B-I wlan0-c/etc/wpa_supplicant.conf

Where-B means running in the background

3 Turn off WiFi

If the dynamic IP address is closed, use the command directly

#ip link Set dev wlan0 down or #ifconfig wlan0 down

If the static IP address, in order to better close, you can use the following command

#ip addr Flush Dev wlp13s1

#ip Route Flush Dev wlp13s1

#ip link Set dev wlan0 down or #ifconfig wlan0 down S

4 So Simple

Here's a simple way to connect to WiFi--------mobile network sharing

Mobile phone Connection WiFi (of course traffic is also OK), with the data cable connected to the computer, turn on the "USB network Sharing" function, the last #dhcpcd can.

What, isn't it simple?

ArchLinux Wireless Networking Tutorial

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.