如何获得可 ping 通的 IP,但无线接口未关联?

如何获得可 ping 通的 IP,但无线接口未关联?

我一直在基本映像上安装无线网络支持,但遇到了一些非常奇怪的事情。仔细查看 ifconfig 和 iwconfig 的输出。我的路由器有一个有效的 dhcp 分配的 IP,可 ping 通,但无线适配器未关联!昨天,当我执行完全相同的步骤时,它工作正常,没有这种奇怪的情况,但今天它做了一些不同的事情。 wpa_supplicant 发生了一些奇怪的事情。我正在记录我采取的每一步,这样万一我被公共汽车碾过,它就可以重现,但我昨晚可能错过了记录一个步骤;)

这就是我安装 Realterk 无线 USB 支持的方法:

apt-get install firmware-realtek iw crda wireless-regdb wireless-tools wpasupplicant

这是插入适配器后 lsub 的输出:

Bus 001 Device 012: ID 0bda:8178 Realtek Semiconductor Corp. RTL8192CU 802.11n WLAN Adapter

和 dmseg:

[ 1096.600195] usb 1-1.3: new high-speed USB device number 13 using dwc_otg
[ 1096.701786] usb 1-1.3: New USB device found, idVendor=0bda, idProduct=8178
[ 1096.704348] usb 1-1.3: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 1096.706830] usb 1-1.3: Product: 802.11n WLAN Adapter
[ 1096.709223] usb 1-1.3: Manufacturer: Realtek
[ 1096.711575] usb 1-1.3: SerialNumber: 00e04c000001

和 ifconfig:

wlan0     Link encap:Ethernet  HWaddr 00:13:ef:11:00:bf
          inet addr:192.168.10.110  Bcast:192.168.10.255  Mask:255.255.255.0
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:57 overruns:0 frame:0
          TX packets:0 errors:0 dropped:1 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1598 (1.5 KiB)  TX bytes:2224 (2.1 KiB)

和 iwconfig:

wlan0     unassociated  Nickname:"<WIFI@REALTEK>"
          Mode:Managed  Frequency=2.417 GHz  Access Point: Not-Associated
          Sensitivity:0/0
          Retry:off   RTS thr:off   Fragment thr:off
          Encryption key:off
          Power Management:off
          Link Quality:0  Signal level:0  Noise level:0
          Rx invalid nwid:0  Rx invalid crypt:0  Rx invalid frag:0
          Tx excessive retries:0  Invalid misc:0   Missed beacon:0

接口:

auto lo
iface lo inet loopback

auto eth0
iface eth0 inet dhcp

allow-hotplug wlan0
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant/wpa_supplicant_wlan0.conf
metric 10

allow-hotplug wlan1
iface wlan0 inet dhcp
wpa-conf /etc/wpa_supplicant/wpa_supplicant_wlan1.conf
metric 20

wpa_supplicant_wlan0:

ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
country=CA
update_config=1

network={
        ssid="myssid"
        psk="mypassword"
        key_mgmt=WPA-PSK
}

相关内容