> 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/connect-lan-wan.md).

# 将 VergeOS 连接到现有 LAN/WAN

创建和配置外部网络，将 VergeOS 连接到现有 LAN、WAN 或其他物理网络基础设施，并提供完整的二层和三层选项。

## 如何连接到现有网络

要连接 VergeOS 环境之外的网络（例如现有的公司局域网或广域网连接），需要使用 VergeOS 外部网络。通常，在安装 VergeOS 系统时会创建一个外部网络，并将其映射到安装期间定义的物理网络。您可以创建多个外部网络，以充分利用多个可用的物理网络。多个外部网络可以映射到同一个物理网络，但各自使用不同的 VLAN。以下说明介绍如何在安装后通过 VergeOS 界面创建外部网络。此外，也可以使用本文提供的设置信息修改安装期间创建的外部网络。

## 创建新的外部网络

1. 在云仪表板中，从左侧菜单中选择 **网络** 。
2. 从左侧菜单中选择 **新建外部网络** 。
3. 输入网络 **名称** （必填）。名称应便于日后管理。注意：名称中不能包含空格。
4. 可以选择为网络输入 **描述** 。
5. 可以选择为网络定义 **HA 组** 。HA 组用于定义两个或更多网络，以实现高可用性。将多个网络分配到同一个 HA 组时，系统会尝试在不同的物理节点上运行这些网络，以提高可用性。
6. 选择适当的 **第 2 层类型**:

   * ***vLan***：（在第 2 层 ID 字段中指定 VLAN ID）
   * ***Bond***：支持配置为 lag 组主设备的交换机端口
   * ***Bond Slave***：支持配置为 lag 组辅助设备的交换机
   * ***vxLan***：（在第 2 层 ID 字段中指定 VXLAN ID）
   * ***无***：直接连接；不进行 VLAN/VXLAN 管理，VLAN 标签将原样通过

   <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p>**当 <strong>第 2 层类型</strong> 设置为 <em><strong>无</strong></em> 时，所有 VLAN 都会通过此网络，但在同一物理网络上被其他外部网络占用的 VLAN 除外（即将 VLAN 指定为第 2 层类型的网络）。802.1Q 来宾标签 VLAN 也会通过此网络。有关虚拟来宾标签的更多信息，请参阅知识库文章： <a href="https://app.gitbook.com/s/QZBMFpokMv2vWTIRbFzA/networking/pass-guest-tagged-vlans-to-a-vm">将来宾标签 VLAN 传递到虚拟机</a>.</p></div>
7. 输入 **第 2 层 ID**（如适用，适用于 VLAN/VXLAN）
8. 输入适当的 **MTU 大小** 以匹配现有网络。
9. 可以选择特定的 **集群** ，以指定运行此 VNet 的主集群。
10. 可以选择特定的 **故障转移集群** ，以指定主集群不可用时运行此网络的集群。
11. 可以选择 **首选节点** 可选择此项，将特定节点指定为运行 VNet 的“首选”节点。
12. 可选：将此网络设置为允许 **PXE** 启动 VergeOS 节点（默认情况下未启用 PXE）。
13. 选择合适的 **接口网络** 从物理网络和外部网络的下拉列表中选择。通常应在此处选择物理网络；选择外部网络（而非物理网络）则适用于 Q-in-Q（VLAN 内嵌套 VLAN）。
14. 选择合适的 **IP 地址类型**:
    * ***静态*** - 为网络指定特定地址
    * ***动态*** - 将网络配置为 DHCP 客户端（仅用于小型测试或归档系统，因为这会将网络限制为单个地址。）
    * ***BGP/OSPF***
    * ***无*** - 二层网络连接
15. 输入 **IP 地址** （选择“动态”类型时不适用。）
16. 输入 **网络地址** （采用 CIDR 格式），例如：192.168.2.0/24
17. 指定 **DNS 服务器列表**；每项之间用逗号分隔。（例如：10.10.25.3, 10.10.25.4）
18. 选择 **DNS** 设置：
    * ***已禁用*** - 不提供 DNS 管理
    * ***绑定*** - 用于充当权威 DNS 的网络
    * ***简单*** - 为网络提供 DNS，但不存储实际的 DNS 记录
19. 可选：勾选 **DHCP** 复选框，为网络客户端运行 DHCP 服务器：
    * ***域名*** 用于此网络（可选）
    * ***网关***
    * ***主机名*** （用于此 VNet 的路由器）
    * ***动态 DHCP*** 选项（复选框）——选中后，可输入 DHCP 起始/结束地址以指定动态分配范围。此外，还可选中“DHCP 连续地址”选项（复选框），以连续方式分配地址。
20. 选择网络恢复供电时要执行的操作 **断电时** （例如物理节点断电后，或对于租户：租户关机后再开机。）
    * ***上次状态*** - 只有在断电时网络处于开启状态，才会将其重新开启
    * ***保持关闭*** - 恢复供电时网络不会启动（无论断电时网络处于什么状态）
    * ***启动*** - 恢复供电时网络将启动（无论断电时网络处于什么状态）
21. 还可以选择以下选项（复选框）：
    * **跟踪统计信息** ，以自动为应用于此网络的所有规则启用跟踪。
    * **跟踪 DMZ 统计信息** ，以跟踪从此网络经由 DMZ 网络传输的数据包总数和字节总数。
    * **在路由上启用速率限制** ，以对整个网络设置限制。（示例用途：按用量计费等。）
    * **速率限制** 对网络流量进行整体限速
    * **速率类型** （例如：每秒数据包数、每天兆字节数、每小时字节数等）
    * **速率限制突发值** - 只要速率限制仍在设定的平均值范围内，就允许达到此突发速率。
22. 点击 **提交** ，完成新网络的创建。
23. 新网络的控制面板随即显示。点击 **启动** ，从左侧菜单启动网络。


---

# 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 by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.verge.io/run-the-platform/zh/wang-luo/connect-lan-wan.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
