ETH-转载

关于区块存储

http://www.ethchinese.com/?p=1827


<think>根据用户需求,配置Eth-Trunk接口涉及多个步骤:配置链路类型、PVID、允许通过的VLAN、LACP模式以及添加物理接口。下面以华为交换机为例,详细说明配置步骤。###1.创建Eth-Trunk接口首先需要创建Eth-Trunk接口,并进入该接口视图。```bash[设备]interfaceEth-Trunk1```###2.配置链路类型为Trunk将Eth-Trunk接口的链路类型设置为Trunk。```bash[设备-Eth-Trunk1]portlink-typetrunk```###3.配置允许通过的VLAN指定允许通过的VLAN,例如允许VLAN10,20,30通过(或所有VLAN):```bash[设备-Eth-Trunk1]porttrunkallow-passvlan102030#指定特定VLAN或者[设备-Eth-Trunk1]porttrunkallow-passvlanall#允许所有VLAN```###4.配置PVID设置Eth-Trunk接口的默认VLAN(PVID),例如设置为VLAN10:```bash[设备-Eth-Trunk1]porttrunkpvidvlan10```###5.启用LACP模式配置Eth-Trunk的负载分担模式为LACP(动态模式):```bash[设备-Eth-Trunk1]modelacp```###6.将物理接口加入Eth-Trunk进入需要加入Eth-Trunk的物理接口视图(例如GigabitEthernet0/0/1和GigabitEthernet0/0/2),并将它们加入Eth-Trunk。```bash[设备]interfaceGigabitEthernet0/0/1[设备-GigabitEthernet0/0/1]eth-trunk1[设备]interfaceGigabitEthernet0/0/2[设备-GigabitEthernet0/0/2]eth-trunk1```###7.(可选)配置LACP参数如果需要调整LACP参数,例如系统优先级或超时时间:```bash[设备]lacppriority1000#配置系统LACP优先级,值越小优先级越高[设备-Eth-Trunk1]lacptimeoutfast#配置LACP超时时间为fast(默认为slow)```###8.验证配置使用以下命令检查Eth-Trunk配置:```bash[设备]displayeth-trunk1#查看Eth-Trunk概要信息[设备]displayinterfaceEth-Trunk1#查看Eth-Trunk接口状态[设备]displaylacpstatisticseth-trunk1#查看LACP统计信息```###注意事项:-将物理接口加入Eth-Trunk前,需确保这些接口没有其他配置(如IP地址、VLAN配置等),否则需要先清除。-物理接口加入Eth-Trunk后,其配置将被Eth-Trunk接口的配置覆盖。-不同厂商的命令可能略有差异,以上为华为设备命令。###完整示例配置:```bash[设备]sys[设备]interfaceEth-Trunk1[设备-Eth-Trunk1]portlink-typetrunk[设备-Eth-Trunk1]porttrunkallow-passvlanall[设备-Eth-Trunk1]porttrunkpvidvlan10[设备-Eth-Trunk1]modelacp[设备]interfaceGigabitEthernet0/0/1[设备-GigabitEthernet0/0/1]eth-trunk1[设备]interfaceGigabitEthernet0/0/2[设备-GigabitEthernet0/0/2]eth-trunk1[设备]quit[设备]save```§§相关问题§§1.Eth-Trunk接口支持哪些负载分担模式?2.如何配置静态LACP模式和动态LACP模式有什么区别?3.在Eth-Trunk接口上配置PVID的作用是什么?4.如何从Eth-Trunk接口中移除物理端口?</think> ### 配置 Eth-Trunk 接口步骤详解 以下是华为交换机上 Eth-Trunk 接口的完整配置流程,包括链路类型、PVID、VLAN 许可、LACP 模式和物理接口绑定: --- #### **1. 创建 Eth-Trunk 接口** ```bash [设备] interface Eth-Trunk 1 # 创建 Eth-Trunk 1 接口 ``` #### **2. 配置链路类型为 Trunk** ```bash [设备-Eth-Trunk1] port link-type trunk # 设置链路类型为 Trunk ``` #### **3. 指定 PVID(默认 VLAN)** ```bash [设备-Eth-Trunk1] port trunk pvid vlan 10 # 设置 PVID 为 VLAN 10(可替换为实际 VLAN) ``` #### **4. 配置允许通过的 VLAN** - **允许全部 VLAN**: ```bash [设备-Eth-Trunk1] port trunk allow-pass vlan all ``` - **允许指定 VLAN**: ```bash [设备-Eth-Trunk1] port trunk allow-pass vlan 10 20 30 # 允许 VLAN 10,20,30 ``` #### **5. 启用 LACP 模式** ```bash [设备-Eth-Trunk1] mode lacp # 启用动态 LACP 协商 [设备-Eth-Trunk1] quit # 退出接口视图 ``` #### **6. 添加物理接口到 Eth-Trunk** ```bash [设备] interface range GigabitEthernet 0/0/1 to 0/0/4 # 选择物理接口范围 [设备-接口范围] eth-trunk 1 # 将接口加入 Eth-Trunk 1 ``` #### **7. (可选) 配置 LACP 参数** - **设置系统优先级**(值越小优先级越高): ```bash [设备] lacp priority 1000 ``` - **设置超时模式**: ```bash [设备-Eth-Trunk1] lacp timeout fast # 快速超时(1秒),默认为 slow(90秒) ``` #### **8. 验证配置** ```bash [设备] display eth-trunk 1 # 检查 Eth-Trunk 状态 [设备] display lacp statistics # 查看 LACP 协商状态 [设备] display port vlan Eth-Trunk 1 # 验证 VLAN 和 PVID ``` --- ### **配置注意事项** 1. **物理接口预处理**: - 加入 Eth-Trunk 前需清除物理接口的独立配置(如 IP 地址、VLAN 设置) - 确保物理接口的速率/双工模式一致 2. **LACP 模式要求**: - 对端设备需同样启用 LACP,且系统优先级、超时时间建议一致 - 活动接口数需满足 `min active-linknumber` 要求(默认至少 2 条) 3. **VLAN 兼容性**: - PVID 必须在 `allow-pass vlan` 范围内 - 跨设备 Trunk 时需确保两端允许的 VLAN 列表匹配 > **引用说明**:Hybrid 端口默认配置需显式修改为 Trunk[^1] --- ### **关键命令总结** | 功能 | 命令示例 | |---------------------|----------------------------------------------| | 创建 Eth-Trunk | `interface Eth-Trunk 1` | | 设为 Trunk | `port link-type trunk` | | 设置 PVID | `port trunk pvid vlan 10` | | 允许 VLAN | `port trunk allow-pass vlan 10 20` | | 启用 LACP | `mode lacp` | | 绑定物理接口 | `interface G0/0/1 → eth-trunk 1` |
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值