我是网络和 Linux 的新手。我现在尝试在 Ubuntu 8.10 上通过命令行连接到 WEP 无线网络,因为网络管理器不支持 64 位 WEP。
(1) 我先关闭网络管理器,然后尝试连接无线网络,其 essid 为 candy,密码为 5673212741。但失败了,如下所示。信号不是很强,但我可以在 Windows 7 中连接到它。我想知道为什么以及如何在 Ubuntu 上正确执行此操作?
$ sudo /etc/init.d/NetworkManager stop
* Stopping network connection manager NetworkManager [ OK ]
$ sudo iwconfig wlan0 essid candy
opendo iwconfig wlan0 key 18018ce78e open
$ sudo iwconfig wlan0 key 5673212741 open
$ sudo dhclient wlan0
There is already a pid file /var/run/dhclient.pid with pid 9971
killed old client process, removed PID file
Internet Systems Consortium DHCP Client V3.1.1
Copyright 2004-2008 Internet Systems Consortium.
All rights reserved.
For info, please visit http://www.isc.org/sw/dhcp/
wmaster0: unknown hardware address type 801
wmaster0: unknown hardware address type 801
Listening on LPF/wlan0/00:0e:9b:cd:4e:18
Sending on LPF/wlan0/00:0e:9b:cd:4e:18
Sending on Socket/fallback
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 7
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 12
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 20
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 13
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 9
No DHCPOFFERS received.
No working leases in persistent database - sleeping.
$ ping www.bbc.co.uk
ping: unknown host www.bbc.co.uk
(2)一个不太重要的问题:为什么我关闭网络管理器后无线网络扫描不起作用?
$ sudo /etc/init.d/NetworkManager stop
* Stopping network connection manager NetworkManager [ OK ]
$ sudo iwlist wlan0 scan
wlan0 Interface doesn't support scanning : Network is down
感谢致敬!
答案1
sudo /sbin/ifconfig wlan0 up
sudo /sbin/iwlist wlan0 scan
sudo /sbin/iwconfig wlan0 essid "candy"
sudo /sbin/iwconfig wlan0 key 4104672851
sudo /sbin/iwconfig wlan0 enc on
然后检查使用sudo /sbin/iwconfig wlan0
以确保它看起来已配置,然后sudo dhclient wlan0
2) 扫描失败,因为关闭网络管理器会导致接口wlan0
关闭。sudo /sbin/ifconfig wlan0 up
将重新启用扫描。