> 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/plan-and-deploy/zh/shi-shi-zhi-nan/switch-configuration.md).

# 交换机配置指南

## 概述

本指南介绍 VergeOS 节点部署的交换机端口配置。你将配置两种网络类型： **核心 Fabric** （内部系统/vSAN 存储）以及 **外部** （工作负载连接）。正确的交换机配置可确保最佳性能、安全性和可靠性。

**目标读者：** 部署 VergeOS 系统的基础设施和网络管理员

## 你将学到什么

* 为核心 Fabric 配置隔离的 VLAN 接入端口，并启用巨型帧
* 为外部网络设置带 LACP 的 VLAN 中继端口
* 验证交换机配置并排查常见问题

**常见问题解答：**

* VergeOS 需要什么交换机配置？
* 如何为存储流量配置巨型帧？
* 外部网络应该使用 LACP 还是主备？
* 如何将核心 Fabric 与外部流量隔离？

## 快速参考

| 网络类型          | 配置                            | 用途          |
| ------------- | ----------------------------- | ----------- |
| **核心 Fabric** | 接入端口、隔离 VLAN、MTU 9216、不启用 STP | 隔离集群/存储流量   |
| **外部**        | 中继端口、多个 VLAN、主/备绑定、LACP（可选）   | 具有冗余的工作负载连接 |

***

## 了解网络类型

### 核心 Fabric 网络

用于 VergeOS 集群操作的私有高速网络，承载 vSAN 存储、集群协调和虚拟机迁移流量。

**要求：**

* 专用 VLAN（与 **所有其他** 网络隔离）
* 用于提高存储效率的巨型帧（MTU 9216）
* 接入端口配置（每个核心网络使用单个未标记 VLAN）
* 建议 10Gbps 或更高

### 外部网络

连接虚拟机和工作负载到用户、互联网以及其他基础设施的网络。

**要求：**

* 用于租户/工作负载隔离的多个 VLAN
* 用于冗余的 LACP 绑定（或主备）
* 中继端口配置
* 标准 MTU 1500（如果工作负载需要，也可使用 9000）

***

## 配置步骤

### 1. 准备交换机

**通过控制台/SSH 访问交换机** 并进入配置模式。

{% tabs %}
{% tab title="Cisco IOS/IOS-XE" %}
**进入配置模式：**

```
enable
configure terminal
```

**创建 VLAN：**

```
vlan 900
    name VergeOS-Core-Fabric-1
vlan 901
    name VergeOS-Core-Fabric-2
vlan 10
    name VergeOS-External-Management
vlan 20
    name VergeOS-External-Production
exit
```

**全局启用巨型帧：**

```
system mtu jumbo 9216
```

{% endtab %}

{% tab title="Dell OS10" %}
**进入配置模式：**

```
enable
configure terminal
```

**创建 VLAN：**

```
interface vlan 900
    description VergeOS-Core-Fabric-1
    no shutdown
    exit
interface vlan 901
    description VergeOS-Core-Fabric-2
    no shutdown
    exit
interface vlan 10
    description VergeOS-External-Management
    no shutdown
    exit
interface vlan 20
    description VergeOS-External-Production
    no shutdown
    exit
```

**全局启用巨型帧：**

```
system mtu 9216
```

{% endtab %}

{% tab title="HPE/Aruba" %}
**进入配置模式：**

```
enable
configure terminal
```

**创建 VLAN：**

```
vlan 900
    name VergeOS-Core-Fabric-1
vlan 901
    name VergeOS-Core-Fabric-2
vlan 10
    name VergeOS-External-Management
vlan 20
    name VergeOS-External-Production
exit
```

**全局启用巨型帧：**

```
max-frame-size 9216
```

{% endtab %}
{% endtabs %}

{% hint style="warning" %}
**MTU 大小要求**

VergeOS 要求交换机端口的 MTU 为 9216，以容纳 9000 字节有效负载以及 VLAN 标签、报头和租户开销。将 MTU 设置低于 9216 将导致数据包分片并降低存储性能。
{% endhint %}

### 2. 配置核心 Fabric 端口

将连接到节点核心 Fabric NIC 的每个端口配置为带巨型帧的接入端口。

{% tabs %}
{% tab title="Cisco IOS/IOS-XE" %}
**配置（每个核心 Fabric 端口）：**

```
interface GigabitEthernet1/0/1
 description VergeOS-Node1-Core-Fabric-1
 switchport mode access
 switchport access vlan 900
 mtu 9216
 spanning-tree bpduguard disable
 spanning-tree portfast disable
 no shutdown
 exit

interface GigabitEthernet1/0/2
 description VergeOS-Node1-Core-Fabric-2
 switchport mode access
 switchport access vlan 901
 mtu 9216
 spanning-tree bpduguard disable
 spanning-tree portfast disable
 no shutdown
 exit
```

{% endtab %}

