我正在使用最新版本的 Kali Linux (2018.4),但遇到以下异常问题。如果我在插入以太网电缆的情况下启动机器,则eth0
接口工作正常。但是,如果我使用 WiFi 启动(未插入电缆),并且在系统正常运行时间超过 30 分钟后尝试插入电缆,则有线连接将失败。
它只是说Wired connecting
然后弹出Activation of network connection failed
。最奇怪的是,它在前 30 分钟内工作成功,然后我必须始终在插入电缆的情况下重新启动机器,以便我可以使用有线连接。
我尝试重置网络管理器:
/etc/init.d/network-manager restart
也将eth0
界面关闭然后打开,但没有运气。有人遇到过这个问题吗?
- Kali 没有在虚拟机中运行;
- 系统信息:
Linux kali 4.19.0-kali1-amd64 #1 SMP Debian 4.19.13-1kali1 (2019-01-03) x86_64 GNU/Linux
网卡信息:
02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 15) 03:00.0 Network controller: Intel Corporation Wireless 3165 (rev 79)
/var/log/syslog
以下是来自.. 的日志条目
当我插入电缆时:
Jan 31 13:07:30 kali kernel: [ 9597.698217] r8169 0000:02:00.0 eth0: Link is Up - 1Gbps/Full - flow control off
Jan 31 13:07:30 kali NetworkManager[15820]: <info> [1548936450.7691] device (eth0): carrier: link connected
一分钟后:
Jan 31 13:08:08 kali dhclient[16601]: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 4
Jan 31 13:08:12 kali dhclient[16601]: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 7
Jan 31 13:08:19 kali dhclient[16601]: DHCPDISCOVER on eth0 to 255.255.255.255 port 67 interval 15
Jan 31 13:08:31 kali NetworkManager[15820]: <info> [1548936511.9965] device (eth0): DHCPv4: grace period expired
Jan 31 13:08:31 kali NetworkManager[15820]: <info> [1548936511.9966] device (eth0): state change: ip-config -> failed (reason 'ip-config-unavailable', sys-iface-state: 'managed')
Jan 31 13:08:31 kali NetworkManager[15820]: <warn> [1548936511.9979] device (eth0): Activation: failed for connection 'Wired connection 1'
Jan 31 13:08:31 kali NetworkManager[15820]: <info> [1548936511.9984] device (eth0): state change: failed -> disconnected (reason 'none', sys-iface-state: 'managed')
Jan 31 13:08:32 kali NetworkManager[15820]: <info> [1548936512.0206] dhcp4 (eth0): canceled DHCP transaction, DHCP client pid 16601
Jan 31 13:08:32 kali NetworkManager[15820]: <info> [1548936512.0206] dhcp4 (eth0): state changed fail -> done
Jan 31 13:08:32 kali NetworkManager[15820]: <info> [1548936512.0219] policy: auto-activating connection 'Wired connection 1' (dfe04dbc-7123-4a36-bf7b-6542c03b6c4c)
Jan 31 13:08:32 kali NetworkManager[15820]: <info> [1548936512.0230] device (eth0): Activation: starting connection 'Wired connection 1' (dfe04dbc-7123-4a36-bf7b-6542c03b6c4c)
Jan 31 13:08:32 kali NetworkManager[15820]: <info> [1548936512.0231] device (eth0): state change: disconnected -> prepare (reason 'none', sys-iface-state: 'managed')
Jan 31 13:08:32 kali NetworkManager[15820]: <info> [1548936512.0235] device (eth0): state change: prepare -> config (reason 'none', sys-iface-state: 'managed')
Jan 31 13:08:32 kali NetworkManager[15820]: <info> [1548936512.0240] device (eth0): state change: config -> ip-config (reason 'none', sys-iface-state: 'managed')
Jan 31 13:08:32 kali NetworkManager[15820]: <info> [1548936512.0242] dhcp4 (eth0): activation: beginning transaction (timeout in 45 seconds)
Jan 31 13:08:32 kali NetworkManager[15820]: <info> [1548936512.0259] dhcp4 (eth0): dhclient started with pid 17015
Jan 31 13:08:32 kali gnome-shell[1118]: Object NM.ActiveConnection (0x55a06d19cc70), has been already finalized. Impossible to get any property from it.
Jan 31 13:08:32 kali org.gnome.Shell.desktop[1118]: == Stack trace for context 0x55a06bb70340 ==
Jan 31 13:08:32 kali org.gnome.Shell.desktop[1118]: #0 0x55a06bf28610 i resource:///org/gnome/shell/ui/status/network.js:2045 (0x7f156c121890 @ 93)
Jan 31 13:08:32 kali org.gnome.Shell.desktop[1118]: #1 0x7ffc37d73840 b resource:///org/gnome/gjs/modules/_legacy.js:82 (0x7f15802b5de0 @ 71)
Jan 31 13:08:32 kali org.gnome.Shell.desktop[1118]: #2 0x55a06bf28580 i resource:///org/gnome/shell/ui/status/network.js:1854 (0x7f156c120e68 @ 138)
Jan 31 13:08:32 kali org.gnome.Shell.desktop[1118]: #3 0x7ffc37d74b80 b resource:///org/gnome/gjs/modules/_legacy.js:82 (0x7f15802b5de0 @ 71)
Jan 31 13:08:32 kali org.gnome.Shell.desktop[1118]: #4 0x7ffc37d75390 b self-hosted:918 (0x7f15802f1230 @ 394)
Jan 31 13:08:32 kali gnome-shell[1118]: Object NM.ActiveConnection (0x55a06d19cc70), has been already finalized. Impossible to get any property from it.
答案1
我不打算将其写为答案,因为它不能直接解决所描述的问题,但我决定应该这样做,以便我可以更轻松地扩展所提供的信息。
r8169
使用Realtek 8168/8111 卡的驱动程序时出现问题。
指南位于https://www.unixblogger.com/how-to-get-your-realtek-rtl8111rtl8168-working-updated-guide/将向您展示如何解决 Debian 和 Ubuntu 的问题,他们在其中写道,
当系统上找不到 r8168 时,会加载 r8169。这将为您提供网络和互联网连接,但是使用 r8169 驱动程序,您的 RTL8168 卡将非常不稳定。_”
本质上,在这些平台上,只需添加non-free
存储库并安装正确的驱动程序即可。一旦存在,r8169 驱动程序将被忽略。
在其他平台(可能包括也可能不包括 Kali)上,您可能必须使用此处描述的手动过程,这几乎是从 Realtek 下载 r8168 驱动程序并在本地构建它。不幸的是,我无法帮助您提供有关 Kali 的精确说明,因为我手头上没有这些说明,但您可能会在 Kali 存储库中找到等效的解决方案。