网络工程师学习笔记

cisco Switching-三层交换配置STP

2018-07-25  本文已影响25人  凯歌响起

问题

配置Switch1为vlan1的次根,Switch2为vlan1的次根。

配置Switch1为vlan2的次根,Switch2为vlan2的次根

方案

拓扑图

步骤

1.将四台交换机相连的端口配置为中继端口,分别创建vlan2

SM1(config)#vlan 2

SM1(config)#exit

SM1(config)#interface range fastEthernet 0/1-3

SM1(config-if-range)#switchport trunk encapsulation dot1q

SM1(config-if-range)#switchport mode trunk

SM2(config)#vlan 2

SM2(config)#exit

SM2(config)#interface range fastEthernet 0/1-3

SM2(config-if-range)#switchport trunk encapsulation dot1q

SM2(config-if-range)#switchport mode trunk

Switch1(config)#vlan 2

Switch1(config)#exit

Switch1(config)#interface range fastEthernet 0/1-2

Switch1(config-if-range)#switchport mode trunk

Switch2(config)#vlan 2

Switch2(config)#exit

Switch2(config)#interface range fastEthernet 0/1-2

Switch2(config-if-range)#switchportmode trunk

2.设置SM1为vlan1的主根vlan2的次根,设置SM2为vlan2的主根vlan1的次根并查看

SM1(config)#spanning-tree vlan 1 root primary

SM1(config)#spanning-tree vlan 2 root secondary

SM1#show spanning-tree

VLAN0001

Spanning tree enabled protocol ieee

Root ID Priority 24577

Address 00D0.972A.43E5

This bridge is the root

Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Bridge ID Priority 24577 (priority 24576 sys-id-ext 1)

Address 00D0.972A.43E5

Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Aging Time 20

Interface Role Sts Cost Prio.Nbr Type

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

Fa0/2 Desg FWD 19 128.2 P2p

Fa0/3 Desg FWD 19 128.3 P2p

Fa0/1 Desg FWD 19 128.1 P2p

​VLAN0002

Spanning tree enabled protocol ieee

Root ID Priority 24578

Address 00E0.F9CE.7424

Cost 19

Port 3(FastEthernet0/3)

Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Bridge ID Priority 28674 (priority 28672 sys-id-ext 2)

Address 00D0.972A.43E5

Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Aging Time 20

Interface Role Sts Cost Prio.Nbr Type

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

Fa0/2 Desg FWD 19 128.2 P2p

Fa0/3 Root FWD 19 128.3 P2p

Fa0/1 Desg FWD 19 128.1 P2p

SM2(config)#spanning-tree vlan 1 root secondary

SM2(config)#spanning-tree vlan 2 root primary

SM2#show spanning-tree

VLAN0001

Spanning tree enabled protocol ieee

Root ID Priority 24577

Address 00D0.972A.43E5

Cost 19

Port 3(FastEthernet0/3)

Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Bridge ID Priority 28673 (priority 28672 sys-id-ext 1)

Address 00E0.F9CE.7424

Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Aging Time 20

Interface Role Sts Cost Prio.Nbr Type

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

Fa0/2 Desg FWD 19 128.2 P2p

Fa0/1 Desg FWD 19 128.1 P2p

Fa0/3 Root FWD 19 128.3 P2p

​VLAN0002

Spanning tree enabled protocol ieee

Root ID Priority 24578

Address 00E0.F9CE.7424

This bridge is the root

Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Bridge ID Priority 24578 (priority 24576 sys-id-ext 2)

Address 00E0.F9CE.7424

Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Aging Time 20

Interface Role Sts Cost Prio.Nbr Type

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

Fa0/2 Desg FWD 19 128.2 P2p

Fa0/1 Desg FWD 19 128.1 P2p

Fa0/3 Desg FWD 19 128.3 P2p

查看到的结果,Root ID部分指的是根网桥信息,Bridge ID部分是当前所操作的交换机信息,如果二者一致表示当前操作的交换机就是根网桥。

上一篇下一篇

猜你喜欢

热点阅读