华为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 trunk allow-p vlan 30 40 

JIERU1:
sy
un in en
vlan batch 10 20 30 40 
int g0/0/1
port link-t trunk
port trunk allow-p vlan 10 20 
int g0/0/2
port link-t trunk
port trunk allow-p vlan 10 20 
int g0/0/3
port link-type access
port default vlan 10
int g0/0/4
port link-type access
port default vlan 20

JIERU2:
sy
un in en
vlan batch 10 20 30 40 
int g0/0/1
port link-t trunk
port trunk allow-p vlan 30 40 
int g0/0/2
port link-t trunk
port trunk allow-p vlan 30 40 
int g0/0/3
port link-type access
port default vlan 30
int g0/0/4
port link-type access
port default vlan 40


3、MSTP配置:

LSW1:
stp enable
stp region-configuration
 region-name 1
 instance 1 vlan 10 20
 instance 2 vlan 30 40
 active region-configuration
stp instance 1 root primary  主根桥
stp instance 2 root secondary  备用根桥

LSW2:
stp enable
stp region-configuration
 region-name 1
 instance 1 vlan 10 20
 instance 2 vlan 30 40
 active region-configuration
stp instance 1 root secondary
stp instance 2 root primary

JIERU1:
stp enable
stp region-configuration
 region-name 1
 instance 1 vlan 10 20
 instance 2 vlan 30 40
 active region-configuration

JIERU2:
stp enable
stp region-configuration
 region-name 1
 instance 1 vlan 10 20
 instance 2 vlan 30 40
 active region-configuration

4、虚拟地址及vrrp配置:

LSW1:
interface Vlanif10
 ip address 10.1.1.254 255.255.255.0
 vrrp vrid 1 virtual-ip 10.1.1.1  vrrp虚拟网关
 vrrp vrid 1 priority 120  vrrp优先级(越大越优先)
 vrrp vrid 1 track interface GigabitEthernet0/0/4 reduced 50  端口监视
interface Vlanif20
 ip address 20.1.1.254 255.255.255.0
 vrrp vrid 2 virtual-ip 20.1.1.1
 vrrp vrid 2 priority 120
 vrrp vrid 2 track interface GigabitEthernet0/0/4 reduced 50
interface Vlanif30
 ip address 30.1.1.254 255.255.255.0
 vrrp vrid 3 virtual-ip 30.1.1.1
ip address 40.1.1.254 255.255.255.0
 vrrp vrid 4 virtual-ip 40.1.1.1
int vlanif 100
ip address 100.1.1.1 24

LSW2:
interface Vlanif10
 ip address 10.1.1.253 255.255.255.0
 vrrp vrid 1 virtual-ip 10.1.1.1
interface Vlanif20
 ip address 20.1.1.253 255.255.255.0
 vrrp vrid 2 virtual-ip 20.1.1.1
interface Vlanif30
 ip address 30.1.1.253 255.255.255.0
 vrrp vrid 3 virtual-ip 30.1.1.1
 vrrp vrid 3 priority 120
 vrrp vrid 3 track interface GigabitEthernet0/0/4 reduced 50
interface Vlanif40
 ip address 40.1.1.253 255.255.255.0
 vrrp vrid 4 virtual-ip 40.1.1.1
 vrrp vrid 4 priority 120
 vrrp vrid 4 track interface GigabitEthernet0/0/4 reduced 50
interface vlanif 101
ip address 101.1.1.1 24

5、配置dhcp服务器、dhcp中继、dhcp snooping、静态路由策略:

DHCP服务器:
sy
un in en
sys DHCP
dhcp enable  开启服务
ip pool 10
 gateway-list 10.1.1.1  
 network 10.1.1.0 mask 255.255.255.0 
 excluded-ip-address 10.1.1.253 10.1.1.254 
 dns-list 8.8.8.8 
#
ip pool 20
 gateway-list 20.1.1.1 
 network 20.1.1.0 mask 255.255.255.0 
 excluded-ip-address 20.1.1.253 20.1.1.254 
 dns-list 8.8.8.8 
#
ip pool 30
 gateway-list 30.1.1.1 
 network 30.1.1.0 mask 255.255.255.0 
 excluded-ip-address 30.1.1.253 30.1.1.254 
 dns-list 8.8.8.8 
#
ip pool 40
 gateway-list 40.1.1.1 
 network 40.1.1.0 mask 255.255.255.0 
 excluded-ip-address 40.1.1.253 40.1.1.254 
 dns-list 8.8.8.8 

interface GigabitEthernet0/0/0
 ip address 100.1.1.2 255.255.255.0 
 dhcp select global
#
interface GigabitEthernet0/0/1
 ip address 101.1.1.2 255.255.255.0 
 dhcp select global

