详解配置交换机多生成树MSTP+VRRP 的典型组网

这篇具有很好参考价值的文章主要介绍了详解配置交换机多生成树MSTP+VRRP 的典型组网。希望对大家有所帮助。如果存在错误或未考虑完全的地方,请大家不吝赐教,您也可以点击"举报违法"按钮提交疑问。

详解配置交换机多生成树MSTP+VRRP 的典型组网

详解配置交换机多生成树MSTP+VRRP 的典型组网,网络,网络

组网:

1. 这是一个由三台交换机组成的倒三角型二层交换网络;网络中有4个VLAN:10、20、30、40;接口编号如图所示;SW3为接入层交换机,SW1、SW2为汇聚层交换机;

2. VLAN10对应的网段为192.168.10.0/24;VLAN20对应的网段为192.168.20.0/24;VLAN30对应的网段为192.168.30.0/24;VLAN40对应的网段为192.168.40.0/24;各VLAN的网关均为192.168.x.254的地址,该地址为VRRP组的虚拟地址。

现在要求:

1. 由于网络中VLAN较多,并且存在二层环路,因此使用MSTP实现环路避免,同时实现负载分担。要求VLAN10、VLAN20的流量主走SW1-SW3这一侧链路,VLAN30、VLAN40的流量主走SW2-SW3这一侧链路;

2. 为了提高网络的网关层冗余能力,在SW1及SW2的vlanif10、vlanif20、vlanif30、vlanif40上部署VRRP,一共4组。

二、IP设置:

PC1:192.168.10.1/24,vlan10

PC2:192.168.20.1/24,vlan20

PC3:192.168.30.1/24,vlan30

PC4:192.168.40.1/24,vlan40

SW1:

vlanif10:192.168.10.253/24,virtual-ip:192.168.10.254/24,master

Vlanif20:192.168.20.253/24,virtual-ip:192.168.20.254/24,master

Vlanif30:192.168.30.253/24,virtual-ip:192.168.30.254/24,backup

Vlanif40:192.168.40.253/24,virtual-ip:192.168.40.254/24,backup

SW2:

vlanif10:192.168.10.252/24,virtual-ip:192.168.10.254/24,backup

Vlanif20:192.168.20.252/24,virtual-ip:192.168.20.254/24,backup

Vlanif30:192.168.30.252/24,virtual-ip:192.168.30.254/24,master

Vlanif40:192.168.40.252/24,virtual-ip:192.168.40.254/24,master

三、配置步骤:

由于网络中VLAN较多,并且存在二层环路因此使用MSTP实现环路避免,同时实现负载分担。将VLAN10、20映射到MSTP实例1;将VLAN30、40映射到MSTP实例2。MSTP实例1阻塞掉的端口为SW3的GE0/0/22,实例2阻塞掉的端口为SW3的GE0/0/21。换句话说就是SW1配置为实例1的主根、实例2的次根,而SW2配置为实例2的主根、实例1的次根。这个案例中必须确保VRRP的Master及Backup与MSTP的主、备根重叠。也就是说SW1是MSTP实例1的主根,同时它是vlanif10及vlanif20的VRRP Master,而SW2是MSTP实例2的主根,同时它是vlanif30及vlanif40的VRRP Master。

SW3的配置如下:

#在SW3上创建VLAN,并将接口加入相应的VLAN:

[SW3] vlan batch 10 20 30 40

[SW3] interface GigabitEthernet0/0/21

[SW3-GigabitEthernet0/0/21] port link-type trunk

[SW3-GigabitEthernet0/0/21] port trunk allow-pass vlan 10 20 30 40

[SW3] interface GigabitEthernet0/0/22

[SW3-GigabitEthernet0/0/22] port link-type trunk

[SW3-GigabitEthernet0/0/22] port trunk allow-pass vlan 10 20 30 40

