生成树实现vlan负载均衡实例
此实验是通过调整交换机优先级,调整交换机和交换机端
口状态。
交换机MAC
SW-A 0001.4289.C66C
SW-B 0003.E477.8A44
SW-C 00E0.B0EC.3322
实验拓扑
基本配置
三台交换机上把互联口配置成trunk,分别创建
vlan 2。
SW-A#show run
!
port-channel load-balance src-mac
spanning-tree vlan 1 priority 4096
spanning-tree vlan 2 priority 8192
!
!
interface GigabitEthernet0/1
switchport mode trunk
!
interface GigabitEthernet0/2
switchport mode trunk
!
SW-B#show run
!
port-channel load-balance src-mac
spanning-tree vlan 2 priority 4096
spanning-tree vlan 1 priority 8192
!
!
interface GigabitEthernet0/1
switchport mode trunk
!
interface GigabitEthernet0/2
switchport mode trunk
!
SW-C#show run
!
interface GigabitEthernet0/1
switchport mode trunk
!
interface GigabitEthernet0/2
switchport mode trunk
!
验证结果
SW-A#show spanning-tree vlan 1
VLAN0001
Spanning tree enabled protocol ieee
Root ID Priority 4097
Address 0001.4289.C66C
This bridge is the root
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 4097 (priority 4096 sys-id-ext 1)
Address 0001.4289.C66C
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 20
Interface Role Sts Cost Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Gi0/1 Desg FWD 4 128.25 P2p
Gi0/2 Desg FWD 4 128.26 P2p
SW-A#show spanning-tree vlan 2
VLAN0002
Spanning tree enabled protocol ieee
Root ID Priority 4098
Address 0003.E477.8A44
Cost 4
Port 25(GigabitEthernet0/1)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 8194 (priority 8192 sys-id-ext 2)
Address 0001.4289.C66C
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 20
Interface Role Sts Cost Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Gi0/1 Root FWD 4 128.25 P2p
Gi0/2 Desg FWD 4 128.26 P2p
******************************************************************************
SW-B#show spanning-tree vlan 1
VLAN0001
Spanning tree enabled protocol ieee
Root ID Priority 4097
Address 0001.4289.C66C
Cost 4
Port 26(GigabitEthernet0/2)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 8193 (priority 8192 sys-id-ext 1)
Address 0003.E477.8A44
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 20
Interface Role Sts Cost Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Gi0/2 Root FWD 4 128.26 P2p
Gi0/1 Desg FWD 4 128.25 P2p
SW-B#show spanning-tree vlan 2
VLAN0002
Spanning tree enabled protocol ieee
Root ID Priority 4098
Address 0003.E477.8A44
This bridge is the root
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 4098 (priority 4096 sys-id-ext 2)
Address 0003.E477.8A44
Hello Time 2 sec Max