一招鲜——交换机配置mstp+vrrp实验

实验一:R1和R2上的g0/0/0配置子接口,使得PC1和PC2能ping通3.3.3.3使得R1和SW1中间的线路故障,依然可以ping通3.3.3.3

一招鲜——交换机配置mstp+vrrp实验_第1张图片
配置R1
一招鲜——交换机配置mstp+vrrp实验_第2张图片
配置R2
一招鲜——交换机配置mstp+vrrp实验_第3张图片
配置R3
一招鲜——交换机配置mstp+vrrp实验_第4张图片

**R1**
[Huawei]sys R1
[R1]int g0/0/0
[R1-GigabitEthernet0/0/0]ip a 192.168.10.1 24
Apr 12 2021 18:15:09-08:00 R1 %%01IFNET/4/LINK_STATE(l)[0]:The line protocol IP 
on the interface GigabitEthernet0/0/0 has entered the UP state. 
[R1-GigabitEthernet0/0/0]int g0/0/1
[R1-GigabitEthernet0/0/1]ip a 192.168.20.1 24
[R1]ip route-static 192.168.2.0 24 192.168.10.2
[R1]ip route-static 192.168.2.0 24 192.168.20.2
[R1]ip route-static 192.168.1.0 24 192.168.10.2
[R1]ip route-static 192.168.1.0 24 192.168.20.2
**R2**

[Huawei]sys R2
[R2]int g0/0/0
[R2-GigabitEthernet0/0/0]ip a 192.168.10.2 24
[R2-GigabitEthernet0/0/0]ip route-static 0.0.0.0 0 192.168.10.1
[R2]ip route-static 0.0.0.0 0 192.168.10.1
[R2]int g0/0/1.1
[R2-GigabitEthernet0/0/1.1]ip a 192.168.1.252 24
[R2-GigabitEthernet0/0/1.1]d t v 10
[R2-GigabitEthernet0/0/1.1]a b e
[R2-GigabitEthernet0/0/1.1]vrrp vrid 1 virtual-ip 192.168.1.254
[R2-GigabitEthernet0/0/1.1]vrrp vrid 1 priority 110
[R2-GigabitEthernet0/0/1.1]int g0/0/1.2
[R2-GigabitEthernet0/0/1.2]d t v 20
[R2-GigabitEthernet0/0/1.2]ip a 192.168.2.253 24
[R2-GigabitEthernet0/0/1.2]a b e
[R2-GigabitEthernet0/0/1.2]vrrp vrid 2 virtual-ip 192.168.2.254
**R3**
[Huawei]sys R3
[R3]int g0/0/0
[R3-GigabitEthernet0/0/0]ip a 192.168.20.2 24
[R3-GigabitEthernet0/0/0]q
[R3]ip route-static 0.0.0.0 0 192.168.20.1
[R3]int g0/0/1.2
[R3-GigabitEthernet0/0/1.2]ip a 192.168.2.252 24
[R3-GigabitEthernet0/0/1.2]d t v 20
[R3-GigabitEthernet0/0/1.2]a b e
[R3-GigabitEthernet0/0/1.2]vrrp vrid 2 virtual-ip 192.168.2.254
[R3-GigabitEthernet0/0/1.2]vrrp vrid 2 priority 110
[R3-GigabitEthernet0/0/1.2]int g0/0/1.1
[R3-GigabitEthernet0/0/1.1]ip a 192.168.1.253 24
[R3-GigabitEthernet0/0/1.1]d t v 1
[R3-GigabitEthernet0/0/1.1]a b e
[R3-GigabitEthernet0/0/1.1]vrrp vrid 1 virtual-ip 192.168.1.254

RSW

[Huawei]vlan batch 10 20
Info: This operation may take a few seconds. Please wait for a moment...done.
[Huawei]int e0/0/1
[Huawei-Ethernet0/0/1]p l a 
[Huawei-Ethernet0/0/1]p d v 10
[Huawei-Ethernet0/0/1]int e0/0/2
[Huawei-Ethernet0/0/2]p l a
[Huawei-Ethernet0/0/2]p d v 20
[Huawei-Ethernet0/0/2]int e0/0/3
[Huawei-Ethernet0/0/3]p l t 
[Huawei-Ethernet0/0/3]p t a v a
[Huawei-Ethernet0/0/3]int e0/0/4
[Huawei-Ethernet0/0/4]p l t
[Huawei-Ethernet0/0/4]p t a v a