{% tab title="Dell OS10" %}
**配置（每个核心 Fabric 端口）：**

```
interface ethernet1/1/1
 description VergeOS-Node1-Core-Fabric-1
 no shutdown
 switchport mode access
 switchport access vlan 900
 mtu 9216
 spanning-tree bpduguard disable
 spanning-tree port type normal
 exit

interface ethernet1/1/2
 description VergeOS-Node1-Core-Fabric-2
 no shutdown
 switchport mode access
 switchport access vlan 901
 mtu 9216
 spanning-tree bpduguard disable
 spanning-tree port type normal
 exit
```

{% endtab %}

{% tab title="HPE/Aruba" %}
**配置（每个核心 Fabric 端口）：**

```
interface 1/1/1
 description VergeOS-Node1-Core-Fabric-1
 no shutdown
 no routing
 vlan access 900
 mtu 9216
 spanning-tree bpdu-guard disable
 spanning-tree port-type normal
 exit

interface 1/1/2
 description VergeOS-Node1-Core-Fabric-2
 no shutdown
 no routing
 vlan access 901
 mtu 9216
 spanning-tree bpdu-guard disable
 spanning-tree port-type normal
 exit
```

{% endtab %}
{% endtabs %}

\*\*对所有节点重复：\*\*

* 节点 1：核心 Fabric 端口 1-2
* 节点 2：核心 Fabric 端口 1-2
* 节点 3：核心 Fabric 端口 1-2

**关键设置：**

* 模式： **接入** （未标记、单 VLAN）
* VLAN： **900/901** （核心 Fabric 隔离）
* MTU： **9216** （用于存储的巨型帧）
* 生成树： **已禁用** （核心 Fabric 链路不需要）

### 3. 配置外部网络端口（LACP）

对于外部网络，配置 LACP 端口通道以实现冗余和带宽聚合。

{% tabs %}
{% tab title="Cisco IOS/IOS-XE" %}
**创建端口通道：**

```
interface Port-channel1
 description VergeOS-Node1-External-Bond
 switchport mode trunk
 switchport trunk allowed vlan 10,20
 no shutdown
 exit
```

**添加成员端口：**

```
interface range GigabitEthernet1/0/7-8
 description VergeOS-Node1-External-Members
 switchport mode trunk
 switchport trunk allowed vlan 10,20
 channel-group 1 mode active
 no shutdown
 exit
```

{% endtab %}

{% tab title="Dell OS10" %}
**创建端口通道（LAG）：**

```
interface port-channel 1
 description VergeOS-Node1-External-Bond
 no shutdown
 switchport mode trunk
 switchport trunk allowed vlan 10,20
 exit
```

**添加成员端口：**

```
interface range ethernet1/1/7-1/1/8
 description VergeOS-Node1-External-Members
 no shutdown
 channel-group 1 mode active
 no switchport
 exit

interface port-channel 1
 switchport mode trunk
 switchport trunk allowed vlan 10,20
 exit
```

{% endtab %}

{% tab title="HPE/Aruba" %}
**创建 LAG（端口通道）：**

```
interface lag 1
 description VergeOS-Node1-External-Bond
 no shutdown
 no routing
 vlan trunk native 1
 vlan trunk allowed 10,20
 exit
```

**添加成员端口：**

```
interface 1/1/7
 description VergeOS-Node1-External-Member-1
 no shutdown
 lag 1
 exit

interface 1/1/8
 description VergeOS-Node1-External-Member-2
 no shutdown
 lag 1
 exit
```

{% endtab %}
{% endtabs %}

\*\*对其他节点重复\*\*（Po2、Po3 等）

**关键设置：**

* 模式： **中继** （多个已标记 VLAN）
* 允许的 VLAN： **10,20** （仅工作负载和 VergeOS 管理 VLAN）
* LACP 模式： **主动** （发起协商）

### 4. 配置外部端口（主备替代方案）

如果无法使用或不希望使用 LACP，请配置不进行绑定的独立中继端口。

{% tabs %}
{% tab title="Cisco IOS/IOS-XE" %}

```
interface range GigabitEthernet1/0/7-8
 description VergeOS-Node1-External-NoLACP
 switchport mode trunk
 switchport trunk allowed vlan 10,20
 switchport trunk native vlan 99
 spanning-tree portfast trunk
 no shutdown
 exit
```

{% endtab %}

{% tab title="Dell OS10" %}

```
interface range ethernet1/1/7-1/1/8
 description VergeOS-Node1-External-NoLACP
 no shutdown
 switchport mode trunk
 switchport trunk allowed vlan 10,20
 switchport access vlan 99
 spanning-tree port type edge
 exit
```

{% endtab %}

{% tab title="HPE/Aruba" %}

```
interface range 1/1/7-1/1/8
 description VergeOS-Node1-External-NoLACP
 no shutdown
 no routing
 vlan trunk native 99
 vlan trunk allowed 10,20
 spanning-tree port-type admin-edge
 exit
```