#配置MSTP,将vlan10 20映射到实例1,将vlan30 40映射到实例2。在SW3上,MSTP实例1及实例2的优先级保持默认32768:

[SW3] stp mode mstp

[SW3] stp region-configuration

[SW3-mst-region] region-name huawei

#配置MSTP域名

[SW3-mst-region] instance 1 vlan 10 20

#将VLAN10、20映射到实例1

[SW3-mst-region] instance 2 vlan 30 40

#将VLAN30、40映射到实例2

[SW3-mst-region] active region-configuration #激活配置

[SW3-mst-region] quit

[SW3] stp enable

SW1的配置如下:

[SW1] vlan batch 10 20 30 40

[SW1] interface GigabitEthernet0/0/24

[SW1-GigabitEthernet0/0/24] port link-type trunk

[SW1-GigabitEthernet0/0/24] port trunk allow-pass vlan 10 20 30 40

[SW1] interface GigabitEthernet0/0/21

[SW1-GigabitEthernet0/0/21] port link-type trunk

[SW1-GigabitEthernet0/0/21] port trunk allow-pass vlan 10 20 30 40

#配置MSTP,将VLAN10 20映射到实例1,将VLAN30 40映射到实例2。将SW1的MSTP设置为实例1的主根,实例2的次根:

[SW1] stp mode mstp

[SW1] stp region-configuration

[SW1-mst-region] region-name huawei

[SW1-mst-region] instance 1 vlan 10 20

[SW1-mst-region] instance 2 vlan 30 40

[SW1-mst-region] active region-configuration

[SW1-mst-region] quit

[SW1] stp instance 1 root primary

[SW1] stp instance 2 root secondary

[SW1] stp enable

#配置vlanif10、vlanif20、vlanif30、vlanif40,分别加入VRRP组10,20,30,40。其中SW1为VRRP组10及20的Master,为组30及40的Backup:

[SW1] interface Vlanif 10

[SW1-vlanif10] ip address 192.168.10.253 255.255.255.0

[SW1-vlanif10] vrrp vrid 10 virtual-ip 192.168.10.254

[SW1-vlanif10] vrrp vrid 10 priority 120

[SW1] interface Vlanif 20

[SW1-vlanif20] ip address 192.168.20.253 255.255.255.0

[SW1-vlanif20] vrrp vrid 20 virtual-ip 192.168.20.254

[SW1-vlanif20] vrrp vrid 20 priority 120

[SW1] interface Vlanif 30

[SW1-vlanif30] ip address 192.168.30.253 255.255.255.0

[SW1-vlanif30] vrrp vrid 30 virtual-ip 192.168.30.254

[SW1] interface Vlanif 40

[SW1-vlanif40] ip address 192.168.40.253 255.255.255.0

[SW1-vlanif40] vrrp vrid 40 virtual-ip 192.168.40.254

SW2的配置如下:

[SW2] vlan batch 10 20 30 40

[SW2] interface GigabitEthernet0/0/24

[SW2-GigabitEthernet0/0/24] port link-type trunk

[SW2-GigabitEthernet0/0/24] port trunk allow-pass vlan 10 20 30 40

[SW2] interface GigabitEthernet0/0/22

[SW2-GigabitEthernet0/0/22] port link-type trunk

[SW2-GigabitEthernet0/0/22] port trunk allow-pass vlan 10 20 30 40

#配置MSTP,将VLAN10 20映射到实例1,将VLAN30 40映射到实例2。将SW2的MSTP设置为实例2的主根,实例1的次根:

[SW2] stp mode mstp

[SW2] stp region-configuration

[SW2-mst-region] region-name huawei

[SW2-mst-region] instance 1 vlan 10 20

[SW2-mst-region] instance 2 vlan 30 40

[SW2-mst-region] active region-configuration

[SW2-mst-region] quit

[SW2] stp instance 1 root secondary

[SW2] stp instance 2 root primary

[SW2] stp enable