一招鲜——交换机配置mstp+vrrp实验_第5张图片
一招鲜——交换机配置mstp+vrrp实验_第6张图片
断掉R2的G0/0/1口
在这里插入图片描述
一招鲜——交换机配置mstp+vrrp实验_第7张图片

一招鲜——交换机配置mstp+vrrp实验_第8张图片

实验二:交换机配置mstp+vrrp,s1作为vlan10的主,vlan20的备,sw2相反,使得PC1和PC2可以互通

一招鲜——交换机配置mstp+vrrp实验_第9张图片
配置RSW1
一招鲜——交换机配置mstp+vrrp实验_第10张图片

配置RSW2
一招鲜——交换机配置mstp+vrrp实验_第11张图片
配置RSW3
一招鲜——交换机配置mstp+vrrp实验_第12张图片

RSW1
<Huawei>SYS
[Huawei]sys RSW1
[RSW1]vlan batch 10 20
Info: This operation may take a few seconds. Please wait for a moment...done.
[RSW1]stp region-configuration
[RSW1-mst-region]region-name shaole 
[RSW1-mst-region]instance 1 vlan 10
[RSW1-mst-region]instance 2 vlan 20
[RSW1-mst-region]active region-configuration
Info: This operation may take a few seconds. Please wait for a moment...done.
[RSW1-mst-region]q
[RSW1]stp instance 1 root primary
[RSW1]stp instance 2 root secondary
[RSW1]int vlanif 10
[RSW1-Vlanif10]ip a 192.168.1.252 24
[RSW1-Vlanif10]vrrp vrid 1 virtual-ip 192.168.1.254
[RSW1-Vlanif10]vrrp vrid 1 priority 110
[RSW1-Vlanif10]int vlanif 20
[RSW1-Vlanif20]ip a 192.168.2.252 24
[RSW1-Vlanif20]vrrp vrid 2 virtual-ip 192.168.2.254
[RSW1-Vlanif20]int g0/0/2
[RSW1-GigabitEthernet0/0/2]p l t  
[RSW1-GigabitEthernet0/0/2]p t  a v a
[RSW1-GigabitEthernet0/0/2]int g0/0/1
[RSW1-GigabitEthernet0/0/1]p l t 
[RSW1-GigabitEthernet0/0/1]p t a v  a
**配置RSW2**
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]sys RSW2
[RSW2]vlan batch 10 20
Info: This operation may take a few seconds. Please wait for a moment...done.
[RSW2]stp region-configuration
[RSW2-mst-region]region-name shaole
[RSW2-mst-region]instance 1 vlan 10
[RSW2-mst-region]instance 2 vlan 20
[RSW2-mst-region]active region-configuration
Info: This operation may take a few seconds. Please wait for a moment...done.
[RSW2-mst-region]stp instance 1 root secondary
[RSW2-mst-region]stp instance 2 root primary
[RSW2]int vlan 10
[RSW2-Vlanif10]ip a 192.168.1.253 24
[RSW2-Vlanif10]vrrp vrid 1 virtual-ip 192.168.1.254
[RSW2-Vlanif10]int vlanif 20
[RSW2-Vlanif20]ip a 192.168.2.253 24
[RSW2-Vlanif20]vrrp vrid 2 virtual-ip 192.168.2.254
[RSW2-Vlanif20]vrrp vrid 2 priority 110
[RSW2-Vlanif20]int g0/0/1
[RSW2-GigabitEthernet0/0/1]p l t
[RSW2-GigabitEthernet0/0/1]p t a v a
[RSW2-GigabitEthernet0/0/1]int g0/0/2
[RSW2-GigabitEthernet0/0/2]p l t
[RSW2-GigabitEthernet0/0/2]p t a v a
配置RSW3
<Huawei>sys
Enter system view, return user view with Ctrl+Z.
[Huawei]vlan batch 10 20
Info: This operation may take a few seconds. Please wait for a moment...done.
[Huawei]stp region-configuration
[Huawei-mst-region]region-name shaole
[Huawei-mst-region]instance 1 vlan 10
[Huawei-mst-region]instance 2 vlan 20
[Huawei-mst-region]active region-configuration
Info: This operation may take a few seconds. Please wait for a moment...done.
[Huawei-mst-region]q
[Huawei]int g0/0/1
[Huawei-GigabitEthernet0/0/1]p l  t
[Huawei-GigabitEthernet0/0/1]p t  a v a
[Huawei-GigabitEthernet0/0/1]int g0/0/2
[Huawei-GigabitEthernet0/0/2]p l t 
[Huawei-GigabitEthernet0/0/2]p t a v a
[Huawei-GigabitEthernet0/0/2]int g0/0/3
[Huawei-GigabitEthernet0/0/3]p l a
[Huawei-GigabitEthernet0/0/3]p d v   10
[Huawei-GigabitEthernet0/0/3]int g0/0/4 
[Huawei-GigabitEthernet0/0/4]p l a
[Huawei-GigabitEthernet0/0/4]p d v 20

