交换机 vrrp+mstp配置实例

本文介绍了一个使用锐捷交换机实现VRRP和MSTP配置的具体案例。网络中共有两个业务VLAN(VLAN10和VLAN20),通过VRRP实现负载分担和备份,MSTP确保不同VLAN的数据流负载分担并避免环路。

 

交换机 vrrp+mstp配置实例

锐捷tac贾文宇

 

一、        组网需求

 

1、switch a switch b选用两台锐捷的s5750 switch c shwich d

用锐捷的 s3750s3760

2、全网共有两个业务vlan , vlan 10 vlan 20

3、Switch a switch b 都分别对两vlan起用两vrrp组,实现两组的业务的负载分担和备份。

4、Switch aswitch bswitch cswitch d 都起用 mstp多生成数协议,并且所有设备都属于同一个mst域,且实例映射一致(vlan 10映射实例1vlan 20映射实例2 其他vlan映射默认实例0)。

5、Vlan 10业务以switch a为根桥; vlan 20业务以switch b为根桥;实现阻断网络环路,并能实现不同vlan数据流负载分担功能。

 

二、        组网图

三、        配置步骤

 

Switch a配置:

s1#show run

 

Building configuration...

Current configuration : 1651 bytes

 

!

version RGNOS 10.2.00(2), Release(29287)(Tue Dec 25 20:39:14 CST 2007 -ngcf49)

hostname s1

co-operate enable

!

!

!

vlan 1

!

vlan 10

!

vlan 20

!

!

no service password-encryption

!

