> 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/learn-the-platform/zh/mo-kuai-4-wang-luo/lab.md).

# 实验：网络配置

## 目标

在 VergeOS 中配置完整的网络环境，包括外部网络连接、内部虚拟网络、VLAN 分段以及用于控制流量的防火墙规则。

## 前置条件

* 已完成模块 1：架构基础
* 已完成模块 3：安装
* 已完成模块 4 阅读（外部网络、内部网络、VLAN 与防火墙规则、动态路由）
* 一个运行中的 VergeOS 集群，至少包含 2 个节点

## 难度

**中级** -- 需要理解网络概念（IP 地址分配、VLAN、防火墙规则）

## 预计时间

**1.5 小时**

## 步骤

### 第 1 部分：外部网络配置

将你的 VergeOS 集群连接到上游物理网络。

1. 在 VergeOS 界面中导航到“网络”部分
2. 配置外部网络：
   * 分配外部面向的 NIC
   * 配置 IP 地址（静态或来自上游的 DHCP）
   * 设置默认网关
3. 通过 ping 上游资源验证外部连通性
4. 记录外部网络配置以供日后参考

### 第 2 部分：内部网络创建

为工作负载创建隔离的虚拟网络。

1. 为应用工作负载创建一个新的内部网络：
   * 定义子网（例如，10.100.1.0/24）
   * 启用 DHCP 并配置地址池
   * 配置 DNS 转发
2. 为管理流量创建第二个内部网络：
   * 定义一个单独的子网（例如，10.100.2.0/24）
   * 使用不同的地址范围启用 DHCP
3. 验证这两个网络都显示在“网络”仪表板中

### 第 3 部分：VLAN 和防火墙规则

对流量进行分段并应用安全策略。

1. 在外部网络上配置 VLAN 标记（如适用）：
   * 分配一个 VLAN ID，以匹配你的物理网络配置
2. 创建防火墙规则：
   * 允许从外部网络到应用网络的 HTTP/HTTPS 流量
   * 仅允许来自管理网络的 SSH
   * 默认阻止所有其他网络间流量
3. 通过尝试允许和被阻止的连接来测试防火墙规则

### 第 4 部分：网络之间的路由

启用内部网络之间的受控通信。

1. 配置应用网络和管理网络之间的路由
2. 为内部网络设置 NAT，以访问外部资源
3. 通过测试不同内部网络上虚拟机之间的连通性来验证路由
4. 检查路由表以确认预期路由

## 验证

当你能够回答以下问题时，你的网络实验就完成了 **是** 时，你的 VMware 迁移实验就完成了：

* [ ] 外部网络已配置并具备上游连通性
* [ ] 至少创建了两个启用 DHCP 的内部网络
* [ ] 防火墙规则已到位，仅允许预期的流量
* [ ] 内部网络上的虚拟机可以通过 NAT 访问外部资源
* [ ] 网络间路由按配置正常工作
* [ ] 被阻止的流量已被防火墙规则正确拒绝


---

# 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/learn-the-platform/zh/mo-kuai-4-wang-luo/lab.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.
