NCSI(网络连接状态指示器)问题故障排除通常使用数据包捕获数据执行,但 NCSI 事件日志在与数据包流量关联时也是一个有用的工具。 本指南旨在帮助用户如何从常见场景中诊断 NCSI 问题。
使用 Event Viewer 查看 NCSI 数据
要打开 Event Viewer,请右键单击 Start>Event Viewer。
或者,通过按 Win+R 并键入 eventviewer.exe打开 Run 提示符。右键单击 NCSI 文件夹下的 Analytic,选择 Enable Log。
此时将显示一个对话框,通知您在启用日志记录时可能会丢失分析和调试日志事件。 选择 Ok (确定 ) 以继续。
使用事件查看器检索 NCSI 数据
执行上述作将有助于数据检索。 为了便于分析,请将生成的日志转换为文本格式。 在 Event Viewer 中,请执行以下步骤:
展开Microsoft>Windows>NCSI应用程序和服务日志>。
“Save As(另存为)”对话框打开。 将“存储类型”设置为文本 (*.txt),为您的文件命名并选择您的位置。 选择“保存”。
以下是成功连接输出的示例:
Information 4/26/2023 12:17:46 PM Microsoft-Windows-NCSI 4013 Internet Connectivity Detection Active Internet Probe started on interface {611346db-8fbb-473d-808b-6c7573b3ef4d}
Information 4/26/2023 12:17:46 PM Microsoft-Windows-NCSI 4017 Internet Connectivity Detection Active Internet Probe (HTTP) started on interface {611346db-8fbb-473d-808b-6c7573b3ef4d}
Information 4/26/2023 12:17:48 PM Microsoft-Windows-NCSI 4005 Wait for Internet Connectivity Entered State: Internet Connectivity Interface Luid: 0x6008001000000
Information 4/26/2023 12:18:07 PM Microsoft-Windows-NCSI 4018 Internet Connectivity Detection Active Internet Probe (HTTP) finished on interface {611346db-8fbb-473d-808b-6c7573b3ef4d}
Information 4/26/2023 12:18:07 PM Microsoft-Windows-NCSI 4014 Internet Connectivity Detection Active Internet Probe finished on interface {611346db-8fbb-473d-808b-6c7573b3ef4d} (false)
下面是连接失败输出的示例:
Information 4/26/2023 12:01:02 PM Microsoft-Windows-NCSI 4013 Internet Connectivity Detection Active Internet Probe started on interface {611346db-8fbb-473d-808b-6c7573b3ef4d}
Information 4/26/2023 12:01:02 PM Microsoft-Windows-NCSI 4017 Internet Connectivity Detection Active Internet Probe (HTTP) started on interface {611346db-8fbb-473d-808b-6c7573b3ef4d}
Information 4/26/2023 12:01:04 PM Microsoft-Windows-NCSI 4005 Wait for Internet Connectivity Entered State: Local Connectivity Interface Luid: 0x6008001000000
Information 4/26/2023 12:03:23 PM Microsoft-Windows-NCSI 4018 Internet Connectivity Detection Active Internet Probe (HTTP) finished on interface {611346db-8fbb-473d-808b-6c7573b3ef4d}
Warning 4/26/2023 12:03:23 PM Microsoft-Windows-NCSI 4051 None Active probe result code on interface {611346db-8fbb-473d-808b-6c7573b3ef4d} (0x6008001000000 Family: V4) = 12007
将 分析 性 NCSI 事件和 作 性 NCSI 事件与数据包捕获时间戳相关联,以确定活动探测是否已触发、是否完成以及失败的原因。 要了解有关 Winhttp 错误代码的更多信息,请参阅错误消息 (Winhttp.h)。
如何重现问题场景
您可以通过强制活动探测查看问题是否完成来解决问题。 执行此作的最简单方法是引发网络更改事件。 下面演示了有线和无线连接上的这一点:
有线
- 断开以太网电缆。 (或者,您可以在 Advanced network settings (高级网络设置) 中禁用网络适配器。
- 使用数据包捕获软件(如 wireshark),并等待 30 秒以收集数据。
- 重新连接以太网电缆。 (或者,如果之前禁用了网络适配器,请在高级网络设置中启用网络适配器)。
- 等待 60 秒,然后再停止捕获,以确保有足够的时间尝试主动探测。
无线电
- 在连接之前启动数据包捕获。
- 连接到无线网络。
- 等待 60 秒,确保活动探测活动已完全完成。
- 停止网络捕获。