spanning-tree     开启生成树(默认为mstp

spanning-tree mst configuration    进入mst配置模式

 revision 1      指定MST revision number 1

 name region1     指定mst配置名称

 instance 0 vlan 1-9, 11-19, 21-4094   缺省情况下vlan都属于实例0

 instance 1 vlan 10     手工指定vlan10属于实例1

 instance 2 vlan 20     手工指定vlan20属于实例2

spanning-tree mst 1 priority 0    指定实例1的优先级为0(为根桥)

spanning-tree mst 2 priority 4096   指定实例2的优先级为4096

interface GigabitEthernet 0/1

 switchport access vlan 10        配置g0/1属于vlan10

!

interface GigabitEthernet 0/2

 switchport access vlan 20        配置g0/2属于vlan 20

!

interface GigabitEthernet 0/3

!

.

.

interface GigabitEthernet 0/24      设置g0/24trunk接口且允许vlan10/20通过

 switchport mode trunk

!

interface VLAN 10               创建vlan 10 svi接口

 ip address 192.168.10.1 255.255.255.0   配置ip地址

 vrrp 1 priority 120           配置vrrp1 优先级为120

 vrrp 1 ip 192.168.10.254      配置vrrp 1虚拟ip地址为 192.168.10.254

!

interface VLAN 20              创建vlan 20 svi接口

 ip address 192.168.20.1 255.255.255.0       配置ip地址

 vrrp 2 ip 192.168.20.254       配置vrrp 2虚拟ip地址为 192.168.20.254

                            默认vrrp组的优先级为100默认不显示

!

line con 0

line vty 0 4

 login

 

s1#show vlan

VLAN Name                             Status    Ports

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

---

   1 VLAN0001                         STATIC    Gi0/3, Gi0/4, Gi0/5, Gi0/6

 

                                                Gi0/7, Gi0/8, Gi0/9, Gi0/10

 

                                                Gi0/11, Gi0/12, Gi0/13, Gi0/14

 

                                                Gi0/15, Gi0/16, Gi0/17, Gi0/18

 

                                                Gi0/19, Gi0/20, Gi0/21, Gi0/22

 

                                                Gi0/23, Gi0/24

 

  10 VLAN0010                         STATIC    Gi0/1, Gi0/24

 

  20 VLAN0020                         STATIC    Gi0/2, Gi0/24

 

Switch b配置:

 

s2#show run

 

Building configuration...

Current configuration : 1607 bytes

 

!

version RGNOS 10.2.00(2), Release(27932)(Thu Dec 13 10:32:09 CST 2007 -ngcf31)

hostname s2

 

!

!

!

vlan 1

!

vlan 10

!

vlan 20

!

!

no service password-encryption

!

spanning-tree

spanning-tree mst configuration

 revision 1

 name region1

 instance 0 vlan 1-9, 11-19, 21-4094

 instance 1 vlan 10

 instance 2 vlan 20

spanning-tree mst 1 priority 4096

spanning-tree mst 2 priority 0

interface GigabitEthernet 0/1

 switchport access vlan 10

!

interface GigabitEthernet 0/2

 switchport access vlan 20

!

.

.

interface GigabitEthernet 0/24

 switchport mode trunk

!

interface VLAN 10

 ip address 192.168.10.2 255.255.255.0

 vrrp 1 ip 192.168.10.254

!

interface VLAN 20

 ip address 192.168.20.2 255.255.255.0

 vrrp 2 priority 120

 vrrp 2 ip 192.168.20.254

!

line con 0

line vty 0 4

 login

!

!

end

s2#show vlan

VLAN Name                             Status    Ports

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

 

---

   1 VLAN0001                         STATIC    Gi0/3, Gi0/4, Gi0/5, Gi0/6

 

 

                                                Gi0/7, Gi0/8, Gi0/9, Gi0/10

 

 

                                                Gi0/11, Gi0/12, Gi0/13, Gi0/14

 

 

                                                Gi0/15, Gi0/16, Gi0/17, Gi0/18

 

 

                                                Gi0/19, Gi0/20, Gi0/21, Gi0/22

 

 

                                                Gi0/23, Gi0/24

 

 

  10 VLAN0010                         STATIC    Gi0/1, Gi0/24

 

 

  20 VLAN0020                         STATIC    Gi0/2, Gi0/24

 

Switch c配置:

 

s3#show run

 

Building configuration...

Current configuration : 1540 bytes

 

!

version RGNOS 10.2.00(2), Release(28794)(Fri Dec 21 09:27:15 CST 2007 -ngcf32)

hostname s3

!

vlan 1

!

vlan 10

!

!

service password-encryption

!

spanning-tree

spanning-tree mst configuration

 revision 1

 name region1

 instance 0 vlan 1-9, 11-19, 21-4094

 instance 1 vlan 10

 instance 2 vlan 20

spanning-tree mst 1 priority 0

spanning-tree mst 2 priority 4096

interface FastEthernet 0/1

 switchport access vlan 10

!

interface FastEthernet 0/2

 switchport access vlan 10

!

.

.

interface GigabitEthernet 0/25

!

interface GigabitEthernet 0/26

!

interface GigabitEthernet 0/27

!

interface GigabitEthernet 0/28

!

interface VLAN 10

 ip address 192.168.10.3 255.255.255.0

!

ip route 0.0.0.0 0.0.0.0 192.168.10.254

!

!

line con 0

line vty 0 4

 login

 

Switch d配置:

 

s4#show run

 

Building configuration...

Current configuration : 1066 bytes

 

!

version RGNOS 10.2.00(2), Release(27932)(Thu Dec 13 10:31:41 CST 2007 -ngcf32)

hostname s4

 

!

vlan 1

!

vlan 20

!

!

no service password-encryption

!

spanning-tree

spanning-tree mst configuration

 revision 1

 name region1

 instance 0 vlan 1-9, 11-19, 21-4094

 instance 1 vlan 10

 instance 2 vlan 20

spanning-tree mst 1 priority 4096

spanning-tree mst 2 priority 0

interface GigabitEthernet 0/1

 switchport access vlan 20

!

interface GigabitEthernet 0/2

 switchport access vlan 20

!

.

.

interface GigabitEthernet 0/12

!

interface VLAN 20

 ip address 192.168.20.3 255.255.255.0

!

!

!

!

ip route 0.0.0.0 0.0.0.0 192.168.20.254

!

!

line con 0

line vty 0 4

 login

!

四、        查看vrrpmstp信息

 

Switch a 信息

 

s1#show vrrp      查看vrrp 信息

VLAN 10 - Group 1

  State is Master

  Virtual IP address is 192.168.10.254 configured

  Virtual MAC address is 0000.5e00.0101

  Advertisement interval is 1 sec

  Preemption is enabled

    min delay is 0 sec

  Priority is 120

  Master Router is 192.168.10.1 (local), priority is 120

  Master Advertisement interval is 1 sec

  Master Down interval is 3 sec

VLAN 20 - Group 2

  State is Backup

  Virtual IP address is 192.168.20.254 configured

  Virtual MAC address is 0000.5e00.0102

  Advertisement interval is 1 sec

  Preemption is enabled

    min delay is 0 sec

  Priority is 100

  Master Router is 192.168.20.2 , priority is 120

  Master Advertisement interval is 1 sec

  Master Down interval is 3 sec

s1#

s1#s1#

s1#show spanning-tree interface gigabitEthernet 0/1  查看g0/1接口stp状态信息

 

PortAdminPortFast : Disabled

PortOperPortFast : Disabled

PortAdminAutoEdge : Enabled

PortOperAutoEdge : Disabled

PortAdminLinkType : auto

PortOperLinkType : point-to-point

PortBPDUGuard : Disabled

PortBPDUFilter : Disabled

 

###### MST 0 vlans mapped :1-9, 11-19, 21-4094

PortState : forwarding

PortPriority : 128

PortDesignatedRoot : 8000.001a.a909.8fe0

PortDesignatedCost : 0

PortDesignatedBridge :8000.00d0.f836.ed70

PortDesignatedPort : 8001

PortForwardTransitions : 6

PortAdminPathCost : 200000

PortOperPathCost : 200000

PortRole : designatedPort

 

###### MST 1 vlans mapped :10

PortState : forwarding

PortPriority : 128

PortDesignatedRoot : 0001.00d0.f823.ef82

PortDesignatedCost : 0

PortDesignatedBridge :0001.00d0.f823.ef82

PortDesignatedPort : 8001

PortForwardTransitions : 5

PortAdminPathCost : 200000

PortOperPathCost : 200000

PortRole : rootPort

 

###### MST 2 vlans mapped :20

PortState : forwarding

PortPriority : 128

PortDesignatedRoot : 0002.001a.a909.8fe0

PortDesignatedCost : 0

PortDesignatedBridge :1002.00d0.f836.ed70

PortDesignatedPort : 8001

PortForwardTransitions : 4

PortAdminPathCost : 200000

PortOperPathCost : 200000

PortRole : designatedPort

s1#

s1#

s1#show spanning-tree interface gigabitEthernet 0/2  查看g0/2接口stp状态信息

 

PortAdminPortFast : Disabled

PortOperPortFast : Disabled

PortAdminAutoEdge : Enabled

PortOperAutoEdge : Disabled

PortAdminLinkType : auto

PortOperLinkType : point-to-point

PortBPDUGuard : Disabled

PortBPDUFilter : Disabled

 

###### MST 0 vlans mapped :1-9, 11-19, 21-4094

PortState : forwarding

PortPriority : 128

PortDesignatedRoot : 8000.001a.a909.8fe0

PortDesignatedCost : 0

PortDesignatedBridge :8000.00d0.f836.ed70

PortDesignatedPort : 8002

PortForwardTransitions : 5

PortAdminPathCost : 20000

PortOperPathCost : 20000

PortRole : designatedPort

 

###### MST 1 vlans mapped :10

PortState : forwarding

PortPriority : 128

PortDesignatedRoot : 0001.00d0.f823.ef82

PortDesignatedCost : 0

PortDesignatedBridge :0001.00d0.f836.ed70

PortDesignatedPort : 8002

PortForwardTransitions : 4

PortAdminPathCost : 20000

PortOperPathCost : 20000

PortRole : designatedPort

 

###### MST 2 vlans mapped :20

PortState : discarding

PortPriority : 128

PortDesignatedRoot : 0002.001a.a909.8fe0

PortDesignatedCost : 0

PortDesignatedBridge :0002.00d0.f8d7.ae12

PortDesignatedPort : 8002

PortForwardTransitions : 3

PortAdminPathCost : 20000

PortOperPathCost : 20000

PortRole : alternatePort

s1#

s1#

s1#show spanning-tree interface gigabitEthernet 0/24 g0/24接口stp状态信息

 

PortAdminPortFast : Disabled

PortOperPortFast : Disabled

PortAdminAutoEdge : Enabled

PortOperAutoEdge : Disabled

PortAdminLinkType : auto

PortOperLinkType : point-to-point

PortBPDUGuard : Disabled

PortBPDUFilter : Disabled

 

###### MST 0 vlans mapped :1-9, 11-19, 21-4094

PortState : forwarding

PortPriority : 128

PortDesignatedRoot : 8000.001a.a909.8fe0

PortDesignatedCost : 0

PortDesignatedBridge :8000.001a.a909.8fe0

PortDesignatedPort : 8018

PortForwardTransitions : 5

PortAdminPathCost : 20000

PortOperPathCost : 20000

PortRole : rootPort

 

###### MST 1 vlans mapped :10

PortState : forwarding

PortPriority : 128

PortDesignatedRoot : 0001.00d0.f823.ef82

PortDesignatedCost : 0

PortDesignatedBridge :0001.00d0.f836.ed70

PortDesignatedPort : 8018

PortForwardTransitions : 5

PortAdminPathCost : 20000

PortOperPathCost : 20000

PortRole : designatedPort

 

###### MST 2 vlans mapped :20

PortState : forwarding

PortPriority : 128

PortDesignatedRoot : 0002.001a.a909.8fe0

PortDesignatedCost : 0

PortDesignatedBridge :0002.001a.a909.8fe0

PortDesignatedPort : 8018

PortForwardTransitions : 4

PortAdminPathCost : 20000

PortOperPathCost : 20000

PortRole : rootPort

s1#

 

 

 

Switch b 信息

 

s2#show vrrp

VLAN 10 - Group 1

  State is Backup

  Virtual IP address is 192.168.10.254 configured

  Virtual MAC address is 0000.5e00.0101

  Advertisement interval is 1 sec

  Preemption is enabled

    min delay is 0 sec

  Priority is 100

  Master Router is 192.168.10.1 , priority is 120

  Master Advertisement interval is 1 sec

  Master Down interval is 3 sec

VLAN 20 - Group 2

  State is Master

  Virtual IP address is 192.168.20.254 configured

  Virtual MAC address is 0000.5e00.0102

  Advertisement interval is 1 sec

  Preemption is enabled

    min delay is 0 sec

  Priority is 120

  Master Router is 192.168.20.2 (local), priority is 120

  Master Advertisement interval is 1 sec

  Master Down interval is 3 sec

s2#

s2#

s2#

s2#

s2#

s2#

s2#show spanning-tree interface gigabitEthernet 0/1

 

PortAdminPortFast : Disabled

PortOperPortFast : Disabled

PortAdminAutoEdge : Enabled

PortOperAutoEdge : Disabled

PortAdminLinkType : auto

PortOperLinkType : point-to-point

PortBPDUGuard : Disabled

PortBPDUFilter : Disabled

 

###### MST 0 vlans mapped :1-9, 11-19, 21-4094

PortState : forwarding

PortPriority : 128

PortDesignatedRoot : 8000.001a.a909.8fe0

PortDesignatedCost : 0

PortDesignatedBridge :8000.001a.a909.8fe0

PortDesignatedPort : 8001

PortForwardTransitions : 1

PortAdminPathCost : 200000

PortOperPathCost : 200000

PortRole : designatedPort

 

###### MST 1 vlans mapped :10

PortState : forwarding

PortPriority : 128

PortDesignatedRoot : 0001.00d0.f823.ef82

PortDesignatedCost : 0

PortDesignatedBridge :0001.00d0.f823.ef82

PortDesignatedPort : 8002

PortForwardTransitions : 2

PortAdminPathCost : 200000

PortOperPathCost : 200000

PortRole : rootPort

 

###### MST 2 vlans mapped :20

PortState : forwarding

PortPriority : 128

PortDesignatedRoot : 0002.001a.a909.8fe0

PortDesignatedCost : 0

PortDesignatedBridge :0002.001a.a909.8fe0

PortDesignatedPort : 8001

PortForwardTransitions : 1

PortAdminPathCost : 200000

PortOperPathCost : 200000

PortRole : designatedPort

s2#

s2#

s2#

s2#show spanning-tree interface gigabitEthernet 0/2

 

PortAdminPortFast : Disabled

PortOperPortFast : Disabled

PortAdminAutoEdge : Enabled

PortOperAutoEdge : Disabled

PortAdminLinkType : auto

PortOperLinkType : point-to-point

PortBPDUGuard : Disabled

PortBPDUFilter : Disabled

 

###### MST 0 vlans mapped :1-9, 11-19, 21-4094

PortState : forwarding

PortPriority : 128

PortDesignatedRoot : 8000.001a.a909.8fe0

PortDesignatedCost : 0

PortDesignatedBridge :8000.001a.a909.8fe0

PortDesignatedPort : 8002

PortForwardTransitions : 1

PortAdminPathCost : 20000

PortOperPathCost : 20000

PortRole : designatedPort

 

###### MST 1 vlans mapped :10

PortState : forwarding

PortPriority : 128

PortDesignatedRoot : 0001.00d0.f823.ef82

PortDesignatedCost : 0

PortDesignatedBridge :1001.001a.a909.8fe0

PortDesignatedPort : 8002

PortForwardTransitions : 2

PortAdminPathCost : 20000

PortOperPathCost : 20000

PortRole : designatedPort

 

###### MST 2 vlans mapped :20

PortState : forwarding

PortPriority : 128

PortDesignatedRoot : 0002.001a.a909.8fe0

PortDesignatedCost : 0

PortDesignatedBridge :0002.001a.a909.8fe0

PortDesignatedPort : 8002

PortForwardTransitions : 1

PortAdminPathCost : 20000

PortOperPathCost : 20000

PortRole : designatedPort

s2#

s2#

s2#

s2#

s2#show spanning-tree interface gigabitEthernet 0/24

 

PortAdminPortFast : Disabled

PortOperPortFast : Disabled

PortAdminAutoEdge : Enabled

PortOperAutoEdge : Disabled

PortAdminLinkType : auto

PortOperLinkType : point-to-point

PortBPDUGuard : Disabled

PortBPDUFilter : Disabled

 

###### MST 0 vlans mapped :1-9, 11-19, 21-4094

PortState : forwarding

PortPriority : 128

PortDesignatedRoot : 8000.001a.a909.8fe0

PortDesignatedCost : 0

PortDesignatedBridge :8000.001a.a909.8fe0

PortDesignatedPort : 8018

PortForwardTransitions : 1

PortAdminPathCost : 20000

PortOperPathCost : 20000

PortRole : designatedPort

 

###### MST 1 vlans mapped :10

PortState : discarding

PortPriority : 128

PortDesignatedRoot : 0001.00d0.f823.ef82

PortDesignatedCost : 0

PortDesignatedBridge :0001.00d0.f836.ed70

PortDesignatedPort : 8018

PortForwardTransitions : 1

PortAdminPathCost : 20000

PortOperPathCost : 20000

PortRole : alternatePort

 

###### MST 2 vlans mapped :20

PortState : forwarding

PortPriority : 128

PortDesignatedRoot : 0002.001a.a909.8fe0

PortDesignatedCost : 0

PortDesignatedBridge :0002.001a.a909.8fe0

PortDesignatedPort : 8018

PortForwardTransitions : 1

PortAdminPathCost : 20000

PortOperPathCost : 20000

PortRole : designatedPort

s2#

 

 

Switch c 信息

 

s3#show spanning-tree interface fastEthernet 0/1

 

PortAdminPortFast : Disabled

PortOperPortFast : Disabled

PortAdminAutoEdge : Enabled

PortOperAutoEdge : Disabled

PortAdminLinkType : auto

PortOperLinkType : point-to-point

PortBPDUGuard : Disabled

PortBPDUFilter : Disabled

 

###### MST 0 vlans mapped :1-9, 11-19, 21-4094

PortState : discarding

PortPriority : 128

PortDesignatedRoot : 8000.001a.a909.8fe0

PortDesignatedCost : 0

PortDesignatedBridge :8000.00d0.f836.ed70

PortDesignatedPort : 8001

PortForwardTransitions : 1

PortAdminPathCost : 200000

PortOperPathCost : 200000

PortRole : alternatePort

 

###### MST 1 vlans mapped :10

PortState : forwarding

PortPriority : 128

PortDesignatedRoot : 0001.00d0.f823.ef82

PortDesignatedCost : 0

PortDesignatedBridge :0001.00d0.f823.ef82

PortDesignatedPort : 8001

PortForwardTransitions : 1

PortAdminPathCost : 200000

PortOperPathCost : 200000

PortRole : designatedPort

 

###### MST 2 vlans mapped :20

PortState : discarding

PortPriority : 128

PortDesignatedRoot : 0002.001a.a909.8fe0

PortDesignatedCost : 0

PortDesignatedBridge :1002.00d0.f836.ed70

PortDesignatedPort : 8001

PortForwardTransitions : 0

PortAdminPathCost : 200000

PortOperPathCost : 200000

PortRole : alternatePort

s3#

s3#

s3#

s3#

s3#show spanning-tree interface fastEthernet 0/2

 

PortAdminPortFast : Disabled

PortOperPortFast : Disabled

PortAdminAutoEdge : Enabled

PortOperAutoEdge : Disabled

PortAdminLinkType : auto

PortOperLinkType : point-to-point

PortBPDUGuard : Disabled

PortBPDUFilter : Disabled

 

###### MST 0 vlans mapped :1-9, 11-19, 21-4094

PortState : forwarding

PortPriority : 128

PortDesignatedRoot : 8000.001a.a909.8fe0

PortDesignatedCost : 0

PortDesignatedBridge :8000.001a.a909.8fe0

PortDesignatedPort : 8001

PortForwardTransitions : 1

PortAdminPathCost : 200000

PortOperPathCost : 200000

PortRole : rootPort

 

###### MST 1 vlans mapped :10

PortState : forwarding

PortPriority : 128

PortDesignatedRoot : 0001.00d0.f823.ef82

PortDesignatedCost : 0

PortDesignatedBridge :0001.00d0.f823.ef82

PortDesignatedPort : 8002

PortForwardTransitions : 2

PortAdminPathCost : 200000

PortOperPathCost : 200000

PortRole : designatedPort

 

###### MST 2 vlans mapped :20

PortState : forwarding

PortPriority : 128

PortDesignatedRoot : 0002.001a.a909.8fe0

PortDesignatedCost : 0

PortDesignatedBridge :0002.001a.a909.8fe0

PortDesignatedPort : 8001

PortForwardTransitions : 1

PortAdminPathCost : 200000

PortOperPathCost : 200000

PortRole : rootPort

s3#

 

 

Switch d 信息

 

s4#show spanning-tree interface gigabitEthernet 0/1

 

PortAdminPortFast : Disabled

PortOperPortFast : Disabled

PortAdminAutoEdge : Enabled

PortOperAutoEdge : Disabled

PortAdminLinkType : auto

PortOperLinkType : point-to-point

PortBPDUGuard : Disabled

PortBPDUFilter : Disabled

 

###### MST 0 vlans mapped :1-9, 11-19, 21-4094

PortState : forwarding

PortPriority : 128

PortDesignatedRoot : 8000.001a.a909.8fe0

PortDesignatedCost : 0

PortDesignatedBridge :8000.001a.a909.8fe0

PortDesignatedPort : 8002

PortForwardTransitions : 1

PortAdminPathCost : 20000

PortOperPathCost : 20000

PortRole : rootPort

 

###### MST 1 vlans mapped :10

PortState : discarding

PortPriority : 128

PortDesignatedRoot : 0001.00d0.f823.ef82

PortDesignatedCost : 0

PortDesignatedBridge :1001.001a.a909.8fe0

PortDesignatedPort : 8002

PortForwardTransitions : 1

PortAdminPathCost : 20000

PortOperPathCost : 20000

PortRole : alternatePort

 

###### MST 2 vlans mapped :20

PortState : forwarding

PortPriority : 128

PortDesignatedRoot : 0002.001a.a909.8fe0

PortDesignatedCost : 0

PortDesignatedBridge :0002.001a.a909.8fe0

PortDesignatedPort : 8002

PortForwardTransitions : 1

PortAdminPathCost : 20000

PortOperPathCost : 20000

PortRole : rootPort

s4#

s4#

s4#

s4#show spanning-tree interface gigabitEthernet 0/2

 

PortAdminPortFast : Disabled

PortOperPortFast : Disabled

PortAdminAutoEdge : Enabled

PortOperAutoEdge : Disabled

PortAdminLinkType : auto

PortOperLinkType : point-to-point

PortBPDUGuard : Disabled

PortBPDUFilter : Disabled

 

###### MST 0 vlans mapped :1-9, 11-19, 21-4094

PortState : discarding

PortPriority : 128

PortDesignatedRoot : 8000.001a.a909.8fe0

PortDesignatedCost : 0

PortDesignatedBridge :8000.00d0.f836.ed70

PortDesignatedPort : 8002

PortForwardTransitions : 1

PortAdminPathCost : 20000

PortOperPathCost : 20000

PortRole : alternatePort

 

###### MST 1 vlans mapped :10

PortState : forwarding

PortPriority : 128

PortDesignatedRoot : 0001.00d0.f823.ef82

PortDesignatedCost : 0

PortDesignatedBridge :0001.00d0.f836.ed70

PortDesignatedPort : 8002

PortForwardTransitions : 2

PortAdminPathCost : 20000

PortOperPathCost : 20000

PortRole : rootPort

 

###### MST 2 vlans mapped :20

PortState : forwarding

PortPriority : 128

PortDesignatedRoot : 0002.001a.a909.8fe0

PortDesignatedCost : 0

PortDesignatedBridge :0002.00d0.f8d7.ae12

PortDesignatedPort : 8002

PortForwardTransitions : 2

PortAdminPathCost : 20000

PortOperPathCost : 20000

PortRole : designatedPort

s4#

 

FAQ:

1.1         RSTPMSTP配合为什么有问题

1.1.1       原因分析

由于RSTP/MSTP的指定端口快速迁移机制,即接收到下游的agreement报文才能进行快速迁移。引发这样的问题:上游桥运行RSTP,下游运行MSTP,此时,RSTP不向下游发agreement报文,MSTP的根端口没有接收到agreement报文,则表示MSTP没有同步,这就意味着根端口不向上游RSTP指定端口发agreement。所以,MSTP域内的agreement被抑制,上游RSTP指定端口只能在2倍的Forward Delay延时后Forwarding

1.1.2       解决办法

将运行MSTP协议的桥作为上游,运行RSTP的桥做下游。因为RSTP的同步不要求根端口接收到上游的agreement,所以在这种情况下上游MSTP指定端口可以接收到下游RSTP根端口发送的agreement,就可以快速迁移了。

 

1.2         TC报文的来源有哪些

TC报文可能来自于以下几种情况:

1)连接终端的端口使能了STP,但是没有配置边缘端口,当终端发生重启等情况导致该端口发生链路状态变化时,该端口会产生TC报文并向整个二层网络中传播;

