Ubuntu command line Configuration wireless network

Source: Internet
Author: User

Early in the morning to find Ubuntu network problems, unable to surf the internet, the network icon in the upper-right corner of the exclamation mark, networking disabled, has been good, did not find out why

Ifconfig-a found Nic looks normal

Cat/etc/network/interfaces problem comes out, only the following two lines

[HTML]View PlainCopy
    1. Auto Lo
    2. Iface Lo inet Loopback

The configuration of eth0 and Wlan0 is gone!

At that time forgot to view the change record, so inexplicably tampered with, checked the online statement, add the following configuration

[HTML]View PlainCopy
    1. Auto Eth0
    2. Ifcace eth0 inet Static//school network requirements is to configure the static IP, if it is a dynamic acquisition of the IP below the line is not required, changed to Iface eth0 inet DHCP can be
    3. Address XX
    4. Gateway XX
    5. netmask XX
    6. Auto Wlan0
    7. Iface Wlan0 inet DHCP


At the same time, the DNS of the wired network is missing, adding DNS in/etc/resolv.conf

[HTML]View PlainCopy
    1. NameServer XX


Restart the network/etc/init.d/newworking restart

In this way, the wired network is ready to use

But I usually use the wireless network, there is no graphical interface how to connect to the wireless network?

The first step;

Turn on the wireless card: ifconfig wlan0 up

Scan wireless network: iwlist wlan0 scanning

Select the wireless AP name that you want to connect to, and I want to name "Ubuntu".

Part II:

Wireless network connection: Iwconfig wlan0 essid ubuntu key 12345lenovo

Essid behind is the wireless network name to be connected, key indicates the access password of the network

A problem has been encountered:

[HTML]View PlainCopy
    1. Error for wireless Request "Set Encode" (8B2A):
    2. SET failed on device wlan0; Invalid argument.



Did not find 8B2A representative of the problem, in order to exclude me from the problem, so I try to connect CMCC:

Iwconfig Wlan0 Essid cmcc-edu

It worked! With my no line by the only difference is that CMCC access does not require a password, the problem must be out of the key here

Search Ubuntu wireless WPA iwconfig key keywords, and really let me search

The reason is that Ubuntu does not have enough support for WPA encryption and requires additional configuration, using the Wpa_passphrase software, the Ubuntu system has

[HTML]View PlainCopy
    1. #wpa_passphrase ESSID PWD > Xxx.conf
    2. #wpa_supplicant-B-i wlan0-dwext-c./xxx.conf
    3. #iwconfig Wlan0
    4. #dhclient Wlan0

At this point, the wireless network connection is successful!

After reboot, you need to configure again, can be configured as a script, but also more convenient

Transferred from: http://blog.csdn.net/judwenwen2009/article/details/17026389

Ubuntu command line Configuration wireless network

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.