computerの日記

Cisco,SHELL,C,Qt,C++,Linux,ネットワーク,Windows Scriptなどの発言です

STPトポロジ-3(パスコスト変更による通信経路の変更2)

このタスクでは、802.1d PVST Spanning-Tree コマンドにより、VLAN-4 の通信経路を操ります。
このタスクが完遂されれば、PC1 から PC2 への VLAN-4 の ping による通信経路は、PC1-->SW2-->SW3-->SW1-->PC2 となる。

ただ一つのスイッチ上の spanning-tree コマンドが、SW3 が、fa1/14をVLAN-4 のルートポートとすることを選択するようにしなさい。
どのスイッチ上のポートコストも変更してはならない。
どのインタフェースも閉鎖してはならない。
ルートブリッジを変更してはならない。
2つ以上のコマンドを使用して、SW2 が fa1/8 を、VLAN-4 のためのルートポートとなるようにせよ。
どのインタフェースも閉鎖してはならない。
ルートブリッジを変更してはならない。

このタスクが完遂されたら、VLAN-4 のスパニングツリーは、PC1-->SW2(fa1/8)-->SW3(fa1/8)-->SW3(fa1/14)-->SW1(fa1/14)-->PC2 となるようになる。

 

トポロジは、以下を使います。

f:id:intrajp:20171205053028p:plain

 

--------
まず、それぞれのスイッチで、VLAN-4 のスパニングツリーを確認しておく。

SW1#show spanning-tree vlan 4 brief

VLAN4
Spanning tree enabled protocol ieee
Root ID Priority 8192
Address c206.152d.0002
This bridge is the root
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Bridge ID Priority 8192
Address c206.152d.0002
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300

Interface Designated
Name Port ID Prio Cost Sts Cost Bridge ID Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet1/0 128.41 128 19 FWD 0 8192 c206.152d.0002 128.41
FastEthernet1/13 128.54 128 19 FWD 0 8192 c206.152d.0002 128.54
FastEthernet1/14 128.55 128 19 FWD 0 8192 c206.152d.0002 128.55
FastEthernet1/15 128.56 128 19 FWD 0 8192 c206.152d.0002 128.56
Port-channel1 129.65 128 9 FWD 0 8192 c206.152d.0002 129.65

SW2#show spanning-tree vlan 4 brief

VLAN4
Spanning tree enabled protocol ieee
Root ID Priority 8192
Address c206.152d.0002
Cost 9
Port 321 (Port-channel1)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Bridge ID Priority 32768
Address c207.153c.0002
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300

Interface Designated
Name Port ID Prio Cost Sts Cost Bridge ID Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet1/4 128.45 128 19 FWD 9 32768 c207.153c.0002 128.45
FastEthernet1/6 128.47 128 19 FWD 9 32768 c207.153c.0002 128.47
FastEthernet1/7 128.48 128 19 FWD 9 32768 c207.153c.0002 128.48
FastEthernet1/8 128.49 128 19 FWD 9 32768 c207.153c.0002 128.49
Port-channel1 129.65 128 9 FWD 0 8192 c206.152d.0002 129.65

SW3#show spanning-tree vlan 4 brief

VLAN4
Spanning tree enabled protocol ieee
Root ID Priority 8192
Address c206.152d.0002
Cost 19
Port 54 (FastEthernet1/13)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Bridge ID Priority 32768
Address c201.1621.0002
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300

Interface Designated
Name Port ID Prio Cost Sts Cost Bridge ID Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet1/6 128.47 128 19 BLK 9 32768 c207.153c.0002 128.47
FastEthernet1/7 128.48 128 19 BLK 9 32768 c207.153c.0002 128.48
FastEthernet1/8 128.49 128 19 BLK 9 32768 c207.153c.0002 128.49
FastEthernet1/13 128.54 128 19 FWD 0 8192 c206.152d.0002 128.54
FastEthernet1/14 128.55 128 19 BLK 0 8192 c206.152d.0002 128.55
FastEthernet1/15 128.56 128 19 BLK 0 8192 c206.152d.0002 128.56

ここで、SW3 の fa1/14 はブロッキングであり、fa1/13 がフォーワディングとなっている。これを、fa1/14 がフォーワディングになるようにするには、
ポートプライオリティを下げればよいと考えられる。ポートプライオリティは、16の倍数で増える。なので、128 -16 の、112 にすればよいと考える。
ここで、SW3 の peer で実行する必要がある。したがって、SW1 上で、以下のコマンドを発行する。

