我正在尝试为我们的无线网络配置我们的一台服务器。我刚刚安装了 Ubuntu Server 14.04,并且正在使用 USB 无线适配器。我已经运行lsusb
,我可以看到设备,我也运行了sudo iwlist wlan0 scan
(运行后sudo ifconfig wlan0 up
启动无线接口),我可以看到我想要连接的网络列在那里。但是,使用我的配置我无法获得连接(使用静态或 DHCP)。我只是最初尝试使用 DHCP IP,因为它看起来更简单,然后我想配置一个静态 IP。似乎它甚至没有连接到网关:
ping 192.168.11.1
connect: Network is unreachable
如果我在已配置的笔记本电脑上执行此操作,它会回复收到的字节等(尽管笔记本电脑似乎没有在相同的文件中配置 wlan0)。在这个阶段我可以运行什么来评估故障可能在哪里?这是我第一次尝试手动配置无线连接,所以不太确定接下来要用什么工具进行诊断。
无论如何,下面是我的新服务器的 /etc/network/interfaces:
auto lo
2 iface lo inet loopback
auto wlan0
iface wlan0 inet dhcp
wpa-ssid tobunerima
wpa-psk local
(这是明文密码)
更新 1
$ sudo ip ad
ip link show
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
valid_lft forever preferred_lft forever
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST> mtu 1500 noop state DOWN group default qlen 1000
link/ether 00:1d:09:14:8f:52 brd ff:ff:ff:ff:ff:ff
3: wlan0: <NO-CARRIER,BROADCAST,MULTICAST,UP> mtu 1500 qdisc mq state DOWN group default qlen 1000
link/ether cc:e1:d5:3f:a5:bd brd ff:ff:ff:ff:ff:ff
当我跑步时sudo ip ro
什么也没有:
$ sudo ip ro
$
更新2
以下是输出sudo iwconfig wlan0
wlan0 IEEE 802.11bgn ESSID:off/any
Mode:Managed Access Point: Not-Associated Tx-Power=20 dBm
Retry short limit:7 RTS thr:off Fragment thr:off
Encryption key:off
Power Management:off
更新 3
输出sudo ifup wlan0
:
wpa_supplicant: WARNING: plaintext or ascii WPA key has 3 characters,
wpa_supplicant: it must have between 8 and 63 to be valid.
wpa_supplicant: If the WPA key is a 256-bit hexadecimal key, it must have
wpa_supplicant: exactly 64 characters.
Internet Systems Consortium DHCP Client V3.1.3
Copyright 2004-2009 Internet Systems Consortium.
All rights reserved.
For info, please visit https://www.isc.org/software/dhcp/
Listening on LPF/wlan0/00:1d:e0:a6:30:2f
Sending on LPF/wlan0/00:1d:e0:a6:30:2f
Sending on Socket/fallback
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 3
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 6
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 10
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 20
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 15
DHCPDISCOVER on wlan0 to 255.255.255.255 port 67 interval 7
.
.
.
No DHCPOFFERS received
No working leases in persistent database - sleeping.