ensp实验 vrrp、mstp案例

ensp实验 vrrp、mstp案例_第1张图片

PC机配置地址

ensp实验 vrrp、mstp案例_第2张图片

 ensp实验 vrrp、mstp案例_第3张图片

sys
Enter system view, return user view with Ctrl+Z.
[SW1]vlan batch 10 20
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW1]int e0/0/2
[SW1-Ethernet0/0/2]port link-type access
[SW1-Ethernet0/0/2]port default vlan 10
#接入层SW连接终端设备的接口配置为边缘接口,实现discarding到forwarding的跳跃过渡,避免因拓扑变化导致的无意义等待。
[SW1-Ethernet0/0/2]stp edged-port enable //此接口的生成树状态配置为边缘接口(不受生成树计时器的影响)
[SW1-Ethernet0/0/2]int e0/0/1
[SW1-Ethernet0/0/1]port link-type trunk
[SW1-Ethernet0/0/1]port trunk allow-pass vlan all
[SW1-Ethernet0/0/2]int e0/0/3
[SW1-Ethernet0/0/3]port link-type trunk
[SW1-Ethernet0/0/3]port trunk allow-pass vlan all
[SW1-Ethernet0/0/3]qu
[SW1]stp region-configuration 	
[SW1-mst-region]region-name rg1
[SW1-mst-region]instance 1 vlan 10
[SW1-mst-region]instance 2 vlan 20
[SW1-mst-region]active region-configuration 
[Huawei]sys SW2
[SW2]vlan b 10 20
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW2]int e0/0/2
[SW2-Ethernet0/0/2]p l a
[SW2-Ethernet0/0/2]p d v 20
[SW2-Ethernet0/0/2]int e0/0/1
[SW2-Ethernet0/0/1]p l t
[SW2-Ethernet0/0/1]p t a v a
[SW2-Ethernet0/0/1]int e0/0/3
[SW2-Ethernet0/0/3]p l t
[SW2-Ethernet0/0/3]p t a v a
[SW2-Ethernet0/0/3]qu
[SW2]stp region-configuration 
[SW2-mst-region]region-name rg1	
[SW2-mst-region]instance 1 vlan 10
[SW2-mst-region]instance 2 v 20
[SW2-mst-region]active region-configuration 
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW2-mst-region]qu
[SW2]
[Huawei]sys SW3 
[SW3]int Eth-Trunk 1
[SW3-Eth-Trunk1]trunkport g0/0/3
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW3-Eth-Trunk1]port link-type trunk	
[SW3-Eth-Trunk1]port trunk allow-pass vlan all
[SW3-Eth-Trunk1]trunkport g0/0/4
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW3-Eth-Trunk1]port link-type trunk
[SW3-Eth-Trunk1]port trunk allow-pass vlan all
[SW3-Eth-Trunk1]qu

[SW3]vlan batch 10 20 30
[SW3]int g0/0/1
[SW3-GigabitEthernet0/0/1]p l a
[SW3-GigabitEthernet0/0/1]p d v 30
[SW3-GigabitEthernet0/0/1]int g0/0/2
[SW3-GigabitEthernet0/0/2]p l t
[SW3-GigabitEthernet0/0/2]p t a v a
[SW3-GigabitEthernet0/0/2]int g0/0/5
[SW3-GigabitEthernet0/0/5]p l t
[SW3-GigabitEthernet0/0/5]p t a v a
[SW3-GigabitEthernet0/0/5]qu
[SW3]int vlan 10
[SW3-Vlanif10]ip add 10.1.1.3 24
[SW3-Vlanif10]int vlan 20
[SW3-Vlanif20]ip add 10.1.2.3 24
[SW3-Vlanif20]int vlan 30
[SW3-Vlanif30]ip add 10.1.4.3 24
[SW3-Vlanif30]qu
[SW3]int vlan 10
[SW3-Vlanif10]vrrp vrid 1 virtual-ip 10.1.1.254
[SW3-Vlanif10]vrrp vrid 1 priority 120   //设置本VRRP工作组1在本路由器的优先级为120(默认100.越大越优先,优先者会成为数据的实际转发者)
[SW3-Vlanif10]int vlan 20
[SW3-Vlanif20]vrrp vrid 2 virtual-ip 10.1.2.254
[SW3-Vlanif20]qu
[SW3]stp region-configuration      //配置多生成树实例
[SW3-mst-region]instance 1 vlan 10    //创建生成树实例1映射vlan 10
[SW3-mst-region]instance 2 vlan 20    //创建生成树实例2映射vlan 20
[SW3-mst-region]region-name rg1    //修改本SW的域名为MSTP(默认为SW的背板MAC,全网统一)
[SW3-mst-region]active region-configuration   //激活以上对MSTP的配置 
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW3]stp instance 1 root primary     //本SW-1为生成树实例1的主根桥
[SW3]stp instance 2 root secondary   //本SW-1为生成树实例2的备份根桥
[SW3]ospf
[SW3-ospf-1]area 0
[SW3-ospf-1-area-0.0.0.0]network 10.1.1.0 0.0.0.255
[SW3-ospf-1-area-0.0.0.0]network 10.2.2.0 0.0.0.255
[SW3-ospf-1-area-0.0.0.0]net 10.1.4.0 0.0.0.255