SW1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
SW1(config)#interface fa1/14
SW1(config-if)#end
SW1#d
*Mar 1 09:36:00.577: %SYS-5-CONFIG_I: Configured from console by console
SW1#debug spanning-tree eve
SW1#debug spanning-tree events
Spanning Tree event debugging is on
SW1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
SW1(config)#interface fa1/14
SW1(config-if)#spanning-tree vlan 4 port-pri
SW1(config-if)#spanning-tree vlan 4 port-priority 112
SW1(config-if)#
*Mar 1 09:36:43.745: STP: VLAN4 Topology Change rcvd on Fa1/14
SW1(config-if)#
*Mar 1 09:37:13.781: STP: VLAN4 Topology Change rcvd on Fa1/14

SW1#show spanning-tree vlan 4 brief

VLAN4
Spanning tree enabled protocol ieee
Root ID Priority 8192
Address c206.152d.0002
This bridge is the root
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Bridge ID Priority 8192
Address c206.152d.0002
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300

Interface Designated
Name Port ID Prio Cost Sts Cost Bridge ID Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet1/0 128.41 128 19 FWD 0 8192 c206.152d.0002 128.41
FastEthernet1/13 128.54 128 19 FWD 0 8192 c206.152d.0002 128.54
FastEthernet1/14 112.55 112 19 FWD 0 8192 c206.152d.0002 112.55
FastEthernet1/15 128.56 128 19 FWD 0 8192 c206.152d.0002 128.56
Port-channel1 129.65 128 9 FWD 0 8192 c206.152d.0002 129.65

SW3 の fa1/14 がフォワードとなってくれたか確認する。
(省略)
なってくれた。

次に、SW2-SW1 間のコストを上げてみる。今、SW2-SW1 間はポートチャネルになっており、そのパスコストは 9 である。
このパスを通させたくないので、SW2-SW3-SW1 とさせるには、そのパスコスト 19 + 19 = 38 より大きい 39 とすれば
よさそうである。

SW2#show spanning-tree vlan 4 brief

VLAN4
Spanning tree enabled protocol ieee
Root ID Priority 8192
Address c206.152d.0002
Cost 9
Port 321 (Port-channel1)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Bridge ID Priority 32768
Address c207.153c.0002
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300

Interface Designated
Name Port ID Prio Cost Sts Cost Bridge ID Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet1/4 128.45 128 19 FWD 9 32768 c207.153c.0002 128.45
FastEthernet1/6 128.47 128 19 FWD 9 32768 c207.153c.0002 128.47
FastEthernet1/7 128.48 128 19 FWD 9 32768 c207.153c.0002 128.48
FastEthernet1/8 128.49 128 19 FWD 9 32768 c207.153c.0002 128.49
Port-channel1 129.65 128 9 FWD 0 8192 c206.152d.0002 129.65

SW2 上で、以下のコマンドを発行する。
SW2#debug spanning-tree events
Spanning Tree event debugging is on
SW2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
SW2(config)#interface port
SW2(config)#interface port-channel 1
SW2(config-if)#spanning-tree vlan 4 cost 39
SW2(config-if)#
*Mar 1 09:13:24.681: STP: VLAN4 new root port Fa1/6, cost 38
*Mar 1 09:13:24.685: STP: VLAN4 sent Topology Change Notice on Fa1/6
*Mar 1 09:13:24.729: STP: VLAN4 Po1 -> blocking
*Mar 1 09:13:24.729: STP: VLAN4 Fa1/7 -> blocking
*Mar 1 09:13:24.781: STP: VLAN4 Fa1/8 -> blocking

SW2#show spanning-tree vlan 4 brief

VLAN4
Spanning tree enabled protocol ieee
Root ID Priority 8192
Address c206.152d.0002
Cost 38
Port 47 (FastEthernet1/6)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Bridge ID Priority 32768
Address c207.153c.0002
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300

Interface Designated
Name Port ID Prio Cost Sts Cost Bridge ID Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet1/4 128.45 128 19 FWD 38 32768 c207.153c.0002 128.45
FastEthernet1/6 128.47 128 19 FWD 19 32768 c201.1621.0002 128.47
FastEthernet1/7 128.48 128 19 BLK 19 32768 c201.1621.0002 128.48
FastEthernet1/8 128.49 128 19 BLK 19 32768 c201.1621.0002 128.49
Port-channel1 129.65 128 39 BLK 0 8192 c206.152d.0002 129.65

SW3 では、以下のようになった。