{% endtab %}
{% endtabs %}

{% hint style="info" %}
如果 LACP 不可用，VergeOS 可以使用主备绑定在软件中处理故障切换。
{% endhint %}

***

## 验证

### 检查核心 Fabric 配置

{% tabs %}
{% tab title="Cisco IOS/IOS-XE" %}

```
show interfaces GigabitEthernet1/0/1 switchport
show interfaces GigabitEthernet1/0/1 | include MTU
show vlan id 900
```

**预期结果：**

* 模式：接入
* VLAN：900
* MTU：9216
  {% endtab %}

{% tab title="Dell OS10" %}

```
show interface switchport ethernet1/1/1
show interface ethernet1/1/1 | grep MTU
show vlan 900
```

**预期结果：**

* 模式：接入
* 接入 VLAN：900
* MTU：9216
  {% endtab %}

{% tab title="HPE/Aruba" %}

```
show interface 1/1/1
show vlan 900
```

**预期结果：**

* 模式：接入
* 接入 VLAN：900
* MTU：9216
  {% endtab %}
  {% endtabs %}

### 检查外部网络配置（LACP）

{% tabs %}
{% tab title="Cisco IOS/IOS-XE" %}

```
show etherchannel summary
show interfaces Port-channel1 trunk
```

**预期结果：**

* 端口通道状态：SU（正在使用）
* 成员端口：（P）已绑定
* 允许的 VLAN：10,20
* 本征 VLAN：99
  {% endtab %}

{% tab title="Dell OS10" %}

```
show interface port-channel 1
show interface port-channel 1 switchport
show lacp interfaces
```

**预期结果：**

* 端口通道状态：up
* 成员端口：Active
* 允许的 VLAN：10,20
* LACP 模式：active
  {% endtab %}

{% tab title="HPE/Aruba" %}

```
show lacp interfaces
show interface lag 1
show vlan trunk
```

**预期结果：**

* LAG 状态：up
* 成员端口：Active
* 允许的 VLAN：10,20
* LACP 模式：active
  {% endtab %}
  {% endtabs %}

### 节点连接后测试连通性

{% tabs %}
{% tab title="Cisco IOS/IOS-XE" %}
**验证链路已启动：**

```
show interfaces status
```

**检查 LACP 协商：**

```
show lacp neighbor
```

{% endtab %}

{% tab title="Dell OS10" %}
**验证链路已启动：**

```
show interface status
```

**检查 LACP 协商：**

```
show lacp interfaces
```

{% endtab %}

{% tab title="HPE/Aruba" %}
**验证链路已启动：**

```
show interface brief
```

**检查 LACP 协商：**

```
show lacp interfaces
```

{% endtab %}
{% endtabs %}

**从 VergeOS 节点测试巨型帧：**

```bash
ping -M do -s 9188 <other-node-core-ip>
```

***

## 故障排查

| 问题       | 原因      | 修复                 |
| -------- | ------- | ------------------ |
| 核心端口无链路  | 端口关闭    | `no shutdown` 命令   |
| 存储性能缓慢   | 未启用巨型帧  | 将 MTU 设置为 9000     |
| 节点无法加入集群 | VLAN 错误 | 将端口分配到 VLAN 100    |
| LACP 未建立 | 模式不匹配   | 设置 `active 模式` 在两端 |
| VLAN 不工作 | 不在允许列表中 | 将 VLAN 添加到中继       |
| 端口通道已挂起  | 成员配置不匹配 | 确保配置完全一致           |

**获取帮助：**

* 查阅交换机厂商文档
* 联系 VergeOS 支持并提供 `show running-config` 和 `show interfaces status` 输出

***

## 配置摘要

### 核心 Fabric 端口

* **模式：** 接入（未标记）
* **VLAN：** 专用（例如：900、901）
* **MTU：** 9216（巨型帧）
* **速度：** 建议 10Gbps+

### 外部网络端口

* **模式：** 中继（802.1Q 标记）
* **VLAN：** 允许多个（例如：10、20、30）
* **绑定：** LACP 主动模式（或主备）

### 保存配置

```
copy running-config startup-config
```

***

## 下一步

1. **配置 VergeOS 网络绑定** - 在 VergeOS 端设置绑定
2. **创建 VergeOS 网络** - 定义内部和外部网络
3. **验证连通性** - 测试节点间和外部路由

### 其他资源

* VergeOS 网络架构概览
* 网络绑定最佳实践
* 交换机厂商配置指南

**VergeOS 支持：** <support@verge.io> | <https://docs.verge.io>

***

*最后更新：2025 年 1 月 | VergeOS v4.x | 适用于：Cisco IOS/IOS-XE、Dell OS10、HPE/Aruba*


---

# 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/plan-and-deploy/zh/shi-shi-zhi-nan/switch-configuration.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.
