![解决随机网络断开问题(USB 调制解调器)](https://linux22.com/image/702626/%E8%A7%A3%E5%86%B3%E9%9A%8F%E6%9C%BA%E7%BD%91%E7%BB%9C%E6%96%AD%E5%BC%80%E9%97%AE%E9%A2%98%EF%BC%88USB%20%E8%B0%83%E5%88%B6%E8%A7%A3%E8%B0%83%E5%99%A8%EF%BC%89.png)
一般来说如何调试随机网络断开问题?
我正在研究通过华为 E8231 USB 调制解调器连接到互联网的英特尔 Edison 开发板。
少数设备会断开互联网连接并无法重新上线,而有些设备会成功重新上线。为了调试此问题,我提供了一个调试补丁,用于在问题发生时捕获各种网络统计数据。
$ ifconfig
enp0s17u1u2 Link encap:Ethernet HWaddr 00:1e:10:1f:00:00
inet addr:192.168.8.100 Bcast:192.168.8.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:107217 errors:0 dropped:0 overruns:0 frame:0
TX packets:52028 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:39624632 (37.7 MiB) TX bytes:5768765 (5.5 MiB)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
inet6 addr: ::1/128 Scope:Host
UP LOOPBACK RUNNING MTU:65536 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
usb0 Link encap:Ethernet HWaddr 02:00:86:21:4e:59
inet addr:192.168.2.15 Bcast:192.168.2.255 Mask:255.255.255.0
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)
wlan0 Link encap:Ethernet HWaddr 90:b6:86:12:f0:c7
inet6 addr: fe80::92b6:86ff:fe12:f0c7/64 Scope:Link
UP BROADCAST MULTICAST MTU:1500 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:92 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:0 (0.0 B) TX bytes:12620 (12.3 KiB)
#****************************************************************
$ nslookup google.com
Server: 192.168.8.1
Address 1: 192.168.8.1 www.huaweimobilewifi.com
nslookup: can't resolve 'google.com'
#****************************************************************
$ ping -c 3 google.com
ping: bad address 'google.com'
#****************************************************************
$ dmesg | tail -n 50
[197732.658894] dhd_set_mcast_list_handler: interface info not available/down
[197732.658983] wl_android_wifi_off in
[197732.660509] wifi_platform_set_power = 0
[197732.716350] device wlan0 left promiscuous mode
[197733.116206]
Dongle Host Driver, version 1.141.59 (r)
Compiled in /media/sandeepmvd/linux_drive/edison-yocto/out/linux64/build/tmp/work/edison-poky-linux/bcm43340-mod/1.141-r47/git on Feb 22 2017 at 11:24:04
[197733.116243] wl_android_wifi_on in
[197733.116261] wifi_platform_set_power = 1
[197733.724103] F1 signature OK, socitype:0x1 chip:0xa94c rev:0x2 pkg:0x0
[197733.725470] DHD: dongle ram size is set to 524288(orig 524288) at 0x0
[197733.727419] dhdsdio_download_firmware: firmware path=/etc/firmware/fw_bcmdhd.bin, nvram path=/etc/firmware/bcmdhd.cal
[197733.845657] sdioh_request_buffer: [1] doing memory copy buf=f5366000, len=18
[197733.849030] dhdsdio_write_vars: Download, Upload and compare of NVRAM succeeded.
[197734.009887] dhd_bus_init: enable 0x06, ready 0x06 (waited 0us)
[197734.014685] wifi_platform_get_mac_addr
[197734.014732] wifi_get_mac_addr_intel: unable to open /config/wifi/mac.txt
[197734.018695] Firmware up: op_mode=0x0015, MAC=90:b6:86:12:f0:c7
[197734.034984] Firmware version = wl0: Jan 30 2015 19:22:32 version 6.20.190.3 (r530911) FWID 01-5b07cccc
[197734.035928] dhd_preinit_ioctls wl ampdu_hostreorder failed -23
[197734.120044] CFG80211-ERROR) wl_update_wiphybands : bw_cap failed, -23
[197734.234065] CFGP2P-ERROR) wl_cfgp2p_add_p2p_disc_if : P2P interface registered
[197734.249486] WLC_E_IF: NO_IF set, event Ignored
[197744.296897] device wlan0 entered promiscuous mode
[198933.023104] WLC_E_IF: NO_IF set, event Ignored
[198933.023386] CFGP2P-ERROR) wl_cfgp2p_del_p2p_disc_if : P2P interface unregistered
[198933.268082] dhd_set_mcast_list_handler: interface info not available/down
[198933.268114] dhd_set_mcast_list_handler: interface info not available/down
[198933.268189] wl_android_wifi_off in
[198933.269409] wifi_platform_set_power = 0
[198933.294220] device wlan0 left promiscuous mode
[198933.812836]
Dongle Host Driver, version 1.141.59 (r)
Compiled in /media/sandeepmvd/linux_drive/edison-yocto/out/linux64/build/tmp/work/edison-poky-linux/bcm43340-mod/1.141-r47/git on Feb 22 2017 at 11:24:04
[198933.812870] wl_android_wifi_on in
[198933.812890] wifi_platform_set_power = 1
[198934.429420] F1 signature OK, socitype:0x1 chip:0xa94c rev:0x2 pkg:0x0
[198934.430864] DHD: dongle ram size is set to 524288(orig 524288) at 0x0
[198934.433010] dhdsdio_download_firmware: firmware path=/etc/firmware/fw_bcmdhd.bin, nvram path=/etc/firmware/bcmdhd.cal
[198934.546915] sdioh_request_buffer: [1] doing memory copy buf=f3636000, len=18
[198934.550366] dhdsdio_write_vars: Download, Upload and compare of NVRAM succeeded.
[198934.710449] dhd_bus_init: enable 0x06, ready 0x06 (waited 0us)
[198934.715341] wifi_platform_get_mac_addr
[198934.715393] wifi_get_mac_addr_intel: unable to open /config/wifi/mac.txt
[198934.719283] Firmware up: op_mode=0x0015, MAC=90:b6:86:12:f0:c7
[198934.737387] Firmware version = wl0: Jan 30 2015 19:22:32 version 6.20.190.3 (r530911) FWID 01-5b07cccc
[198934.738325] dhd_preinit_ioctls wl ampdu_hostreorder failed -23
[198934.824669] CFG80211-ERROR) wl_update_wiphybands : bw_cap failed, -23
[198934.942135] CFGP2P-ERROR) wl_cfgp2p_add_p2p_disc_if : P2P interface registered
[198934.961280] WLC_E_IF: NO_IF set, event Ignored
我有更多来自诸如等命令的输出netstat -a
。ip link
如果有帮助,请告诉我。
enp0s17u1u2(USB 调制解调器)的 IP 地址有效,配置似乎没问题。但正如您所见,ping
网络nslookup
似乎处于离线状态。内核日志也显示了一堆错误消息。
从理论上来说,可能出了什么问题?
调试此问题的有效方法是什么?截至目前,我正在尝试查看内核日志并查看可能出了什么问题。