Ubuntu command line connection WPA/WPA2 Wireless network cable

Source: Internet
Author: User

One, connect the wireless network without encryption Zhang:
sudo IP link set wlan0 up
sudo iw dev Wlan0 Connect Zhang
sudo dhclient wlan0

Two, connect WPA/WPA2 encrypted wireless network Zhang
Enter the command Wpa_passphrase Zhang generates the following configuration file, Zhang is the wireless network SSID, enter the password after 12345678:
$ wpa_passphrase Zhang
# reading passphrase from stdin
12345678

network={SSID="Zhang"#psk="12345678" PSK=ffecda21c80fbd09e188f4b0733b0be26286204fc77c8ebbbaf40a1518f4fb12}

Save the output of the above command as a configuration file/etc/wpa_supplicant.conf, assuming that the wireless interface is wlan0, use the following command to test

$ sudo ifconfig wlan0 up
$ wpa_supplicant-i wlan0-c/etc/wap_supplican.conf
$ sudo dhclient wlan0

The-I parameter specifies the wireless network interface, and-c specifies a configuration file that does not leave spaces before the parameter values.
Check to see if the IP has been acquired and the route is normal.
Ifconfig Wlan0
Route-n

Confirm that there is no wireless card on the computer, do not identify the driver, or find a drive-free USB wireless network card
$ iwconfig
Eth0 no wireless extensions.

Wlan0 IEEE 802.11abgn ESSID: "Zhang"
mode:managed frequency:2.427 GHz Access point:10:48:b1:e8:7d:b2
Bit rate=6.5 MB/s tx-power=20 dBm
Retry short Limit:7 RTS thr:off Fragment Thr:off
Power Management:off
Link quality=70/70 Signal level=-28 dBm
Rx Invalid nwid:0 Rx Invalid crypt:0 Rx Invalid frag:0
Tx excessive retries:12 Invalid misc:18 Missed beacon:0

Third, connect WEP encrypted network:
$ sudo iw dev wlan0 connect [network SSID] key 0:[WEP key]

Ubuntu command line connection WPA/WPA2 Wireless network cable

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.