一招鲜——交换机配置mstp+vrrp实验_第13张图片
一招鲜——交换机配置mstp+vrrp实验_第14张图片

实验三、SW1和SW2配置vrrp ,sw1作为vlan10的主,vlan20的备, sw2相反,使得pc1和pc2都可以ping 通各自网关,测试断掉一条线路不影响结果

一招鲜——交换机配置mstp+vrrp实验_第15张图片
配置RSW1
一招鲜——交换机配置mstp+vrrp实验_第16张图片
配置RSW2
一招鲜——交换机配置mstp+vrrp实验_第17张图片
配置RSW3
一招鲜——交换机配置mstp+vrrp实验_第18张图片
一招鲜——交换机配置mstp+vrrp实验_第19张图片
一招鲜——交换机配置mstp+vrrp实验_第20张图片
断掉一条线路
在这里插入图片描述
一招鲜——交换机配置mstp+vrrp实验_第21张图片

配置RSW1
[Huawei]vlan batch 10 20
Info: This operation may take a few seconds. Please wait for a moment...done.
[Huawei]int vlanif 10
[Huawei-Vlanif10]ip a 192.168.1.252 24
[Huawei-Vlanif10]vrrp vrid 1 virtual-ip 192.168.1.254
[Huawei-Vlanif10]vrrp vrid 1 priority 110
[Huawei-Vlanif10]int vlanif 20
[Huawei-Vlanif20]ip a 192.168.2.252 24
[Huawei-Vlanif20]vrrp vrid 1 virtual-ip 192.168.2.254
[Huawei-Vlanif20]undo vrrp vrid 1 virtual-ip 192.168.2.254
[Huawei-Vlanif20]vrrp vrid 2 virtual-ip 192.168.2.254
[Huawei-Vlanif20]int g0/0/1
[Huawei-GigabitEthernet0/0/1]p l t 
[Huawei-GigabitEthernet0/0/1]p t a v a
[Huawei-GigabitEthernet0/0/1]shutdown
配置RSW2
Huawei]vlan batch 10 20
Info: This operation may take a few seconds. Please wait for a moment...done.
[Huawei]int vlanif 10
[Huawei-Vlanif10]ip a 192.168.1.253 24
[Huawei-Vlanif10]vrrp vrid 1 virtual-ip 192.168.1.254
[Huawei-Vlanif10]int vlanif 20
[Huawei-Vlanif20]ip a 192.168.2.253 24
[Huawei-Vlanif20]vrrp vrid 2  virtual-ip 192.168.2.254
[Huawei-Vlanif20]vrrp vrid 2 priority 110
[Huawei-Vlanif20]int g0/0/1
[Huawei-GigabitEthernet0/0/1]p l t 
[Huawei-GigabitEthernet0/0/1]p t  a v a
配置RSW3
[Huawei]vlan batch 10 20
Info: This operation may take a few seconds. Please wait for a moment...done.
[Huawei]int g0/0/1
[Huawei-GigabitEthernet0/0/1]p l t
[Huawei-GigabitEthernet0/0/1]p t a v a
[Huawei-GigabitEthernet0/0/1]int g0/0/2
[Huawei-GigabitEthernet0/0/2]p l t 
[Huawei-GigabitEthernet0/0/2]p t a v a
[Huawei-GigabitEthernet0/0/2]int g0/0/3
[Huawei-GigabitEthernet0/0/3]p l a 
[Huawei-GigabitEthernet0/0/3]p d  v 10
[Huawei-GigabitEthernet0/0/3]int g0/0/4
[Huawei-GigabitEthernet0/0/4]p l a 
[Huawei-GigabitEthernet0/0/4]p d v 20

你可能感兴趣的:(一招鲜——交换机配置mstp+vrrp实验)