首页 > 其他分享 >23-2 MSTP+VRRP实验

23-2 MSTP+VRRP实验

时间:2023-11-20 14:34:11浏览次数:32  
标签:GigabitEthernet0 23 ip MSTP 192.168 VRRP 8.8 interface port

拓扑

配置VRRP+MSTP,使得PC1和PC2通信始终通过最优路径

image

基础配置(VLAN+IP)

LSW1

#
interface GigabitEthernet0/0/1
 port link-type trunk
 port trunk allow-pass vlan 8 to 9
#
interface GigabitEthernet0/0/2
 port link-type trunk
 port trunk allow-pass vlan 8 to 9
#
interface GigabitEthernet0/0/4
 port link-type access
#
interface Vlanif1
 ip address 12.1.1.1 255.255.255.0
#
interface Vlanif8
 ip address 192.168.1.1 255.255.255.0
#
interface Vlanif9
 ip address 192.168.2.1 255.255.255.0

LSW2

#
interface Vlanif1
 ip address 12.1.2.1 255.255.255.0
#
interface Vlanif8
 ip address 192.168.1.2 255.255.255.0
#
interface Vlanif9
 ip address 192.168.2.2 255.255.255.0
#
interface GigabitEthernet0/0/1
 port link-type trunk
 port trunk allow-pass vlan 8 to 9
#
interface GigabitEthernet0/0/3
 port link-type trunk
 port trunk allow-pass vlan 8 to 9
#
interface GigabitEthernet0/0/4
 port link-type access

LSW3

#
interface GigabitEthernet0/0/2
 port link-type trunk
 port trunk allow-pass vlan 8 to 9
#
interface GigabitEthernet0/0/3
 port link-type trunk
 port trunk allow-pass vlan 8 to 9
#
interface GigabitEthernet0/0/4
 port link-type access
 port default vlan 8
#
interface GigabitEthernet0/0/5
 port link-type access
 port default vlan 9

AR2

#
interface GigabitEthernet0/0/0
 ip address 12.1.1.2 255.255.255.0 
#
interface GigabitEthernet0/0/1
 ip address 12.1.2.2 255.255.255.0
 #
interface LoopBack1
 ip address 8.8.8.8 255.255.255.255 

路由配置

LSW1

[LSW1]ip route-static 0.0.0.0 0 12.1.1.2

LSW2

[LSW2]ip route-static 0.0.0.0 0 12.1.2.2

AR2

[AR2]ip route-static 192.168.1.0 24 12.1.1.1 preference 50
[AR2]ip route-static 192.168.1.0 24 12.1.2.1
[AR2]ip route-static 192.168.2.0 24 12.1.2.1 preference 50
[AR2]ip route-static 192.168.2.0 24 12.1.1.1

MSTP配置

LSW1

#
stp region-configuration
 region-name gls.com
 revision-level 1
 instance 1 vlan 8
 instance 2 vlan 9
 active region-configuration
#
stp instance 1 priority 0
stp instance 2 priority 4096

LSW2

#
stp region-configuration
 region-name gls.com
 revision-level 1
 instance 1 vlan 8
 instance 2 vlan 9
 active region-configuration
#
stp instance 1 priority 4096
stp instance 2 priority 0

LSW3

#
stp region-configuration
 region-name gls.com
 revision-level 1
 instance 1 vlan 8
 instance 2 vlan 9
 active region-configuration

MSTP配置认证

[LSW3]dis stp instance 1 brief
 MSTID  Port                        Role  STP State     Protection
   1    GigabitEthernet0/0/2        ROOT  FORWARDING      NONE
   1    GigabitEthernet0/0/3        ALTE  DISCARDING      NONE
   1    GigabitEthernet0/0/4        DESI  FORWARDING      NONE
[LSW3]dis stp instance 2 brief
 MSTID  Port                        Role  STP State     Protection
   2    GigabitEthernet0/0/2        ALTE  DISCARDING      NONE
   2    GigabitEthernet0/0/3        ROOT  FORWARDING      NONE
   2    GigabitEthernet0/0/5        DESI  FORWARDING      NONE

VRRP配置

LSW1

#
interface Vlanif8
 ip address 192.168.1.1 255.255.255.0
 vrrp vrid 1 virtual-ip 192.168.1.254
 vrrp vrid 1 priority 200
#
interface Vlanif9
 ip address 192.168.2.1 255.255.255.0
 vrrp vrid 2 virtual-ip 192.168.2.254

LSW2

#
interface Vlanif8
 ip address 192.168.1.2 255.255.255.0
 vrrp vrid 1 virtual-ip 192.168.1.254
#
interface Vlanif9
 ip address 192.168.2.2 255.255.255.0
 vrrp vrid 2 virtual-ip 192.168.2.254
 vrrp vrid 2 priority 200

VRRP配置验证

[LSW1]dis vrrp brief 
VRID  State        Interface                Type     Virtual IP     
----------------------------------------------------------------
1     Master       Vlanif8                  Normal   192.168.1.254  
2     Backup       Vlanif9                  Normal   192.168.2.254  
----------------------------------------------------------------
Total:2     Master:1     Backup:1     Non-active:0     
[LSW2]dis vrrp brief
VRID  State        Interface                Type     Virtual IP     
----------------------------------------------------------------
1     Backup       Vlanif8                  Normal   192.168.1.254  
2     Master       Vlanif9                  Normal   192.168.2.254  
----------------------------------------------------------------
Total:2     Master:1     Backup:1     Non-active:0 

