14.04 服务器无法使用 ifup 连接到 Wifi;wap_supplicant 抛出“ioctl[SIOCSIWENCODEEXT]:无效参数”

14.04 服务器无法使用 ifup 连接到 Wifi;wap_supplicant 抛出“ioctl[SIOCSIWENCODEEXT]:无效参数”

我将 14.04 家庭服务器搬到了新公寓,新公寓只能通过 Wifi 访问互联网。这台机器以前有 12.04 的桌面版本,可以通过 Wifi 正常连接network-manager(所以我认为硬件和驱动程序没问题),但我不需要 GUI 或network-manager在此安装上;我希望它作为 ssh、nfs 的无头服务器运行,并作为网络主机运行,等等。在我安装 14.04 服务器之后,但在我搬家之前,它可以正常连接到我旧公寓的 LAN。但我无法通过 Wifi 连接它。

我尝试配置/etc/network/interfaces为已完成这里,但无济于事。这是我的配置:

auto lo
iface lo inet loopback

auto wlan0
iface wlan0 inet static
    address 192.168.1.151
    netmask 255.255.255.0
    gateway 192.168.1.1
    wpa-ssid "my ssid"
    wpa-psk <passphrase>
    dns-nameservers 8.8.8.8 8.8.4.4

当我运行时ifdown wlan0 && ifup -v wlan0,我得到:

Configuring interface wlan0=wlan0 (inet)
run-parts --verbose /etc/network/if-pre-up.d
run-parts: executing /etc/network/if-pre-up.d/ethtool
run-parts: executing /etc/network/if-pre-up.d/wireless-tools
run-parts: executing /etc/network/if-pre-up.d/wpasupplicant
wpa_supplicant: wpa-driver nl80211,wext (default)
wpa_supplicant: /sbin/wpa_supplicant -s -B -P /var/run/wpa_supplicant.wlan0.pid -i wlan0 -D nl80211,wext -C /var/run/wpa_supplicant
Starting /sbin/wpa_supplicant...
wpa_supplicant: waiting for "var/run/wpa_supplicant.wlan0.pid": 0 (max. 5)
wpa_supplicant: creating sendsigs omission pidfile: /run/sendsigs.omit.d/wpasupplicant.wpa_supplicant.wlan0.pid
wpa_supplicant: ctrl_interface socket located at /var/run/wpa_supplicant/wlan0
wpa_supplicant: configuring network block -- 0
wpa_supplicant: wpa-ssid "my ssid" -- OK
wpa_supplicant: wpa-psk ***** -- OK
wpa_supplicant: enabling network block 0 -- OK
ip addr add 192.168.1.1/255.255.255.0 broadcast 192.168.1.255        dev wlan0 label wlan0
ip link set dev wlan0   up
  ip route add default via 192.168.1.1   dev wlan0
run-parts --verbose /etc/network/if-up.d
run-parts: excuting /etc/network/if-up.d/000resolvconf
run-parts: excuting /etc/network/if-up.d/bind9
run-parts: excuting /etc/network/if-up.d/ethtool
run-parts: excuting /etc/network/if-up.d/ntpdate
run-parts: excuting /etc/network/if-up.d/openssh-server
run-parts: excuting /etc/network/if-up.d/upstart
run-parts: excuting /etc/network/if-up.d/wpa-supplicant

看起来不错,但如果我尝试 ping 192.168.1.1,我会得到

PING 192.168.1.1 (192.168.1.1) 56(84) bytes of data.
From 192.168.1.151 icmp_seq=1 Destination Host Unreachable

--- 192.168.1.1 ping statistics ---
1 packets transmitted, 0 received, +1 errors, 100% packet loss, time 0ms 

如果我 ping google.com,我得到的只是unknown host

我尝试使用 wpa_supplicant 进行类似配置这个帖子,并得到了同样的ioctl[SIOCSIWENCODEEXT]: Invalid argument错误。我的/etc/wpa_supplicant.conf完整解读如下:

network={
    ssid="my ssid"
    #psk="<passphrase>"
    psk=<hexdump>
}

在写这个问题的过程中,我意识到如果我标记nl80211驱动程序而不是wext,我就不会再收到错误,但我仍然无法 ping 我的路由器或 Google。当我运行 iwconfig 时,我得到:

wlan0    IEEE 802.11bgn  ESSID:off/any
         Mode:Managed  Frequency:2.417 GHz Access Point: Not-Associated
         Tx-Power=20 dBm
         Retry short limit:7   RTS thr=2347 B   Fragment thr:off
         Encryption key:off
         Power Management:on

我的网卡是 Realtek 的 RTL8191SEvB PCI 卡,driver=rtl8192se

我越是排查问题,问题就越不明朗。我就是不知道问题出在哪里。

有什么建议么?

相关内容