1. 程式人生 > 實用技巧 >Cisco Switch L2 STP

Cisco Switch L2 STP

Cisco Switch L2 STP

注意:模擬器中,交換機之間的連線一定要用交叉線,不能用直通線。

提示:

1.將匯聚層交換機設定成根網橋這樣配置生成樹才有意義。

2. 接入層交換機、匯聚層交換機、核心層交換機並非是交換機的種類或者屬性,只是由其所執行的任務來劃分的。

交換機配置(三個交換機配置均相同)

#spanning-tree mode rapid-pvst  // 快速生成樹模式

#interface FastEthernet 0/1
#switchport mode trunk  // 設定介面工作模式為trunk
#exit


#interface FastEthernet 1/1
#switchport mode trunk  // 設定介面工作模式為trunk
#exit

#interface FastEthernet 2/1
#switchport access vlan 10  // 設定介面繫結的 VLAN ID 為 10
#exit

交換機0

Switch>en
Switch#
Switch#show sp
Switch#show spanning-tree vl
Switch#show spanning-tree vlan 10
VLAN0010
  Spanning tree enabled protocol rstp
  Root ID    Priority    32778   (根網橋優先順序)
             Address     000D.BD2A.4802   (根交換機MAC地址)
             Cost        19
             Port        1(FastEthernet0/1)
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32778  (priority 32768 sys-id-ext 10)  (該交換機的優先順序)
             Address     00E0.B0A2.12EC  (該交換機MAC地址)
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  20

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/1            Root FWD 19        128.1    P2p
Fa1/1            Altn BLK 19        128.2    P2p
Fa2/1            Desg FWD 19        128.3    P2p

Switch#
Switch#

交換機1 (根網橋)

Switch>en
Switch#
Switch#show sp
Switch#show spanning-tree vl
Switch#show spanning-tree vlan 10
VLAN0010
  Spanning tree enabled protocol rstp
  Root ID    Priority    32778    (根網橋優先順序)
             Address     000D.BD2A.4802   (根交換機MAC地址)
             This bridge is the root
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32778  (priority 32768 sys-id-ext 10)  (該交換機的優先順序)
             Address     000D.BD2A.4802  (該交換機MAC地址)
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  20

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa1/1            Desg FWD 19        128.2    P2p
Fa0/1            Desg FWD 19        128.1    P2p
Fa2/1            Desg FWD 19        128.3    P2p

Switch#
Switch#

交換機2

Switch>en
Switch#
Switch#show sp
Switch#show spanning-tree v
Switch#show spanning-tree vlan 10
VLAN0010
  Spanning tree enabled protocol rstp
  Root ID    Priority    32778   (根網橋優先順序)
             Address     000D.BD2A.4802   (根交換機MAC地址)
             Cost        19
             Port        1(FastEthernet0/1)
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec

  Bridge ID  Priority    32778  (priority 32768 sys-id-ext 10)  (該交換機的優先順序)
             Address     0090.2B37.79B1   (該交換機MAC地址)
             Hello Time  2 sec  Max Age 20 sec  Forward Delay 15 sec
             Aging Time  20

Interface        Role Sts Cost      Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/1            Root FWD 19        128.1    P2p
Fa1/1            Desg FWD 19        128.2    P2p
Fa2/1            Desg FWD 19        128.3    P2p

Switch#
Switch#

=========== End