> For the complete documentation index, see [llms.txt](https://docs.verge.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.verge.io/run-the-platform/zh/wang-luo/net-troubleshooting.md).

# 网络故障排除

此页面包含常见的网络测试/故障排除步骤。

## VM 内的 Ping 测试（测试网络连通性/DNS）

1. **ping `google.com`**
   * Ping 回复表示已连接到互联网；如果报告了问题，请收集更详细的信息，例如无法访问的具体站点，以便进一步排查。
   * 如果没有 Ping 回复：继续进行下一个 Ping 测试。
2. **ping 8.8.8.8**
   * Ping 回复表示已连接到互联网。如果这里有回复，但上面的测试（google.com）没有回复，请检查 [DNS](#dns).
   * 如果没有 Ping 回复：运行下一个 Ping 测试，检查 VM 与网络路由器的连接。
3. **Ping 网络路由器地址。**\
   要检查网络的地址设置，请参阅： [确定网络地址](#determining-network-addresses)
   * Ping 回复表示 VM 正在连接到网络；如果 VM 在此处收到了 Ping 回复，但无法访问互联网（未通过上述 Ping 测试）：请参阅 [常见网络诊断](#common-network-diagnostics) 部分，以排查网络问题。
   * 如果没有 Ping 回复：继续测试下面的 VM 配置。

## 验证 VM 是否具有合适的 IP 地址

{% hint style="success" %}
**默认情况下，内部 VergeOS 网络配置为提供 DHCP 地址。**
{% endhint %}

**检查 VM 是否已获得 DHCP 地址：**

1. 导航到 **VM 仪表板**.
2. 向下滚动到屏幕的 **NIC** 部分。如果网络为 NIC 分配了 DHCP 地址，它将显示在 **IP 地址** 字段中。 ![troubleshooting-verifyipaddress.png](/files/b625a92a7b09706f8fc465c74744b4d46ca45857)
3. **如果在来宾 OS 中手动分配了 IP 地址（而不是使用 DHCP）：** -验证分配的 IP 地址位于该网络的地址范围内。

{% hint style="success" %}
**Layer3 内部网络的默认地址设置：网络段：192.168.0.0/24；路由器地址：192.168.0.1 要检查网络的地址设置，请参阅** [**确定网络地址**](#determining-network-addresses)
{% endhint %}

4. 验证子网掩码和网关是否正确（网关应为网络路由器的 IP 地址）。
5. 验证该 IP 地址未在同一网络中重复（未被其他 NIC 使用）。

{% hint style="info" %}
**通常建议在内部网络上使用 DHCP，而不是仅在 VM 来宾 OS 中手动分配地址。可以配置静态 DHCP，为特定 VM 预留特定地址：** [**创建 DHCP 静态条目**](/run-the-platform/zh/wang-luo/dhcp-static-lease.md)
{% endhint %}

## 验证正确的 NIC 接口和驱动程序

VirtIO 通常是 NIC 设备的推荐接口，因为它一般能提供最佳性能。Windows VM 可能需要添加 VirtIO 驱动程序。VergeOS 自定义 Windows ISO 文件包含 VirtIO 驱动程序，可用于初始来宾 OS 安装；否则，可在以下地址下载最新的 VirtIO 驱动程序：<https://fedorapeople.org/groups/virt/virtio-win/direct-downloads/stable-virtio/virtio-win.iso>

**检查 NIC 接口：**

1. 导航到 **VM 仪表板**.
2. 向下滚动到屏幕的 **NIC** 部分。
3. 该 **接口** 列将显示每个 NIC 的信息。 ![troubleshooting-verifyinterface.png](/files/b52749e7cd03fea8ba22741187be00f7a5bdb2a4)

## 检查来宾防火墙和 AV 软件

如果在验证了 NIC 接口/驱动程序和 IP 地址后，VM 仍然无法到达其网络路由器，请检查来宾软件，例如 OS 防火墙、杀毒程序等，这些软件可能会阻止外部访问。请查阅这些产品的帮助菜单/文档以获取配置说明。

## 常见网络诊断

本部分解释了一些常见的网络诊断查询；有关内置诊断工具的更多信息，请参阅 [**网络 - 诊断**](/run-the-platform/zh/wang-luo/network-diagnostics.md) 。

### 检查网络是否具有互联网连接

1. 进入网络仪表板。

{% hint style="success" %}
**快速进入 NIC 所连接网络的方法：在 VM 仪表板中，向下滚动到 NICs 部分并点击 NIC 所列出的网络。**
{% endhint %}

2. 单击 **诊断** 左侧菜单中的。
3. 选择 ***Ping*** 从 **诊断查询** 下拉列表。
4. 单击 **发送** 以测试对 8.8.8.8 的 ping（这是默认的 Host 值；它是 Google 的公共 DNS。）
5. Ping 不成功可能表示网络配置不正确。
6. 如果 Ping 测试成功；可以进一步测试以验证 DNS 是否正常工作；更改 **Host** 值为一个互联网 DNS 名称（例如 google.com），然后点击 **发送**

## 默认网关规则

为了让内部网络获得互联网连接，必须有一条默认网关规则，通过外部网络进行路由。

**检查默认网关路由规则：**

1. 进入网络仪表板。
2. 单击 **规则** 左侧菜单中的。
3. 验证是否存在一条路由规则，其 Target 中定义了适当的外部网络。\
   示例： ![showdefgwrule.png](/files/42b7812c68cb245a46139905a2f39f21b2749df3)

{% hint style="success" %}
**创建新的内部网络时，在 Default Gateway 设置中选择外部网络；这将自动创建所需的默认网关路由规则。也可以在创建网络后按以下说明手动创建路由规则。**
{% endhint %}

**创建默认网关路由规则：**

1. 进入网络仪表板。
2. 单击 **规则** 左侧菜单中的。
3. 单击 **新建** 左侧菜单中的。
4. 输入一个 **名称** 用于该规则（推荐名称：“Default Gateway”）。
5. 在 **操作** 字段中，选择 ***路由***.
6. 在 **方向** 字段中，选择 ***出站***.
7. 在 **类型** （Target）字段中，选择 ***其他网络 DMZ IP***.
8. 在 **目标网络** 字段中，选择合适的外部网络。

示例： ![defaultgw-create.png](/files/38281be1707c4f07129e544c49511afcbb2b7426)

## 确定网络地址

网络的网关地址和网络段可在网络仪表板中找到。

* **网络**：CIDR 格式的网络段（例如：192.168.0.0/24；10.10.0.0/24）
* **IP 地址**：网络路由器地址（例如：192.168.0.1；10.10.0.1）

![findnetworkaddress.png](/files/483f7c72d286f1d53ecac4e906736a59abb6b073)

{% hint style="info" %}
**默认情况下，内部 Layer-3 网络配置为网络段：192.168.0.0/24，路由器 IP 地址：192.168.0.1**
{% endhint %}

## DNS

### 测试网络上的 DNS

1. 进入该网络的仪表板。
2. 单击 **诊断** 左侧菜单中的。
3. 选择 ***DNS 查询*** 在 **查询** 下拉列表。
4. 可以使用默认值运行基本 DNS 测试。如有需要，可更改这些值：
   * **Host** （URL）
   * **查询类型** （记录类型）
   * **DNS 服务器** （可选，用于指定特定 DNS 服务器，覆盖默认值）
5. 单击 **发送** 以提交查询。
6. Responses 窗口将显示结果；成功的 DNS 查询会返回所输入 Host 对应的 IP 地址。

### 从 VM 测试 DNS

当 VM 能够访问互联网 IP 地址，但无法访问 URL 地址时，说明存在 DNS 问题。如果从网络上验证了 DNS 功能，但从 VM 本身无法验证，请检查 VM 来宾 OS 中的 DNS 配置；可执行的 DNS 查询测试会因来宾 OS 版本而异（nslookup、dig 等）

{% hint style="success" %}
**如果 VM 配置为 DHCP 并成功获取地址，它也会自动从网络接收 DNS 配置**
{% endhint %}

如需更多故障排除帮助，请联系 VergeOS 支持。


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.verge.io/run-the-platform/zh/wang-luo/net-troubleshooting.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
