我有一个Raspberry Pi
运行在Raspbain Linux
.该设备运行良好,wlan0
但从最近几天开始,它变得离线(与网络断开连接)。我想查看一些日志并发现其中包含一些有关网络连接 wlan0 的有用信息的daemon.log
文件。/var/log/
我这样做了cat daemon.log | grep wlan0
,它显示了所有日志。
我试图理解所有日志并了解基本概念,但只是想更多地了解日志,因为很少有术语无法理解。
Apr 9 04:59:33 device dhcpcd[332]: wlan0: carrier acquired
Apr 9 04:59:33 device dhcpcd[332]: wlan0: adding address fe80::bac5:f37d:9bb4:65df
Apr 9 04:59:33 device dhcpcd[332]: wlan0: IAID eb:d3:4c:54
Apr 9 04:59:34 device dhcpcd[332]: wlan0: soliciting a DHCP lease
Apr 9 04:59:34 device dhcpcd[332]: wlan0: offered 192.168.0.57 from 192.168.0.1
Apr 9 04:59:34 device dhcpcd[332]: wlan0: soliciting an IPv6 router
Apr 9 04:59:34 device dhcpcd[332]: wlan0: probing address 192.168.0.57/24
Apr 9 04:59:35 device avahi-daemon[325]: Joining mDNS multicast group on interface wlan0.IPv6 with address fe80::bac5:f37d:9bb4:65df.
Apr 9 04:59:35 device avahi-daemon[325]: New relevant interface wlan0.IPv6 for mDNS.
Apr 9 04:59:35 device avahi-daemon[325]: Registering new address record for fe80::bac5:f37d:9bb4:65df on wlan0. *.
Apr 9 04:59:38 device dhcpcd[332]: wlan0: leased 192.168.0.57 for 86400 seconds
Apr 9 04:59:38 device avahi-daemon[325]: Joining mDNS multicast group on interface wlan0.IPv4 with address 192.168.0.57.
Apr 9 04:59:38 device avahi-daemon[325]: New relevant interface wlan0.IPv4 for mDNS.
Apr 9 04:59:39 device avahi-daemon[325]: Registering new address record for 192.168.0.57 on wlan0.IPv4.
Apr 9 04:59:39 device dhcpcd[332]: wlan0: adding route to 192.168.0.0/24
Apr 9 04:59:39 device dhcpcd[332]: wlan0: adding default route via 192.168.0.1
Apr 9 04:59:39 device dhcpcd[332]: wlan0: removing route to 192.168.0.0/24
Apr 9 04:59:47 device dhcpcd[332]: wlan0: no IPv6 Routers available
Apr 9 05:15:49 device dhcpcd[332]: wlan0: carrier lost
Apr 9 05:15:49 device dhcpcd[332]: wlan0: deleting address fe80::bac5:f37d:9bb4:65df
Apr 9 05:15:49 device avahi-daemon[325]: Withdrawing address record for fe80::bac5:f37d:9bb4:65df on wlan0.
Apr 9 05:15:49 device avahi-daemon[325]: Leaving mDNS multicast group on interface wlan0.IPv6 with address fe80::bac5:f37d:9bb4:65df.
Apr 9 05:15:49 device avahi-daemon[325]: Interface wlan0.IPv6 no longer relevant for mDNS.
Apr 9 05:15:49 device dhcpcd[332]: wlan0: deleting default route via 192.168.0.1
Apr 9 05:15:49 device avahi-daemon[325]: Withdrawing address record for 192.168.0.57 on wlan0.
Apr 9 05:15:49 device avahi-daemon[325]: Leaving mDNS multicast group on interface wlan0.IPv4 with address 192.168.0.57.
Apr 9 05:15:49 device avahi-daemon[325]: Interface wlan0.IPv4 no longer relevant for mDNS.
上面,它说运营商已获得并由192.168.0.57
路由器(192.168.0.1)提供。它尝试连接该 IP,并租用了 86400 秒(24 小时)。但在此之后,当它说wlan0: adding route to 192.168.0.0/24
。这是什么意思。?
我无法理解它到底发生了什么。谁能向我解释一下吗?
谢谢
答案1
非常快速的概述:
dhcpd
把手动态主机配置协议 (DHCP)响应,换句话说,是家庭路由器分配给您的计算机的 IP 地址。此分配(“租用”)有一个持续时间(“24 小时”)。
avahi-daemon
把手Zeroconf/Bonjour消息,换句话说,有关家庭网络中本地设备的信息,尤其是 Apple 设备(或使用此协议的其他设备)。
该adding route
消息与网络范围一起意味着,在您通过 DHCP 获得 IP 地址后,您的网络设置已意识到所有这些地址(在您的示例中,略微简化为 192.168.0.0-192.168.0.255)现在都可以通过 访问。这通常通过执行或类似命令wlan0
来完成。尝试以 root 身份查看您当前的路由。ip route add ...
ip route show
通过谷歌搜索,您可以轻松找到更多信息和网络介绍。
这些都无助于调试连接问题。看看dmesg
or的输出/var/log/syslog*
。