高速スパニングツリーの設定
まず、テスト対象
- スパニングツリープロトコルの動作原理を理解します
- ラピッドスパニングツリープロトコルRSTPは、基本的な構成を把握します
第二に、実験的な背景
教育と学校のコンピュータネットワーク事務を行うために、あなたは、ネットワーク管理者として、ネットワークの信頼性を向上させるために、2つのスイッチで構成キャンパスネットワーク内のこれら2つの相互接続されたコンピュータネットワークをコンピュータ教室や学校の事務室を設立スイッチを相互接続する2つのリンクを使用し、今のループを回避するために、ネットワーク上に配置されている適切なスイッチを作るために必要とされています
第三に、技術的な原則
ツリープロトコル(スパニングツリー)、スイッチングネットワーク内の冗長リンクを提供する役割をまたがる、ネットワークを切り替えるループを解決します
スパニングツリーアルゴリズムは、スイッチング・ループ・ネットワークの存在下で、ツリー状ネットワークにおけるループを発生させることなく、SPAを使用することです。このアルゴリズムでは、プライマリリンクが失敗したときに、論理的に、切断されたネットワーク交換リンクの冗長性を使用して、自動的に通常のデータ転送を保証するために、バックアップリンクに切り替えることができます
スパニングツリープロトコルのバージョン:STP、RSTP(高速スパニングツリー)、MSTP(マルチプルスパニングツリープロトコル)
プライマリリンクが50秒の時間を必要とバックアップリンクへの切り替えに失敗したから、長い時間のためのSTPの収束特性、
冗長ルートポートと指定ポートなどの代替ポートとバックアップポート、それぞれ:追加した2つのポートの役割に基づいて、ラピッドスパニングツリープロトコルスパニングツリープロトコル。指定されたルートポートまたはポート障害場合、50秒の冗長ポート収束時間を必要としない、RSTPの迅速な収束を可能にする1秒未満である、代替ポートまたはバックアップポートに直接切り替えることができます
第四に、実験手順
ラボトポロジ
デフォルトでは、BPDUは、プロトコルデータユニットを送信された2つのスイッチを介して有効STPプロトコルは、ルートスイッチは、ポートフォワーディングの状態を決定するために、ルートポートが選択されます。ポート上図はオレンジ詰まり状態ブロックとしてマークされています
実験手順
RSTPを設定し
、ルートスイッチおよびルートポートの状況を理解するためのスイッチのショースパニングツリーステータスを表示、
優先スパニングツリーに4096をスパニングツリースイッチを変更することによって、ルートスイッチのVLAN *優先順位の役割を変更することがあり、
S1:
Switch>en
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname S1
S1(config)#end
S1#
%SYS-5-CONFIG_I: Configured from console by console
S1#show spanning-tree //查看交换机spanning-tree 状态
VLAN0001
Spanning tree enabled protocol ieee
Root ID Priority 32769
Address 0060.5C36.5620
Cost 19
Port 1(FastEthernet0/1)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 32769 (priority 32768 sys-id-ext 1)
Address 0060.7078.8BDE
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 20
Interface Role Sts Cost Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/10 Desg FWD 19 128.10 P2p
Fa0/1 Root FWD 19 128.1 P2p
Fa0/2 Altn BLK 19 128.2 P2p
S1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
S1(config)#interface fa0/10
S1(config-if)#switchport access vlan 10 //将fa0/10划分到vlan 10
% Access VLAN does not exist. Creating vlan 10
S1(config-if)#exit
S1(config)#interface range fa0/1 - 2 //设置fa0/1,fa0/2端口状态为trunk模式
S1(config-if-range)#switchport mode trunk
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/2, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/2, changed state to up
S1(config-if-range)#exit
S1(config)#spanning-tree mode ? //设置spanning-tree 为RSTP模式
pvst Per-Vlan spanning tree mode
rapid-pvst Per-Vlan rapid spanning tree mode
S1(config)#spanning-tree mode rapid-pvst
S1(config)#
S2:
Switch>en
Switch#show spanning-tree
VLAN0001
Spanning tree enabled protocol ieee
Root ID Priority 32769
Address 0060.5C36.5620
This bridge is the root //根交换机
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 32769 (priority 32768 sys-id-ext 1)
Address 0060.5C36.5620
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 20
Interface Role Sts Cost Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/1 Desg FWD 19 128.1 P2p
Fa0/2 Desg FWD 19 128.2 P2p
Fa0/10 Desg FWD 19 128.10 P2p
Switch#
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/2, changed state to down
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/2, changed state to up
Switch#
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#hostname S2
S2(config)#interface fa0/10
S2(config-if)#switchport access vlan 10
% Access VLAN does not exist. Creating vlan 10
S2(config-if)#exit
S2(config)#interface range fa0/1 - 2
S2(config-if-range)#switchport mode trunk
S2(config-if-range)#exit
S2(config)#spanning-tree mode rapid-pvst
S2(config)#
ファイブテスト
プライマリリンクがダウンしているとき、自動的に通常のデータ転送を保証するために、バックアップリンクに切り替えることができます。
S2シャットダウンでオフFA0 / 1
Switch#conf t
Enter configuration commands, one per line. End with CNTL/Z.
Switch(config)#int
Switch(config)#interface fa0/1
Switch(config-if)#shu
Switch(config-if)#shutdown //shutdown fa0/1端口
Switch(config-if)#
%LINK-5-CHANGED: Interface FastEthernet0/1, changed state to administratively down
%LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down
Switch#show spanning-tree
VLAN0001
Spanning tree enabled protocol rstp
Root ID Priority 32769
Address 0001.63E2.4A7A
This bridge is the root
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 32769 (priority 32768 sys-id-ext 1)
Address 0001.63E2.4A7A
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 20
Interface Role Sts Cost Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/1 Desg FWD 19 128.1 P2p
Fa0/2 Desg FWD 19 128.2 P2p
VLAN0010
Spanning tree enabled protocol rstp
Root ID Priority 32778
Address 0001.63E2.4A7A
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 0001.63E2.4A7A
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 20
Interface Role Sts Cost Prio.Nbr Type
---------------- ---- --- --------- -------- --------------------------------
Fa0/1 Desg FWD 19 128.1 P2p
Fa0/2 Desg FWD 19 128.2 P2p
Fa0/10 Desg FWD 19 128.10 P2p
Switch#
PC1:
PC>ipconfig
IP Address......................: 192.168.1.2
Subnet Mask.....................: 255.255.255.0
Default Gateway.................: 192.168.1.1
PC>ping -t 192.168.1.3
Pinging 192.168.1.3 with 32 bytes of data:
Reply from 192.168.1.3: bytes=32 time=78ms TTL=128
Reply from 192.168.1.3: bytes=32 time=94ms TTL=128
Reply from 192.168.1.3: bytes=32 time=78ms TTL=128
Reply from 192.168.1.3: bytes=32 time=78ms TTL=128
Reply from 192.168.1.3: bytes=32 time=78ms TTL=128
Reply from 192.168.1.3: bytes=32 time=94ms TTL=128
Reply from 192.168.1.3: bytes=32 time=93ms TTL=128
Reply from 192.168.1.3: bytes=32 time=93ms TTL=128
Reply from 192.168.1.3: bytes=32 time=62ms TTL=128
Reply from 192.168.1.3: bytes=32 time=94ms TTL=128
Reply from 192.168.1.3: bytes=32 time=79ms TTL=128
Reply from 192.168.1.3: bytes=32 time=94ms TTL=128
......