interface LoopBack0
 ip address 5.5.5.5 255.255.255.0 
#
ip route-static 10.1.1.0 255.255.255.0 100.1.1.1
ip route-static 10.1.1.0 255.255.255.0 101.1.1.1 preference 70
ip route-static 20.1.1.0 255.255.255.0 100.1.1.1
ip route-static 20.1.1.0 255.255.255.0 101.1.1.1 preference 70
ip route-static 30.1.1.0 255.255.255.0 100.1.1.1 preference 70
ip route-static 30.1.1.0 255.255.255.0 101.1.1.1
ip route-static 40.1.1.0 255.255.255.0 100.1.1.1 preference 70
ip route-static 40.1.1.0 255.255.255.0 101.1.1.1

LSW1中继:
dhcp en
int v 10
dhcp select relay
dhcp relay server-ip 100.1.1.2
int v 20
dhcp select relay
dhcp relay server-ip 100.1.1.2
int v 30
dhcp select relay
dhcp relay server-ip 100.1.1.2
int v 40
dhcp select relay
dhcp relay server-ip 100.1.1.2

ip route-static 0.0.0.0 0 100.1.1.2

LSW2中继:
dhcp en
int v 10
dhcp select relay
dhcp relay server-ip 101.1.1.2
int v 20
dhcp select relay
dhcp relay server-ip 101.1.1.2
int v 30
dhcp select relay
dhcp relay server-ip 101.1.1.2
int v 40
dhcp select relay
dhcp relay server-ip 101.1.1.2

ip route-static 0.0.0.0 0 101.1.1.2

JIERU1 DHCP snooping配置:
dhcp en
dhcp snooping en
vlan 10
 dhcp snooping enable
vlan 20
 dhcp snooping enable
int g/0/1 
dhcp snooping enable
dhcp snooping trusted
int g0/0/2
 dhcp snooping enable
 dhcp snooping trusted


JIERU2 DHCP snooping配置:
dhcp en
dhcp snooping en
vlan 30
 dhcp snooping enable
vlan 40
 dhcp snooping enable
int g/0/1 
dhcp snooping enable
dhcp snooping trusted
int g0/0/2
 dhcp snooping enable
 dhcp snooping trusted

 

配置完成:查看相关数据:

1、vrrp负载分担情况:

 

 

 当断开LSW1g0/0/4端口时:

 

能完成自主切换主备。

当断开LSW2g0/0/4端口时:

 

 

也能进行主备切换。

2、查看PC获取地址情况:

 

 

 

 

均能获取地址,切访问到DHCP 回环网口5.5.5.5 实验完成 

 

 

 

总结

这个实验结合了华为多种策略协议,适合做公司、部门内部网络规划,其中在在这个基础上可以添加ACL访问控制禁止部门互访,AC部署无线网络,也可以部署FTP、DNS、www服务器。在这个基础上可以增加多种网络元素,但也有不足之处,即没有做好核心部分下行的网络冗余及聚合链路的多样配置,当核心的下行接口故障,PC端则无法获取到地址,这个我目前还在寻找解决的方法,如有大神知晓,请留言相告,不胜感激。

  • 11
    点赞
  • 146
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
华为综合实验ISIS-BGP是指在华为设备上进行ISIS(Intermediate System to Intermediate System)和BGP(Border Gateway Protocol)的实验。ISIS是一个内部网关协议(IGP),用于在大型企业或互联网服务提供商网络中进行路由选择和转发。BGP是一个外部网关协议(EGP),主要用于互联网中的自治系统之间的路由选择。 在华为设备上进行ISIS-BGP实验可以帮助网络工程师熟悉和理解这两个协议的工作原理,以及如何在实际网络中配置和管理它们。这样可以提高网络的可靠性、灵活性和可扩展性,并优化数据包的传输效率。 通过ISIS-BGP实验,可以学习到以下内容: 1. ISIS的基本概念和原理,包括链路状态数据库(LSDB)、SPF(Shortest Path First)算法、区域划分等。 2. ISIS的配置和管理,包括邻居关系的建立、路由器ID的分配、路由器间的链路状态数据库同步等。 3. BGP的基本概念和原理,包括自治系统(AS)、路由器之间的对等关系、AS路径选择算法等。 4. BGP的配置和管理,包括自治系统号的分配、邻居关系的建立、路由策略的配置等。 5. ISIS和BGP之间的互操作性,包括ISIS和BGP之间的路由传播、路由策略的互操作等。 在实验中,可以使用华为设备的命令行界面(CLI)或网络管理软件来配置和管理ISIS和BGP协议。通过实验,可以深入了解ISIS和BGP协议的工作原理和实际应用,提高对大型网络的设计和运维能力。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值