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