[Huawei]sys SW4
[SW4]int Eth-Trunk 1
[SW4-Eth-Trunk1]trunkport g0/0/1
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW4-Eth-Trunk1]trunkport g0/0/2
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW4-Eth-Trunk1]p l t
[SW4-Eth-Trunk1]p t a v a
[SW4-Eth-Trunk1]int g0/0/3
[SW4-GigabitEthernet0/0/3]qu
[SW4]vlan b 10 20 30
Info: This operation may take a few seconds. Please wait for a moment...done.
[SW4]int g0/0/6
[SW4-GigabitEthernet0/0/6]p d v 30
[SW4-GigabitEthernet0/0/6]int g0/0/5
[SW4-GigabitEthernet0/0/5]p l t
[SW4-GigabitEthernet0/0/5]p t a v a
[SW4-GigabitEthernet0/0/5]int g0/0/4
[SW4-GigabitEthernet0/0/4]p l t
[SW4-GigabitEthernet0/0/4]p t a v a
[SW4-GigabitEthernet0/0/4]qu
[SW4]int vlan 30
[SW4-Vlanif30]ip add 10.1.5.3 24
[SW4-Vlanif30]qu
[SW4]int vlan 20
[SW4-Vlanif20]ip add 10.1.2.4 24
[SW4-Vlanif20]int vlan 10
[SW4-Vlanif10]ip add 10.1.1.4 24
[SW4-Vlanif10]qu
#SW4的vlanif 20为10.1.2.254的主网关,SW3的vlanif 20作为备份10.1.2.254网段的虚拟网关地址为10.1.2.254
[SW4]int vlan 10	
[SW4-Vlanif10]vrrp vrid 1 virtual-ip 10.1.1.254
[SW4-Vlanif10]int v 20	
[SW1-Vlanif20]vrrp vrid 2 virtual-ip 10.1.2.254
[SW4-Vlanif20]vrrp vrid 2 priority 120
//设置本VRRP工作组2在本路由器的优先级为120(默认100.越大越优先,优先者会成为数据的实际转发者)
[SW4]stp instance 1 root secondary 
[SW4]stp instance 2 root primary 
[SW4]ospf
[SW4-ospf-1]area 0
[SW4-ospf-1-area-0.0.0.0]network 10.1.1.0 0.0.0.255
[SW4-ospf-1-area-0.0.0.0]network 10.1.2.0 0.0.0.255
[SW4-ospf-1-area-0.0.0.0]network 10.1.5.0 0.0.0.255
[SW4-ospf-1-area-0.0.0.0]qu
[SW4-ospf-1]
//设置本VRRP工作组2在本路由器的优先级为120(默认100.越大越优先,优先者会成为数据的实际转发者)
[SW4]stp instance 1 root secondary 
[SW4]stp instance 2 root primary

路由器和SW级连链路运行OSPF,SW连接Router的链路接口配置为access;SW之间的级联链路配置为trunk,放行vlan自行决定


[Huawei]sys R
[R]int g0/0/0
[R-GigabitEthernet0/0/0]ip add 10.1.4.1 24
[R-GigabitEthernet0/0/0]int g0/0/1
[R-GigabitEthernet0/0/1]ip add 10.1.5.1 24

[R]int loo 0
[R-LoopBack0]ip add 1.1.1.1 32
[R-LoopBack0]ospf
[R-ospf-1]area 0
[R-ospf-1-area-0.0.0.0]network 10.1.4.0 0.0.0.255
[R-ospf-1-area-0.0.0.0]network 10.1.5.0 0.0.0.255
[R-ospf-1-area-0.0.0.0]network 1.1.1.1 0.0.0.0
[R-ospf-1-area-0.0.0.0]qu

查看SW3、SW4的master和backup

ensp实验 vrrp、mstp案例_第4张图片

  ensp实验 vrrp、mstp案例_第5张图片

 查看R的路由表

ensp实验 vrrp、mstp案例_第6张图片

PC1长pingPC2 切断 SW4与SW2线路,测试MSTP备份是否生效ping 10.1.2.1(生效)ensp实验 vrrp、mstp案例_第7张图片

PC1pingPC2 关闭SW4 ,测试MSTP与BRRP的备份是否生效ping 10.1.2.1 -t (生效)

ensp实验 vrrp、mstp案例_第8张图片

PC1长pingPC2 切断 SW3与SW1线路,测试MSTP备份是否生效ping 10.1.2.1((生效))

ensp实验 vrrp、mstp案例_第9张图片

 PC1pingPC2 关闭SW3,测试MSTP与BRRP的备份是否生效ping 10.1.2.1 -t(生效)

ensp实验 vrrp、mstp案例_第10张图片

你可能感兴趣的:(服务器,网络)