连通测试

PC1 ping AR2

PC>ping 8.8.8.8

Ping 8.8.8.8: 32 data bytes, Press Ctrl_C to break
From 8.8.8.8: bytes=32 seq=1 ttl=254 time=63 ms

--- 8.8.8.8 ping statistics ---
  1 packet(s) transmitted
  1 packet(s) received
  0.00% packet loss
  round-trip min/avg/max = 63/63/63 ms

路径
image

PC2 ping AR2

PC>ping 8.8.8.8

Ping 8.8.8.8: 32 data bytes, Press Ctrl_C to break
From 8.8.8.8: bytes=32 seq=1 ttl=254 time=141 ms

--- 8.8.8.8 ping statistics ---
  1 packet(s) transmitted
  1 packet(s) received
  0.00% packet loss
  round-trip min/avg/max = 141/141/141 ms

路径
image

当VRRP主和MSTP根交换机不在同一交换机上PC1到AR2,PC2到AR2路径如下
image

image

标签:GigabitEthernet0,23,ip,MSTP,192.168,VRRP,8.8,interface,port
From: https://www.cnblogs.com/Metkey/p/17843035.html

相关文章

  • C#学习2023年11月11日 事件和接口
    事件(下)事件的约定事件与委托类的概念class实例构造器析构函数类的声明与定义类的继承一个子类实例必然也是父类实例is关键字,判断是否是类的实例调用子类构造器,首先调用父类构造器基于类的继承,基于原型的继承方法重写与多态//virtualoverride......
  • 2023 NOIp 游记
    前言CSP-S当时没写是害怕当小丑,NOIp反正可能要退役了,就没有什么小丑可言了,就先写了。CSP-S游记Day-20~0在CDQZ集训,联考的成绩也还行,但是一直被CDQZ和其他学校的高一薄纱,感觉要退役了qwq。考前两天还跑去QG联考了,成绩还行,也算有点信心,但是还是很担心。考前一天没有......
  • 2023 CSP-S 游记
    前言其实老早就想写的,但是一想到可能挂分就先没写,现在正式的获奖名单也出了,就不担心当小丑了,就跑来写游记了。NOIp游记Day0一直在颓废,多年的考试告诉我,考前复习是要掉RP的!不过Cu机房大佬好像一直在卷,可恶。Day1很早就到考点了,但是不想进去罚坐,就等了会儿再进去。还......
  • noip2023 题解(民间数据)
    P9868[NOIP2023]词典(民间)直接把每个串\(w_i\)都从大到小/从小到大排一下,记作\(a_i,b_i\)。如果\(b_i\)小于除了\(i\)之外的所有\(a_i\),说明可以,否则不行。求一个前后缀最大值即可。复杂度\(\mathcal{O}(26n+nm)\)。点击查看代码#include<bits/stdc++.h>usingname......
  • Spring_2023_11_20_1
    Spring基础依赖pom依赖<!--Spring基础包括:Spring-core/Spring-beans/Spring-app/Spring-expression--><dependency><groupId>org.springframework</groupId><artifactId>spring-context</artifactId&......
  • 2023第四季北京/杭州/青岛/深圳DAMA-CDGA/CDGP认证备考
    DAMA认证为数据管理专业人士提供职业目标晋升规划,彰显了职业发展里程碑及发展阶梯定义,帮助数据管理从业人士获得企业数字化转型战略下的必备职业能力,促进开展工作实践应用及实际问题解决,形成企业所需的新数字经济下的核心职业竞争能力。DAMA是数据管理方面的认证,帮助数据从业者提升......
  • 2023第四季北京/杭州/青岛/深圳CDGP认证报名到这儿
    DAMA认证为数据管理专业人士提供职业目标晋升规划,彰显了职业发展里程碑及发展阶梯定义,帮助数据管理从业人士获得企业数字化转型战略下的必备职业能力,促进开展工作实践应用及实际问题解决,形成企业所需的新数字经济下的核心职业竞争能力。DAMA是数据管理方面的认证,帮助数据从业者提升......
  • NOIP 2023 游记
    NOIP2023游记赛前HF周四下午就放了,回家好好休息休息。周五上午睡了个懒觉,玩了会游戏。下午被我妈拉出去骑车,骑到一半,涵说他们因为教师研讨会放假,在图书馆写作业。说有个挂件想给我,然后就把我妈丢下骑车过去。一共52km,晚上8点才回到家。后来考完我妈和HF说了骑车这件......
  • 2023 互测 R2T1 序列的线性做法
    把原题做法GF的系数进行OEIS,发现那个三角形就是Catalan数的GF复合上一个\(xy(1-x)\)的形式。更为奇妙的是,OEIS下面竟然给出了一个通项公式,\(T(n,k)=(-1)^{n-k}{k\choosen-k}C_k\),其中\(C\)是Catalan数列。代入原题的式子,发现答案竟然就是:\[\sum_{i=0}^n(-1)^{n......
  • 【2023-11-15】亲情最美
    20:00年轻的时候以为不读书不足以了解人生,直到后来才发现如果不了解人生,是读不懂书的。读书的意义大概就是用生活所感去读书,用读书所得去生活吧。                                        ......