#配置vlanif10、vlanif20、vlanif30、vlanif40,分别加入VRRP组10,20,30,40。其中SW1为VRRP组30及40的Master,为组10及20的Backup

[SW2] interface Vlanif 10

[SW2-vlanif10] ip address 192.168.10.252 255.255.255.0

[SW2-vlanif10] vrrp vrid 10 virtual-ip 192.168.10.254

[SW2] interface Vlanif 20

[SW2-vlanif20] ip address 192.168.20.252 255.255.255.0

[SW2-vlanif20] vrrp vrid 20 virtual-ip 192.168.20.254

[SW2] interface Vlanif 30

[SW2-vlanif30] ip address 192.168.30.252 255.255.255.0

[SW2-vlanif30] vrrp vrid 30 virtual-ip 192.168.30.254

[SW2-vlanif30] vrrp vrid 30 priority 120

[SW2] interface Vlanif 40

[SW2-vlanif40] ip address 192.168.40.252 255.255.255.0

[SW2-vlanif40] vrrp vrid 40 virtual-ip 192.168.40.254

[SW2-vlanif40] vrrp vrid 40 priority 120

完成配置后,各VLAN的用户都能够ping通自己的网关,在SW3上看看:

<SW3>dis stp bri

MSTID Port Role STP State Protection

0 GigabitEthernet0/0/1 DESI FORWARDING NONE

0 GigabitEthernet0/0/2 DESI FORWARDING NONE

0 GigabitEthernet0/0/3 DESI LEARNING NONE

0 GigabitEthernet0/0/4 DESI LEARNING NONE

0 GigabitEthernet0/0/21 DESI FORWARDING NONE

0 GigabitEthernet0/0/22 ROOT FORWARDING NONE

1 GigabitEthernet0/0/1 DESI FORWARDING NONE

1 GigabitEthernet0/0/2 DESI FORWARDING NONE

1 GigabitEthernet0/0/21 ROOT FORWARDING NONE

1 GigabitEthernet0/0/22 ALTE DISCARDING NONE

2 GigabitEthernet0/0/3 DESI LEARNING NONE

2 GigabitEthernet0/0/4 DESI LEARNING NONE

2 GigabitEthernet0/0/21 ALTE DISCARDING NONE

2 GigabitEthernet0/0/22 ROOT FORWARDING NONE

在SW3上我们看到,MSTP实例1中被Block掉的端口是GE0/0/22口;MSTP实例2中被Block掉的端口是GE0/0/21,符合需求。再去SW1上看看VRRP组的状态:

<SW1>display vrrp bri

VRID State Interface Type Virtual IP

----------------------------------------------------------------

10 Master Vlanif10 Normal 192.168.10.254

20 Master Vlanif20 Normal 192.168.20.254

30 Backup Vlanif30 Normal 192.168.30.254

40 Backup Vlanif40 Normal 192.168.40.254

----------------------------------------------------------------

Total:4 Master:2 Backup:2 Non-active:0

从上述输出可以看出,SW1为VRRP组10及组20的Master,同时也为VRRP组30和组40的Backup。

<SW2>display vrrp bri

VRID State Interface Type Virtual IP

----------------------------------------------------------------

10 Backup Vlanif10 Normal 192.168.10.254

20 Backup Vlanif20 Normal 192.168.20.254

30 Master Vlanif30 Normal 192.168.30.254

40 Master Vlanif40 Normal 192.168.40.254

----------------------------------------------------------------

Total:4 Master:2 Backup:2 Non-active:0

而SW2则正好相反。如此一来,VLAN10及VLAN20用户访问外网的流量将SW3-SW1的路径转发,VLAN30及VLAN40用户访问外网的流量将SW2-SW1的路径转发。当网络中的链路发生故障时,将会启用另一条备份链路,业务不受影响。

四、SW3的主要配置文件:

#

sysname SW3

#

vlan batch 10 20 30 40

