下载安卓APP箭头
箭头给我发消息

客服QQ:3315713922

使用华为交换机实现VRRP+MSTP配置实验

作者:课课家教育     来源: http://www.kokojia.com点击数:3625发布时间: 2019-03-07 14:24:43

标签: 华为交换机VRRP+MSTP

软考,您想通过吗?一次通过才是硬道理

  下面我要分享的内容是VRRP+MSTP配置,有需要的朋友可以参考学习。

  1、MSTP技术概述

  简单的来说,MSTP就是基于VLAN的RSTP。MSTP是在传统的STP、RSTP的基础上发展而来的生成树协议,包含了RSTP的快速FORWARDING机制。

  交换机A、B在VLAN1内,交换机C、D在VLAN2内,连成环路。

 使用华为交换机实现VRRP+MSTP配置实验_华为_交换机_VRRP+MSTP_课课家教育

  若新建STP或RSTP,在某种配置在,会把交换机A和B间的链路给discarding。

使用华为交换机实现VRRP+MSTP配置实验_华为_交换机_VRRP+MSTP_课课家教育

  交换机C、D无法转发VLAN1的数据包,交换机A的VLAN1就无法与交换机B的VLAN1进行通讯。

  MSTP把一台交换机的一个换多个VLAN换分为一个instance,有着相同的instance配置的交换机就组成一个域(MST region),运行独立的生成树(IST,internal spanning-tree);这个MST region就相当于一个大的交换机,与其他MST region再进行生成树算法运算,得出一个整体的生成树,称为CST(common spanning tree)。

  交换机A、B在region 1内,region 1没有环路产生,所以没有链路discarding,同理region 2也是一样。

  Region 1和region 2就分别相当于两个大的交换机,这两台“交换机”间有环路,因此根据相关配置选择一条链路discarding。

 使用华为交换机实现VRRP+MSTP配置实验_华为_交换机_VRRP+MSTP_课课家教育

  2、VRRP技术概述

  随着Internet的发展,人们对网络可靠性、安全性的要求越来越高。对于终端用户来说,希望事实与网络其它部分保持通信。VRRP是一种容错协议,它保证当主机的下一跳路由器失效时,可以及时由另一台路由器代替,从而保持通信的连续性和可靠性。

  为了使VRRP工作,要在路由器上配置虚拟路由器号和虚拟IP地址,同时会产生一个虚拟的MAC(00-005E-00-01-[VRID])地址。这样在这个网络中就加入一个虚拟路由器。

  一个虚拟路由器由一个主路由器和若干备份路由器组成,住路由器实现真正的转发功能。当主路由器初夏故障时,一个备份路由器将成为新的主路由器,接替它的工作。

  VRRP将局域网的一组路由器,如图中的路由器A和B组成一个虚拟的路由器。这个虚拟的路由器拥有自己的IP地址192.168.66.1(这个IP地址可以和某个路由器的接口地址相同),虚拟MAC地址为:00-00-5E-00-01[VRID]。同时,物理路由器A和B也有自己的IP地址。局域网内的主机仅仅知道这个虚拟路由器的IP地址192.168.66.1,而并不知道具体的交换机的IP地址以及交换机B的IP地址。网络内的主机就通过这个虚拟的路由器来与其他网络进行通信。

使用华为交换机实现VRRP+MSTP配置实验_华为_交换机_VRRP+MSTP_课课家教育

  3、实验配置

  1)实验拓扑图如下:

使用华为交换机实现VRRP+MSTP配置实验_华为_交换机_VRRP+MSTP_课课家教育

  2)实验简介:从拓扑可以看到,利用两个华为S5700作为主备核心,在其上建立VLAN 20和30作为业务VLAN,建立VLAN100作为为心跳vlan;利用华为S3700作为接入交换机,直接和PC相连,在S3700上建立Vlan20和Vlan30等业务vlan。

  3)具体规划配置如下:

  在S5700-Master规划如下:

  l 创建vlan 10

  interface vlanif 10 :192.168.10.1 24

  Virtual IP : 192.168.10.254

  l 创建vlan 20

  interface vlanif 20:192.168.20.1 24

  Virtual IP : 192.168.20.254

  l 创建vlan 100

  interface vlanif 100:100.100.100.1 24

  l 创建interface Eth-Trunk 1,并配置为Trunk,只允许vlan100通过,将GE0/0/1和GE0/0/2端口加入到Eth-Trunk1中。

  l 配置GE0/0/3和GE0/0/4的端口类型为Trunk端口,为了精确只允许业务Vlan通过

  在S5700-Backup规划如下:

  l 创建vlan 10

  interface vlanif 10 :192.168.10.2 24

  Virtual IP : 192.168.10.254

  l 创建vlan 20

  interface vlanif 20:192.168.20.2 24

  Virtual IP : 192.168.20.254

  l 创建vlan 100

  interface vlanif 100:100.100.100.2 24

  l 创建interface Eth-Trunk 1,并配置为Trunk,只允许vlan100通过,将GE0/0/1和GE0/0/2端口加入到Eth-Trunk1中。

  l 配置GE0/0/3和GE0/0/4的端口类型为Trunk端口,为了精确,只允许业务Vlan通过。

  备注:1、在S5700交换机与S3700交换机相连的端口上开启STP,其模式是MSTP,默认的情况下华为交换机是开启的,如果没有开启,请手动开启;

  S3700A配置规划如下:

  l 创建vlan 10 20 ;

   将Ethernet0/0/3和Ethernet0/0/4的端口类型为Trunk,只要允许业务vlan10 和vlan20 通过即可;

  S3700B配置规划如下:

  l 创建vlan 10 20 ;

   将Ethernet0/0/3和Ethernet0/0/4的端口类型为Trunk,只要允许业务vlan10 和vlan20 通过即可;

  4、具体配置如下

  l S5700_Master的配置

  dis cu

  #

  sysname A

  #

  undo info-center enable

  #

  vlan batch 10 20 100

  #

  cluster enable

  ntdp enable

  ndp enable

  #

  drop illegal-mac alarm

  #

  diffserv domain default

  #

  drop-profile default

  #

  aaa

  authentication-scheme default

  authorization-scheme default

  accounting-scheme default

  domain default

  domain default_admin

  local-user admin password simple admin

  local-user admin service-type http

  #

  interface Vlanif1

  #

  interface Vlanif10

  ip address 192.168.10.1 255.255.255.0

  vrrp vrid 10 virtual-ip 192.168.10.254

  vrrp vrid 10 priority 120

  vrrp vrid 10 preempt-mode timer delay 5

  #

  interface Vlanif20

  ip address 192.168.20.1 255.255.255.0

  vrrp vrid 20 virtual-ip 192.168.20.254

  vrrp vrid 20 priority 120

  vrrp vrid 20 preempt-mode timer delay 5

  #

  interface Vlanif100

  ip address 100.100.100.1 255.255.255.0

  #

  interface MEth0/0/1

  #

  interface Eth-Trunk1

  port link-type trunk

  port trunk allow-pass vlan 100

  #

  interface GigabitEthernet0/0/1

  eth-trunk 1

  #

  interface GigabitEthernet0/0/2

  eth-trunk 1

  #

  interface GigabitEthernet0/0/3

  port link-type trunk

  port trunk allow-pass vlan 10 20

  #

  interface GigabitEthernet0/0/4

  port link-type trunk

  port trunk allow-pass vlan 10 20

  interface NULL0

  #

  user-interface con 0

  user-interface vty 0 4

  #

  return

  l S5700_Backup的配置

  dis cu

  #

  sysname B

  #

  undo info-center enable

  #

  vlan batch 10 20 100

  #

  cluster enable

  ntdp enable

  ndp enable

  #

  drop illegal-mac alarm

  #

  diffserv domain default

  #

  drop-profile default

  #

  aaa

  authentication-scheme default

  authorization-scheme default

  accounting-scheme default

  domain default

  domain default_admin

  local-user admin password simple admin

  local-user admin service-type http

  #

  interface Vlanif1

  #

  interface Vlanif10

  ip address 192.168.10.2 255.255.255.0

  vrrp vrid 10 virtual-ip 192.168.10.254

  #

  interface Vlanif20

  ip address 192.168.20.2 255.255.255.0

  vrrp vrid 20 virtual-ip 192.168.20.254

  #

  interface Vlanif100

  ip address 100.100.100.2 255.255.255.0

  #

  interface MEth0/0/1

  #

  interface Eth-Trunk1

  port link-type trunk

  port trunk allow-pass vlan 100

  #

  interface GigabitEthernet0/0/1

  eth-trunk 1

  #

  interface GigabitEthernet0/0/2

  eth-trunk 1

  #

  interface GigabitEthernet0/0/3

  port link-type trunk

  port trunk allow-pass vlan 10 20

  #

  interface GigabitEthernet0/0/4

  port link-type trunk

  port trunk allow-pass vlan 10 20

  #

  user-interface con 0

  user-interface vty 0 4

  #

  return

  l S3700A的配置

  dis cu

  #

  sysname S3700A

  #

  undo info-center enable

  #

  vlan batch 10 20

  #

  cluster enable

  ntdp enable

  ndp enable

  #

  drop illegal-mac alarm

  #

  diffserv domain default

  #

  drop-profile default

  #

  aaa

  authentication-scheme default

  authorization-scheme default

  accounting-scheme default

  domain default

  domain default_admin

  local-user admin password simple admin

  local-user admin service-type http

  #

  interface Vlanif1

  #

  interface MEth0/0/1

  #

  interface Ethernet0/0/1

  port link-type Access

  port default vlan 10

  #

  interface Ethernet0/0/2

  #

  interface Ethernet0/0/3

  port link-type trunk

  port trunk allow-pass vlan 10 20

  #

  interface Ethernet0/0/4

  port link-type trunk

  port trunk allow-pass vlan 10 20

  #

  user-interface con 0

  user-interface vty 0 4

  #

  return

  l S3700B的配置如下

  dis cu

  #

  sysname S3700B

  #

  undo info-center enable

  #

  vlan batch 10 20

  #

  cluster enable

  ntdp enable

  ndp enable

  #

  drop illegal-mac alarm

  #

  diffserv domain default

  #

  drop-profile default

  #

  aaa

  authentication-scheme default

  authorization-scheme default

  accounting-scheme default

  domain default

  domain default_admin

  local-user admin password simple admin

  local-user admin service-type http

  #

  interface Vlanif1

  #

  interface MEth0/0/1

  #

  interface Ethernet0/0/1

  port link-type access

  port default vlan 20

  #

  interface Ethernet0/0/2

  #

  interface Ethernet0/0/3

  port link-type trunk

  port trunk allow-pass vlan 10 20

  #

  interface Ethernet0/0/4

  port link-type trunk

  port trunk allow-pass vlan 10 20

  #

  user-interface con 0

  user-interface vty 0 4

  #

  return

 5、利用display命令查看VRRP的运行情况

  dis vrrp

  Vlanif10 | Virtual Router 10

  State : Backup

  Virtual IP : 192.168.10.254

  Master IP : 192.168.10.1

  PriorityRun : 100

  PriorityConfig : 100

  MasterPriority : 120

  Preempt : YES Delay Time : 0 s

  TimerRun : 1 s

  TimerConfig : 1 s

  Auth type : NONE

  Virtual MAC : 0000-5e00-010a

  Check TTL : YES

  Config type : normal-vrrp

  Create time : 2012-11-21 17:02:12 UTC-08:00

  Last change time : 2012-11-21 17:05:36 UTC-08:00

  Vlanif20 | Virtual Router 20

  State : Backup

  Virtual IP : 192.168.20.254

  Master IP : 192.168.20.1

  PriorityRun : 100

  PriorityConfig : 100

  MasterPriority : 120

  Preempt : YES Delay Time : 0 s

  TimerRun : 1 s

  TimerConfig : 1 s

  Auth type : NONE

  Virtual MAC : 0000-5e00-0114

  Check TTL : YES

  Config type : normal-vrrp

  Create time : 2012-11-21 17:02:12 UTC-08:00

  Last change time : 2012-11-21 17:05:36 UTC-08:00

  dis vrrp

  Vlanif10 | Virtual Router 10

  State : Master

  Virtual IP : 192.168.10.254

  Master IP : 192.168.10.1

  PriorityRun : 120

  PriorityConfig : 120

  MasterPriority : 120

  Preempt : YES Delay Time : 5 s

  TimerRun : 1 s

  TimerConfig : 1 s

  Auth type : NONE

  Virtual MAC : 0000-5e00-010a

  Check TTL : YES

  Config type : normal-vrrp

  Create time : 2012-11-21 17:05:18 UTC-08:00

  Last change time : 2012-11-21 17:05:35 UTC-08:00

  Vlanif20 | Virtual Router 20

  State : Master

  Virtual IP : 192.168.20.254

  Master IP : 192.168.20.1

  PriorityRun : 120

  PriorityConfig : 120

  MasterPriority : 120

  Preempt : YES Delay Time : 5 s

  TimerRun : 1 s

  TimerConfig : 1 s

  Auth type : NONE

  Virtual MAC : 0000-5e00-0114

  Check TTL : YES

  Config type : normal-vrrp

  Create time : 2012-11-21 17:05:18 UTC-08:00

  Last change time : 2012-11-21 17:05:35 UTC-08:00

  今天的分享就到这,希望大家都能学会。如果有什么不妥之处,希望大家改正。那就来课课家教育或关注公众号【课课家IT精品课程】与我们交流讨论吧!

赞(0)
踩(1)
分享到:
推荐查看
华为认证网络工程师 HCIE直播课视频教程