2)因更改配置参数,网络中设备或链路出现故障等原因,引发STP重计算时,有可能产生TC报文;

3)来自用户设备的攻击TC报文也可能传入其所接入的二层网络;

1.3         如何抑制TC报文

了解了TC报文的来源,就可以有针对的进行TC的抑止了。主要的措施如下:

1)连接终端的端口使能了STP,配置边缘端口,同时启用BPDU保护;或者连接终端的端口上去使能STP;或者根据具体应用情况,在连接终端的端口上配置BPDU Drop

2)在开局时就做好网络规划。除非征的局方同意,杜绝在现网更改配置参数;

3)在我司设备的网络和其他厂商用户设备的网络交界处,只有单条路径连接的,在该链路所连端口上配置STP Disable或者BPDU Drop;存在多条路径的,对其异常收TC情况进行监控和检查;

而对于网络中设备或链路出现故障等原因,引发STP重计算,产生的TC报文是正常协议运行的TC报文,不是故障;

1.4         TC报文如何产生和进行转发的

TC报文产生的根源是两个:

1)设备主动发送;

2)恶意用户攻击;

设备主动发送TC报文需要满足下面两个条件:

1)非边缘端口角色从DisableAlternateBackupr端口变为RootDesginMaster

2)端口状态从Discarding变为Forwarding

