华为ENSP综合实验:eth-trunk、vlan底层、vrrp负载分担、MSTP、DHCP中继

提示:文章写完后,目录可以自动生成,如何生成可参考右边的帮助文档

文章目录

  • 前言
  • 一、实验目的:在局域网内实验,dhcp服务器负责地址分配、核心交换机做链路聚合增加带宽
  • 二、使用步骤
    • 1、eth-trunk配置
    • 2、VLAN二层配置
    • 3、MSTP配置
    • 4、vrrp负载分担
    • 5、DHCP中继服务器
  • 总结


前言

这个实验我尝试过很多次,在MSTP配置在整个拓扑图出现环路情况,不能正常获取到地址,开始以为是ensp系统bag,但经过多次排查后发现是MSTP配置问题,现在 实验步骤如下:

 


实验结果:PC1、PC2数据往LSW1走、PC3、PC4数据往LSW2走,当LW1设备g0/0/4断开,则切换到LW2上,PC1、PC2从LSW2路径走,往DHCP获取地址。当LW2设备g0/0/4链路断开,PC3、PC4能从LSW1链路走,往DHCP获取地址,具体配置如下(局域网dhcp服务器配置及负载分担) 


 1、eth-trunk配置:

LSW1:
sy
un in en  (关闭信息提示)
interface Eth-Trunk1
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
 trunkport g 0/0/1 to 0/0/3  加入端口

LSW2:
sy
un in en  (关闭信息提示)
interface Eth-Trunk1
 port link-type trunk
 port trunk allow-pass vlan 2 to 4094
 trunkport g 0/0/1 to 0/0/3

2、vlan二层配置:

LSW1:
vlan batch 10 20 30 40 100
int g0/0/4
port link-type access
port default vlan 100
int g0/0/5
port link-t trunk
port trunk allow-p vlan 10 20 
int g0/0/6
port link-t trunk
port trunk allow-p vlan 30 40 


