Em geral, como depurar problemas aleatórios de desconexão da rede?
Estou trabalhando na placa Intel edison que está conectada à Internet através de um Modem USB Huawei E8231.
Poucos dispositivos perdem a conexão com a Internet e não voltam a ficar on-line, enquanto alguns estão novamente on-line. Para depurar esse problema, dei um patch de depuração no qual estou capturando várias estatísticas da rede enquanto o problema ocorreu.
$ 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
****************************************************************
Eu tenho mais resultados de comandos como netstat -a
e ip link
etc. Se for útil, por favor me avise.
O endereço IP do enp0s17u1u2 (Modem USB) é válido e a configuração parece estar ok. Mas como você pode ver no ping e nslookup rede parece offline. O log do kernel também está mostrando várias mensagens de erro.
Teoricamente, o que poderia ter dado errado?
Qual é a maneira eficiente de depurar esse problema? A partir de agora, estou tentando investigar o log do kernel e ver o que poderia ter dado errado.