1.检索区域内的无线网络
sorc@sorc-U:~$ sudo iwconfig wlan0
wlan0 IEEE 802.11g ESSID:"TP-LINK" Nickname:""
Mode:Managed Frequency:2.437 GHz Access Point: 00:1D:0F:4D:8B:E4
Bit Rate:36 Mb/s Tx-Power:18 dBm Sensitivity=1/1
Retry:off RTS thr:off Fragment thr:off
Power Management:off
Link Quality=26/70 Signal level=-69 dBm Noise level=-95 dBm
Rx invalid nwid:8268 Rx invalid crypt:0 Rx invalid frag:0
Tx excessive retries:0 Invalid misc:0 Missed beacon:0
2.连接网络
注意:如果连接AP需要密码,而你确实也知道AP的密码,那么可以用下面的办法连接
假设密码是 123456789,密码需要四位一组用”-“分开
sorc@sorc-U:~$ sudo iwconfig wlan0 essid "TP-LINK" key 1234-5678-9
3.设置无线网卡采用dhcp方式自动获取ip
sorc@sorc-U:~$ sudo dhclient wlan0
Internet Systems Consortium DHCP Client V3.0.6
Copyright 2004-2007 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/
wifi0: unknown hardware address type 801
wifi0: unknown hardware address type 801
Listening on LPF/ath0/00:19:e0:85:73:70
Sending on LPF/ath0/00:19:e0:85:73:70
Sending on Socket/fallback
DHCPDISCOVER on ath0 to 255.255.255.255 port 67 interval 6
DHCPOFFER of 192.168.1.104 from 192.168.1.1
DHCPREQUEST of 192.168.1.104 on ath0 to 255.255.255.255 port 67
DHCPACK of 192.168.1.104 from 192.168.1.1
bound to 192.168.1.104 -- renewal in 3125 seconds.
现在就可以拔掉网线,使用无线网卡上网了。
4.断开网络
如果需要断开网络,可以使用下面的命令
[email=sorc@sorc-U:~$]sorc@sorc-U:~$[/email] sudo ifconfig ath0 down
5.ADSL无线猫上网的办法:从第2步开始终端输输入 sudo pppoeconf回车,跟着提示,输入上网的用户名、密码一路回车。
附:命令
sudo pon dsl-provider 打开连接
sudo poff 关闭连接