华为、思科VRRP+MSTP典型组网配置

华为

拓扑图
华为、思科VRRP+MSTP典型组网配置_第1张图片
LSW3上的配置

先创建vlan10、20
vlan batch 10 20
然后在接口下划分trunk、access模式
interface Ethernet0/0/1
 port link-type access
 port default vlan 10
interface Ethernet0/0/2
 port link-type access
 port default vlan 20
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
 配置mstp
 stp mode mstp
 stp region-configuration
 region-name liu
 instance 10 vlan 10
 instance 20 vlan 20
 active region-configuration
 验证
 dis stp instance 10 bri

LSW1上的配置

先创建vlan10、20
vlan batch 10 20
配置链路聚合和trunk口
interface Eth-Trunk1
trunkport int g0/0/1
trunkport int g0/0/2
interface Eth-Trunk1
port link-type trunk
port trunk allow-pass vlan 10 20
interface GigabitEthernet0/0/3
port link-type trunk
port trunk allow-pass vlan 10 20
配置mstp
stp mode mstp
stp region-configuration
region-name liu
instance 10 vlan 10
instance 20 vlan 20
active region-configuration
stp instance 10 root primary
stp instance 20 root secondary
配置VRRP
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.252 255.255.255.0
vrrp vrid 20 virtual-ip 192.168.20.254
 vrrp vrid 20 priority 100
 验证
 dis vrrp bri

LSW2上的配置

   先创建vlan10、20
vlan batch 10 20
   配置链路聚合和trunk口
 interface Eth-Trunk1
 trunkport int g0/0/1
 trunkport int g0/0/2
 interface Eth-Trunk1
 port link-type trunk
 port trunk allow-pass vlan 10 20
interface GigabitEthernet0/0/3
 port link-type trunk
 port trunk allow-pass vlan 10 20
 配置mstp
 stp mode mstp
 stp region-configuration
 region-name liu
 instance 10 vlan 10
 instance 20 vlan 20
 active region-configuration
stp instance 20 root primary
stp instance 10 root secondary
配置VRRP
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 Vlanif10
 ip address 192.168.10.252 255.255.255.0
 vrrp vrid 10 virtual-ip 192.168.10.254
  vrrp vrid 10 priority 100

思科

华为、思科VRRP+MSTP典型组网配置_第2张图片
SW3上的配置

先创建vlan10,20
vlan 10
vlan 20
然后在接口下划分trunk、access模式
interface Ethernet0/3
switchport mode access
 switchport access vlan 10
interface Ethernet1/0
switchport mode access
 switchport access vlan 20
 int range e0/1 , e0/2
switchport trunk encapsulation dot1q
switchport mode trunk
switchport trunk allowed vlan 10,20
配置mstp
spanning-tree mode mstp
spanning-tree mst configuration
name liu 
revision 123
instance 10 vlan 10
instance 20 vlan 20
验证
show spanning-tree mst 1

SW1上的配置

先创建vlan10,20
 vlan 10
 vlan 20
配置链路聚合和trunk口
 interface range e0/2 , e0/0 , e0/1
 switchport trunk encapsulation dot1q
  switchport mode trunk
 switchport trunk allowed vlan 10,20
  interface range e0/2 , e0/0
  channel-group 1 mode on
  验证
  show int port-channel 1
  配置mstp
  spanning-tree mode mstp
spanning-tree mst configuration
 name liu 
 revision 123
 instance 10 vlan 10
 instance 20 vlan 20
 spanning-tree mst 10 root primary
spanning-tree mst 20 root sec
配置vrrp
interface Vlan10
 ip address 192.168.10.253 255.255.255.0
 vrrp 10 ip 192.168.10.254
 vrrp 10 priority 200         
interface Vlan20
 ip address 192.168.20.252 255.255.255.0
 vrrp 20 ip 192.168.20.254
  vrrp 20 priority 100
  验证
  show vrrp bri

SW2上的配置

先创建vlan10,20
 vlan 10
 vlan 20
配置链路聚合和trunk口
 interface range e0/2 , e0/0 , e0/1
 switchport trunk encapsulation dot1q
  switchport mode trunk
 switchport trunk allowed vlan 10,20
  interface range e0/2 , e0/0
  channel-group 1 mode on
  验证
  show int port-channel 1
  配置mstp
  spanning-tree mode mstp
spanning-tree mst configuration
 name liu 
 revision 123
 instance 10 vlan 10
 instance 20 vlan 20
 spanning-tree mst 20 root primary
spanning-tree mst 10 root sec
配置vrrp
interface Vlan20
 ip address 192.168.20.253 255.255.255.0
 vrrp 20 ip 192.168.20.254
 vrrp 20 priority 200         
interface Vlan10
 ip address 192.168.10.252 255.255.255.0
 vrrp 10 ip 192.168.10.254
  vrrp 10 priority 100
  验证
  show vrrp bri

注意
如果SW1有上行接口和上行链路时,其中一个发生故障,VRRP默认是无法感知的,即主备状态无法切换,数据包无法发送出去,这是就要用到track功能
华为track的配置

vrrp 10 track int g0/0/3 reduced 30

配置完这条命令之后,即当g0/0/3或者其上行链路发生故障时,其优先级减少30,然后当前优先级小于Backup状态的三层交换机,则主备状态发生切换
思科track的配置

vrrp 10 track 1 decrement 150
track 1 int g0/0/3 line-protocol

你可能感兴趣的:(思科华为)