LSW2:
vlan batch 10 20 30 40 101
int g0/0/4
port link-type access
port default vlan 101
int g0/0/5
port link-t trunk
port trunk allow-p vlan 10 20 
int g0/0/6
port link-t trunk
port t
<think>好的,我现在需要帮助用户了解如何在交换机上配置VRRP、STP、VLANEth-Trunk综合实验。首先,我得回忆一下这些技术的基本概念和它们之间的关系。VRRP是虚拟路由冗余协议,用于提供网关的冗余备份;STP是生成树协议,防止网络环路;VLAN用于划分广播域;Eth-Trunk则是链路聚合,增加带宽和可靠性。 根据用户提供的引用内容,特别是引用[2]和[3],配置顺序应该是先配置Eth-Trunk,然后是Trunk干道、VLAN、STP、SVI(交换虚拟接口)、VRRP,最后是DHCP。这可能是因为Eth-Trunk作为物理链路的聚合需要先建立,接着配置Trunk允许VLAN通过,划分VLAN后设置STP来防止环路,之后配置SVI作为VLAN的接口,再设置VRRP实现网关冗余,最后配置DHCP中继。 接下来,我需要分步骤详细说明每个部分的配置。比如在Eth-Trunk部分,可能需要创建Eth-Trunk组,将物理接口加入其中。VLAN的配置需要创建VLAN并将接口分配到对应的VLAN。STP部分可能需要设置MSTP实例,并配置主备根桥。VRRP部分需要为不同的VLAN配置不同的虚拟网关,并设置优先级实现负载分担。同时,还需要考虑DHCP中继指向服务器的地址。 需要注意的是,不同厂商的交换机配置命令可能不同,用户提到的引用里提到了华为ENSP,所以应该使用华为的命令。例如,Eth-Trunk华为设备中使用interface Eth-Trunk命令,STP可能需要配置MSTP区域和实例映射。 另外,用户可能容易出错的地方包括VLAN划分不正确、Trunk口未允许相应的VLAN通过、STP配置导致阻塞错误端口、VRRP优先级设置不当导致主备切换失败等。需要提醒用户检查这些部分,并进行测试验证,如查看Eth-Trunk状态、VLAN信息、STP拓扑、VRRP状态和DHCP分配情况。 最后,生成相关问题时要围绕配置步骤、优化、排错和应用场景展开,帮助用户进一步理解。</think>### 配置VRRP、STP、VLANEth-Trunk综合实验的步骤 #### **1. Eth-Trunk配置(链路聚合)** - **目标**:提升带宽与链路可靠性。 - **步骤**: 1. 在汇聚层交换机(如SW1、SW2)上创建Eth-Trunk组: ```shell interface Eth-Trunk 1 # 创建Eth-Trunk组 mode lacp-static # 配置LACP模式(华为设备) ``` 2. 将物理接口加入Eth-Trunk组: ```shell interface GigabitEthernet0/0/1 eth-trunk 1 interface GigabitEthernet0/0/2 eth-trunk 1 ``` 3. 验证配置: ```shell display eth-trunk 1 # 查看Eth-Trunk状态 ``` *注意:Eth-Trunk需在两端设备对称配置[^3]。* --- #### **2. Trunk干道配置** - **目标**:允许多VLAN流量通过聚合链路。 - **步骤**: 1. 在Eth-Trunk接口和互联接口上配置Trunk类型: ```shell interface Eth-Trunk 1 port link-type trunk # 设置接口为Trunk模式 port trunk allow-pass vlan all # 允许所有VLAN通过(或指定VLAN列表) ``` --- #### **3. VLAN与二层配置** - **目标**:划分广播域并关联接口。 - **步骤**: 1. 创建VLAN(例如VLAN10、VLAN20): ```shell vlan batch 10 20 # 批量创建VLAN ``` 2. 将接入层交换机接口划入对应VLAN: ```shell interface GigabitEthernet0/0/3 port link-type access # 设置接口为Access模式 port default vlan 10 # 关联到VLAN10 ``` --- #### **4. MSTP(多生成树协议)配置** - **目标**:防止环路并实现负载分担- **步骤**: 1. 配置MSTP区域与实例映射: ```shell stp region-configuration region-name MSTP_Region # 定义区域名称 instance 1 vlan 10 # 将VLAN10映射到实例1 instance 2 vlan 20 # 将VLAN20映射到实例2 active region-configuration ``` 2. 指定根桥与备份根桥: ```shell # 在SW1上配置实例1为主根桥 stp instance 1 root primary # 在SW2上配置实例2为主根桥 stp instance 2 root primary ``` --- #### **5. SVI与VRRP配置** - **目标**:实现网关冗余与负载分担- **步骤**: 1. 创建VLAN接口(SVI)并配置IP地址: ```shell interface Vlanif10 ip address 192.168.10.1 255.255.255.0 ``` 2. 配置VRRP虚拟网关(以VLAN10为例): ```shell interface Vlanif10 vrrp vrid 10 virtual-ip 192.168.10.254 # 设置虚拟IP vrrp vrid 10 priority 120 # 设置优先级(主设备) vrrp vrid 10 preempt-mode timer delay 5 # 配置抢占延迟 ``` 3. 在另一台交换机上配置相同VRID但优先级更低: ```shell interface Vlanif10 vrrp vrid 10 virtual-ip 192.168.10.254 vrrp vrid 10 priority 110 # 备份设备优先级 ``` --- #### **6. DHCP中继配置** - **目标**:跨VLAN分配IP地址。 - **步骤**: 1. 在核心交换机上启用DHCP中继: ```shell interface Vlanif10 dhcp select relay # 启用DHCP中继 dhcp relay server-ip 192.168.100.1 # 指向DHCP服务器地址 ``` --- ### **验证与排错** 1. **Eth-Trunk状态**:`display eth-trunk 1` 2. **VLAN信息**:`display vlan` 3. **STP拓扑**:`display stp brief` 4. **VRRP状态**:`display vrrp` 5. **DHCP分配**:客户端获取IP后测试连通性。 ---
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值