#

stp region-configuration

region-name huawei

instance 1 vlan 10 20

instance 2 vlan 30 40

active region-configuration

#

interface GigabitEthernet0/0/1

port link-type access

port default vlan 10

#

interface GigabitEthernet0/0/2

port link-type access

port default vlan 20

#

interface GigabitEthernet0/0/3

port link-type access

port default vlan 30

#

interface GigabitEthernet0/0/4

port link-type access

port default vlan 40

#

interface GigabitEthernet0/0/21

port link-type trunk

port trunk allow-pass vlan 10 20 30 40

#

interface GigabitEthernet0/0/22

port link-type trunk

port trunk allow-pass vlan 10 20 30 40

#

return文章来源地址https://www.toymoban.com/news/detail-637334.html

五、SW1的主要配置文件:

<SW1>disp cu

#

sysname SW1

#

vlan batch 10 20 30 40

#

stp instance 1 root primary

stp instance 2 root secondary

#

stp region-configuration

region-name huawei

instance 1 vlan 10 20

instance 2 vlan 30 40

active region-configuration

#

interface Vlanif10

ip address 192.168.10.253 255.255.255.0

vrrp vrid 10 virtual-ip 192.168.10.254

vrrp vrid 10 priority 120

#

interface Vlanif20

ip address 192.168.20.253 255.255.255.0

vrrp vrid 20 virtual-ip 192.168.20.254

vrrp vrid 20 priority 120

#

interface Vlanif30

ip address 192.168.30.253 255.255.255.0

vrrp vrid 30 virtual-ip 192.168.30.254

#

interface Vlanif40

ip address 192.168.40.253 255.255.255.0

vrrp vrid 40 virtual-ip 192.168.40.254

#

interface MEth0/0/1

#

interface GigabitEthernet0/0/1

port link-type trunk

port trunk allow-pass vlan 10 20 30 40

#

interface GigabitEthernet0/0/2

port link-type trunk

port trunk allow-pass vlan 10 20 30 40

#

return

六、SW2的主要配置文件:

#

sysname SW2

#

vlan batch 10 20 30 40

#

stp instance 1 root secondary

stp instance 2 root primary

#

stp region-configuration

region-name huawei

instance 1 vlan 10 20

instance 2 vlan 30 40

active region-configuration

#

interface Vlanif10

ip address 192.168.10.252 255.255.255.0

vrrp vrid 10 virtual-ip 192.168.10.254

#

interface Vlanif20

ip address 192.168.20.252 255.255.255.0

vrrp vrid 20 virtual-ip 192.168.20.254

#

interface Vlanif30

ip address 192.168.30.252 255.255.255.0

vrrp vrid 30 virtual-ip 192.168.30.254

vrrp vrid 30 priority 120

#

interface Vlanif40

ip address 192.168.40.252 255.255.255.0

vrrp vrid 40 virtual-ip 192.168.40.254

vrrp vrid 40 priority 120

#

interface MEth0/0/1

#

interface GigabitEthernet0/0/1

port link-type trunk

port trunk allow-pass vlan 10 20 30 40

#

interface GigabitEthernet0/0/2

port link-type trunk

port trunk allow-pass vlan 10 20 30 40

#

return

到了这里,关于详解配置交换机多生成树MSTP+VRRP 的典型组网的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请点击违法举报进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用

