> 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/create-vlan.md).

# 配置 VLAN

## 前提条件

{% hint style="info" %}
**主机级配置**

在配置 VLAN 之前，请确保交换机端口已正确配置，以便物理 VergeOS 节点能够访问所需的 VLAN。
{% endhint %}

{% hint style="info" %}
**租户配置**

对于租户内的 VLAN 配置， [虚拟交换机端口](/knowledge-base/zh/tenants/provide-layer2-to-tenant.md) 必须先进行配置，以向租户提供外部二层访问。
{% endhint %}

## 配置步骤

### 创建 VLAN 网络

1. 选择 **网络** > **+ 新建外部** 从顶部菜单
2. 配置基本设置：
   * 输入一个描述性的 **名称** 用于网络
     * 使用能够表明 VLAN 用途和/或 ID 的命名
   * 选择 ***vLan*** 在 **二层类型** 下拉菜单
   * 输入相应的 **二层 ID**
3. 设置网络接口：

   * 从以下内容中选择合适的物理网络 **接口网络** 列表

   <div data-gb-custom-block data-tag="hint" data-style="info" class="hint hint-info"><p><strong>网络选择</strong></p><p><strong>对于主机网络：</strong></p><ul><li>必须选择一个 VLAN 进入 VergeOS 环境的物理网络</li><li>物理网络通常在安装期间创建，名称后附加“Switch”</li><li>例如：“External1 Switch”</li></ul><p><strong>对于租户：</strong></p><ul><li>选择“Physical”</li></ul></div>
4. 配置附加设置：
   * 设置 **IP 地址类型** 设置为 ***无***
   * 除非需要特定配置，否则其他字段保持默认设置
5. 完成配置：
   * 单击 **提交** 以创建 VLAN 网络
   * 验证网络仪表板是否显示 **状态：运行中**

## 使用 VLAN 网络

{% hint style="success" %}
**VM 配置**

新创建的 VLAN 网络可在虚拟机网卡上选择，以将工作负载连接到相应的 VLAN。
{% endhint %}

## 最佳实践

* 使用有助于识别 VLAN 用途的描述性名称
* 记录 VLAN ID 及其预期用途
* 验证物理交换机配置与 VergeOS 的 VLAN 设置一致
* 配置后测试连接性

## 故障排除

如果 VLAN 网络未显示为运行中：

1. 验证物理交换机配置
2. 检查 VLAN ID 是否与物理网络配置匹配
3. 确认接口网络选择正确
4. 查看网络日志中的任何错误消息


---

# 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/create-vlan.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.