设备转发TC报文有两个步骤:

1)设备从RootDesginMaster端口上收到TC报文

1)向本交换机的所有非边缘的RootDesginMaster端口上发送出去;

 

 

<think>好的,用户想要了解VRRP配置实例。首先,我需要回忆一下VRRP的基本概念。VRRP全称是虚拟路由冗余协议,用来提供网关的冗余备份,确保网络的高可用性。通常用在多个路由器之间,通过虚拟出一个虚拟路由器,让下游设备使用这个虚拟IP作为网关,主路由器故障时,备份路由器能接管流量。 接下来,用户可能需要具体的配置步骤,所以得考虑不同厂商的设备配置可能不同。比如华为、H3C、Cisco这些常见厂商的命令行结构有差异。用户没有指定设备厂商,可能需要给出一个通用的示例,或者选择其中一种作为例子。这里可能需要假设用户使用的是华为或H3C的设备,因为国内比较常见。 然后,需要确定一个典型的网络拓扑结构。比如,两个路由器组成一个VRRP组,连接同一个局域网,虚拟网关IP设为192.168.1.254。主路由器优先级设为100,备份设为90。这样主设备故障时,备份会接管。 配置步骤方面,首先要配置接口的IP地址,确保物理接口的IP在同一个网段。然后启用VRRP,设置虚拟IP,调整优先级和抢占模式。抢占模式很重要,这样当主路由器恢复后能重新接管,避免流量一直走备份。 另外,可能需要说明一些关键参数,比如VRRP的版本,定时器的时间间隔,认证方式等。不过对于基础配置,可能不需要这些高级设置,保持简单明了更好。 还需要验证配置的命令,比如查看VRRP状态,显示虚拟路由器的信息,确认主备状态是否正确。这部分可以给出查看命令,帮助用户检查配置是否成功。 另外,应用场景也需要提及,比如企业网的出口网关冗余,数据中心的多宿设计,避免单点故障。注意事项比如确保物理链路正常,优先级设置合理,抢占模式根据需求开启,这些都需要提醒用户。 可能用户在实际配置中会遇到问题,比如VRRP状态不切换,可能是接口IP不在同一网段,或者优先级设置错误,或者防火墙阻止了VRRP报文。这些常见问题可以作为注意事项的一部分,帮助用户排查。 最后,总结配置步骤,强调配置前的网络规划,比如IP地址分配,VRID的选择(不能冲突),以及测试故障转移的过程,确保高可用性生效。</think>以下是一个VRRP(虚拟路由冗余协议)的基础配置实例及分步说明,适用于企业网络中的网关冗余场景: --- ### **网络拓扑** ``` [PC]---[Switch]---(VLAN 10) | +----+----+ | | [Router1] [Router2] 10.0.0.1 10.0.0.2 ``` - 目标:为`VLAN 10`提供虚拟网关`10.0.0.254` - 主路由器:Router1(优先级 120) - 备用路由器:Router2(优先级 100) --- ### **配置步骤(以华为设备为例)** #### **1. 配置接口IP地址** ```bash # Router1 interface GigabitEthernet0/0/1 ip address 10.0.0.1 255.255.255.0 # Router2 interface GigabitEthernet0/0/1 ip address 10.0.0.2 255.255.255.0 ``` #### **2. 启用VRRP** ```bash # Router1 interface GigabitEthernet0/0/1 vrrp vrid 1 virtual-ip 10.0.0.254 # 创建VRID 1并指定虚拟IP vrrp vrid 1 priority 120 # 设置优先级(默认100) vrrp vrid 1 preempt-mode timer delay 5 # 启用抢占(延迟5秒) # Router2 interface GigabitEthernet0/0/1 vrrp vrid 1 virtual-ip 10.0.0.254 vrrp vrid 1 priority 100 ``` --- ### **验证命令** ```bash display vrrp brief # 查看VRRP组状态 display vrrp vrid 1 # 检查VRID 1详细信息 ``` 输出示例: ``` VRID State Interface Virtual IP Master IP Priority 1 Master GE0/0/1 10.0.0.254 10.0.0.1 120 ``` --- ### **关键参数说明** 1. **VRID**:虚拟路由器ID(1-255),同一组内设备**必须一致** 2. **Priority**:优先级范围1-254,值越大越优先成为Master 3. **Preempt Mode**:抢占模式(默认开启),确保主设备恢复后重新接管 4. **Advertisement Interval**:心跳报文间隔(默认1秒) --- ### **应用场景** - **企业出口冗余**:双路由器保障互联网接入高可用 - **数据中心多宿网关**:避免单网关故障导致业务中断 - **负载均衡+冗余**:通过多VRRP组分流流量 --- ### **注意事项** 1. 确保**物理接口IP在同一网段** 2. 主备设备间需**允许VRRP协议报文**(IP协议号112) 3. 避免跨网段部署VRRP(需配合三层互通) 4. 生产环境建议启用**认证**(明文或MD5) 如需更复杂配置(如负载均衡、IPv6 VRRP),可进一步提供具体需求。
评论 3
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值