相关文章

  • H3C交换机+路由器配置VRRP路由冗余

    一、先上拓扑:  二、简介: 注意:下文均为笔者根据自己理解所写,可能存在不准确(所用名词或解释不够专业性),请自行斟酌,不过可以确认的是,通过本文配置,读者可以大体理解标题所述(VRRP)的配置方法和部分特性,可以配置出一个 基本的 VRRP环境。 1、vrrp(

    2024年02月06日
    浏览(34)
  • 在ensp中三层交换机(划分vlan)和vrrp案例

    目录 三层交换机         工作原理         三层交换机的配置原则         三层交换机的接口 VRRP         作用                概念         配置步骤 ensp中的案例         案例一:三层交换机划分vlan         案例二:两个三层交换机        

    2024年02月04日
    浏览(32)
  • 交换机IP组播配置详解

    1、IP组播简介 IP组播在一些多用户定向发送的网络应用中使用非常普遍,如远程多媒体会议、远程教学、视频点播、定向电子商务,以及ISP的IPTV(网络电视)等。而这些应用又是目前最热门的互联网应用,在大多数公司中都有一些这类应用,所以学好IP组播基础知识及配置与

    2024年02月02日
    浏览(20)
  • 锐捷交换机链路聚合相关原理配置详解

    应用场景: 当交换机上面存在多条冗余链路,希望与对端网络设备进行一个捆绑聚合,比如汇聚与核心交换机互联的链路,或者是双核心、多核心环网的组网模式时,通过端口聚合可以提升他们之间链路的带宽,同时提供链路冗余备份的效果,避免链路单点故障,影响关键节

    2024年02月13日
    浏览(77)
  • 如何配置静态路由?这个实例详解交换机的静态路由配置

    静态路由 是一种 路由的方式 ,它需要通过 手动配置。 静态路由与动态路由不同, 静态路由是固定的,不会改变。 一般来说,静态路由是由网络管理员逐项加入路由表,简单来说,就是需要手动添加的。 问:手动添加有什么好处呢? 答:稳定,可靠 静态路由在交换机中有

    2024年02月04日
    浏览(46)
  • H3C交换机配置基本命令详解

    H3C交换机配置基本命令详解 随着移动互联网趋势加快以及智能终端的.快速普及,WLAN应用需求在全球保持高速增长态势。下面是小编整理的关于H3C交换机配置基本命令详解,希望大家认真阅读! 1、配置主机名 [H3C]systemname H3C 2、配置console口密码 # 进入系统视图。 system-view # 进

    2024年02月03日
    浏览(34)
  • 三层交换机/路由器OSPF配置详解【华为eNSP实验】

    下文下载或文章顶部资源绑定处下载。 https://download.csdn.net/download/weixin_52908342/88526847 之前我们已经成功配置了VRRP+MSTP在三层交换机与路由器之间的使用。 现在我们来记录一下三层交换机/路由器OSPF配置详解。 需求如下: 5.公司网络需要在两台汇聚层交换机和一台核心路由器

    2024年02月02日
    浏览(47)
  • VRRP+MSTP+ospf配置详解

    一.vrrp (Virtual Router Redundancy Protocol) 虚拟路由冗余协议     VRRP是解决局域网中静态网关出现单点失效的协议 VRRP广泛应用在边缘网络中,它的设计目标是支持特定情况下IP数据流量失败转移不会引起混乱,允许主机使用单路由器,以及即使在实际第一跳路由器使用失败的

    2024年02月09日
    浏览(25)
  • 【eNSP实践】eNSP实战篇(2)之简单实现交换机与主机的配置(图文详解)

    其实前面文章我有介绍关于路由器的使用,但是有不少网友私信我说:“博主,我是一个小白,能不能讲一下路由器和交换机他们有啥子区别啊,我整天看这个头西昏”。那么我也就罗列一下大致区别如下: 交换机是将不同IP地址的电脑连在一起,共享一根网线;路由器是将

    2024年01月24日
    浏览(25)
  • 华为交换机配置命令 华为QuidWay交换机配置命令手册

    1、开始 建立本地配置环境,将主机的串口通过配置电缆与以太网交换机的Console口连接。 在主机上运行终端仿真程序(如Windows的超级终端等),设置终端通信参数为:波特率为9600bit/s、8位数据位、1位停止位、无校验和无流控,并选择终端类型为VT100。 以太网交换机上电,终

    2024年02月05日
    浏览(34)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包