ensp实验 vrrp、mstp案例

PC机配置地址

 

<SW1>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
<SW1>

路由器和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

  

 查看R的路由表

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

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

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

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

  • 9
    点赞
  • 63
    收藏
    觉得还不错? 一键收藏
  • 2
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 2
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值