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
- Auto Lo
- 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
- Auto Eth0
- 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
- Address XX
- Gateway XX
- netmask XX
- Auto Wlan0
- 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
- 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
- Error for wireless Request "Set Encode" (8B2A):
- 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
- #wpa_passphrase ESSID PWD > Xxx.conf
- #wpa_supplicant-B-i wlan0-dwext-c./xxx.conf
- #iwconfig Wlan0
- #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