SW3#
*Mar 1 09:13:23.941: STP: VLAN4 Fa1/6 -> listening
*Mar 1 09:13:23.985: STP: VLAN4 Fa1/7 -> listening
*Mar 1 09:13:24.041: STP: VLAN4 Fa1/8 -> listening
*Mar 1 09:13:24.877: STP: VLAN4 Topology Change rcvd on Fa1/6
*Mar 1 09:13:24.877: STP: VLAN4 sent Topology Change Notice on Fa1/13
SW3#
*Mar 1 09:13:38.949: STP: VLAN4 Fa1/6 -> learning
*Mar 1 09:13:38.985: STP: VLAN4 Fa1/7 -> learning
*Mar 1 09:13:39.049: STP: VLAN4 Fa1/8 -> learning
SW3#
*Mar 1 09:13:53.957: STP: VLAN4 sent Topology Change Notice on Fa1/13
*Mar 1 09:13:53.957: STP: VLAN4 Fa1/6 -> forwarding
*Mar 1 09:13:53.997: STP: VLAN4 sent Topology Change Notice on Fa1/13
*Mar 1 09:13:53.997: STP: VLAN4 Fa1/7 -> forwarding
*Mar 1 09:13:54.057: STP: VLAN4 Fa1/8 -> forwarding

最後に、SW2 上で fa1/8 がフォワードになるようにします。

SW2#conf t
Enter configuration commands, one per line. End with CNTL/Z.
SW2(config)#interface fa1/8
SW2(config-if)#spanning-tree vlan 4 cost 18
SW2(config-if)#
*Mar 1 09:31:42.257: STP: VLAN4 new root port Fa1/8, cost 37
*Mar 1 09:31:42.257: STP: VLAN4 sent Topology Change Notice on Fa1/8
*Mar 1 09:31:42.305: STP: VLAN4 Fa1/6 -> blocking
*Mar 1 09:31:42.305: STP: VLAN4 Fa1/8 -> listening
SW2(config-if)#
*Mar 1 09:31:57.313: STP: VLAN4 Fa1/8 -> learning
SW2(config-if)#
*Mar 1 09:32:12.321: STP: VLAN4 sent Topology Change Notice on Fa1/8
*Mar 1 09:32:12.325: STP: VLAN4 Fa1/8 -> forwarding

SW2#show spanning-tree vlan 4 brief

VLAN4
Spanning tree enabled protocol ieee
Root ID Priority 8192
Address c206.152d.0002
Cost 37
Port 49 (FastEthernet1/8)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Bridge ID Priority 32768
Address c207.153c.0002
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300

Interface Designated
Name Port ID Prio Cost Sts Cost Bridge ID Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet1/4 128.45 128 19 FWD 37 32768 c207.153c.0002 128.45
FastEthernet1/6 128.47 128 19 BLK 19 32768 c201.1621.0002 128.47
FastEthernet1/7 128.48 128 19 BLK 19 32768 c201.1621.0002 128.48
FastEthernet1/8 128.49 128 18 FWD 19 32768 c201.1621.0002 128.49
Port-channel1 129.65 128 39 BLK 0 8192 c206.152d.0002 129.65

SW3、SW1 の VLAN-4 のスパニングツリーも、もう一度確認する。

SW3#show spanning-tree vlan 4 brief

VLAN4
Spanning tree enabled protocol ieee
Root ID Priority 8192
Address c206.152d.0002
Cost 19
Port 55 (FastEthernet1/14)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Bridge ID Priority 32768
Address c201.1621.0002
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300

Interface Designated
Name Port ID Prio Cost Sts Cost Bridge ID Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet1/6 128.47 128 19 FWD 19 32768 c201.1621.0002 128.47
FastEthernet1/7 128.48 128 19 FWD 19 32768 c201.1621.0002 128.48
FastEthernet1/8 128.49 128 19 FWD 19 32768 c201.1621.0002 128.49
FastEthernet1/13 128.54 128 19 BLK 0 8192 c206.152d.0002 128.54
FastEthernet1/14 128.55 128 19 FWD 0 8192 c206.152d.0002 112.55
FastEthernet1/15 128.56 128 19 BLK 0 8192 c206.152d.0002 128.56

SW1#show spanning-tree vlan 4 brief

VLAN4
Spanning tree enabled protocol ieee
Root ID Priority 8192
Address c206.152d.0002
This bridge is the root
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec

Bridge ID Priority 8192
Address c206.152d.0002
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 300

Interface Designated
Name Port ID Prio Cost Sts Cost Bridge ID Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet1/0 128.41 128 19 FWD 0 8192 c206.152d.0002 128.41
FastEthernet1/13 128.54 128 19 FWD 0 8192 c206.152d.0002 128.54
FastEthernet1/14 112.55 112 19 FWD 0 8192 c206.152d.0002 112.55
FastEthernet1/15 128.56 128 19 FWD 0 8192 c206.152d.0002 128.56
Port-channel1 129.65 128 9 FWD 0 8192 c206.152d.0002 129.65

これを読めば、PC1-->SW2(fa1/8)-->SW3(fa1/8)-->SW3(fa1/14)-->SW1(fa1/14)-->PC2 となる
のがわかる。

お疲れさまです。次回をお楽しみに。