ขออภัย!! บันทึกนี้กำลังอยู่ในขณะกำลังทำการเขียน
สวัสดีครับ หลังจากที่ผมไม่ได้เขียน Blog นี้มานานพอสมควรเพราะคิดว่าตนเองยังมีความสามารถไม่พอ
ที่จะสอนที่จะสอนคนอื่นเขา แต่นานวันไปผมก็เก็บเกี่ยวประสบการณ์มากขึ้น แต่อะไรที่ผมจะเขียนต่อไปนี้
ผิดพลาดอย่างไรก็บอกกล่าวกันมานะครับ เพราะผมก็ไม่ได้เก่งอะไรมากมาย
Referance simulation by GNS3 0.6 ,IOS: c2600-advsecurityk9-mz.123-11.T2วัตถุประสงค์ของ Lab นี้ ตามที่เอกสารบอกว่า คือ การดูสิ่งที่เกิดขึ้นเมื่อของ default spanning tree
ก่อนที่ Modified
ใช้ 4 switches โดย distribution layer switches เป็น Catalyst 3560 และ access layer switches เป็น Catalyst 2960 แล้วก็ต่อ redundant uplinks ระหว่าง access layer กับ distribution layer ก็เพราะตามด้านล่างครับ
Because of the possibility of bridging loops, spanning tree logically
removes any redundant links. In this lab, you will see what happens when
the default spanning tree behavior is modified
แต่เราจะใช้ GNS3 ซึ่งไม่ switch ให้ใช้ เราจึงใช้ router 2600 เสียบ NM-16ESW
แล้วสามารถนำมาทำเป็น switch ได้
เมื่อใส่ NM-16ESW ครบทั้งสี่ตัวแล้วก็เปลี่ยนชื่อ Router แล้วก็ลากสายต่อกันตามรูปครับ
เคลียร์ Switch เพื่อเตรียมความพร้อมของทั้งสี่สวิทช์ ต่อสายอุปกรณ์ตามที่แสดงในรูป ตั้งชื่อ host โดย Config ตามนี้ครับ
Switch>enable
Switch#configure terminal
Switch(config)#hostname DLS1
Switch#configure terminal
Switch(config)#hostname DLS2
Switch>enable
Switch#configure terminal
Switch(config)#hostname ALS1
ALS1(config-line)#login
Switch>enable
Switch# configure terminal
Switch(config)#hostname ALS2
หลังจากเรา Connected switch เข้าด้วยกันแล้ว switch จะ detects redundant links เพื่อคำนวณ spanning tree แต่ตามปกติแล้ว spanning tree protocol จะทำงานที่ทุก port เมื่อเราต่อlinkใหม่ขึ้นที่ port ใหม่ port นั้นก็จะ listening, learning, forwarding states ก่อนที่จพทำงานจริงๆ
เรามาเช็ค STP โดยลอง show spanning-tree command ที่ DLS1 ดู
DLS1#show spanning-tree
แต่ปรากฎว่า No spanning tree instances exist. ซะงั้น แต่อย่าตกใจครับอย่าลืมว่าเราใช้ GNS3 ในการทำ Lab ไม่ได้ใช้ตัว Switch จริงๆในการทำ คือในที่นี้เรายังไม่ได้ No shut ของ port แต่ล่ะ port interface เลยไม่ Up ดังนั้นเราก็จัดการ no shut มันซะ ทำกับ switch ทุกตัวเลยนะครับ
DLS1#conf t
DLS1(config)#interface range fastEthernet 1/0 - 15
DLS1(config-if-range)#no shutdown
แล้วเราก็ มา DLS1#show spanning-tree ใหม่ ต่อก็จะได้ครับแต่ผลของ command ได้ออกมาเป็นแบบนี้ครับ
VLAN1 is executing the ieee compatible Spanning Tree protocol
Bridge Identifier has priority 32768, address c804.09f0.0000
Configured hello time 2, max age 20, forward delay 15
We are the root of the spanning tree
Topology change flag not set, detected flag not set
Number of topology changes 2 last change occurred 00:09:30 ago
from FastEthernet1/11
Times: hold 1, topology change 35, notification 2
hello 2, max age 20, forward delay 15
Timers: hello 1, topology change 0, notification 0, aging 0
Port 48 (FastEthernet1/7) of VLAN1 is forwarding
Port path cost 19, Port priority 128, Port Identifier 128.48.
Designated root has priority 32768, address c804.09f0.0000
Designated bridge has priority 32768, address c804.09f0.0000
Designated port id is 128.48, designated path cost 0
Timers: message age 0, forward delay 0, hold 0
Number of transitions to forwarding state: 1
BPDU: sent 406, received 3
Port 49 (FastEthernet1/8) of VLAN1 is forwarding
Port path cost 19, Port priority 128, Port Identifier 128.49.
Designated root has priority 32768, address c804.09f0.0000
Designated bridge has priority 32768, address c804.09f0.0000
Designated port id is 128.49, designated path cost 0
Timers: message age 0, forward delay 0, hold 0
Number of transitions to forwarding state: 1
BPDU: sent 405, received 1
Port 50 (FastEthernet1/9) of VLAN1 is forwarding
Port path cost 19, Port priority 128, Port Identifier 128.50.
Designated root has priority 32768, address c804.09f0.0000
Designated bridge has priority 32768, address c804.09f0.0000
Designated port id is 128.50, designated path cost 0
Timers: message age 0, forward delay 0, hold 0
Number of transitions to forwarding state: 1
BPDU: sent 407, received 4
Port 51 (FastEthernet1/10) of VLAN1 is forwarding
Port path cost 19, Port priority 128, Port Identifier 128.51.
Designated root has priority 32768, address c804.09f0.0000
Designated bridge has priority 32768, address c804.09f0.0000
Designated port id is 128.51, designated path cost 0
Timers: message age 0, forward delay 0, hold 0
Number of transitions to forwarding state: 1
BPDU: sent 405, received 1
Port 52 (FastEthernet1/11) of VLAN1 is forwarding
Port path cost 19, Port priority 128, Port Identifier 128.52.
Designated root has priority 32768, address c804.09f0.0000
Designated bridge has priority 32768, address c804.09f0.0000
Designated port id is 128.52, designated path cost 0, Topology change is set
Timers: message age 0, forward delay 0, hold 0
Number of transitions to forwarding state: 1
BPDU: sent 406, received 3
Port 53 (FastEthernet1/12) of VLAN1 is forwarding
Port path cost 19, Port priority 128, Port Identifier 128.53.
Designated root has priority 32768, address c804.09f0.0000
Designated bridge has priority 32768, address c804.09f0.0000
Designated port id is 128.53, designated path cost 0
Timers: message age 0, forward delay 0, hold 0
Number of transitions to forwarding state: 1
BPDU: sent 405, received 1
ซึ่งก็อย่างที่บอกครับว่าเราใช้ GNS3 ในการทำ Lab จะมีบางส่วนที่ไม่เหมือนกับ switch จริง ในที่นี้เราต้องใช้ command
DLS1#sh spanning-tree brief
VLAN1
Spanning tree enabled protocol ieee
Root ID Priority 32768
Address c800.0768.0000
Cost 19
Port 50 (FastEthernet1/9)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 32768
Address c802.0768.0000
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 0
Interface Designated
Name Port ID Prio Cost Sts Cost Bridge ID Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet1/7 128.48 128 19 FWD 19 32768 c802.0768.0000 128.48
FastEthernet1/8 128.49 128 19 FWD 19 32768 c802.0768.0000 128.49
FastEthernet1/9 128.50 128 19 FWD 0 32768 c800.0768.0000 128.50
FastEthernet1/10 128.51 128 19 BLK 0 32768 c800.0768.0000 128.51
FastEthernet1/11 128.52 128 19 BLK 19 32768 c801.0768.0000 128.52
FastEthernet1/12 128.53 128 19 BLK 19 32768 c801.0768.0000 128.53
DLS2#show spanning-tree brief
VLAN1
Spanning tree enabled protocol ieee
Root ID Priority 32768
Address c800.0768.0000
Cost 19
Port 48 (FastEthernet1/7)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 32768
Address c801.0768.0000
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 0
Interface Designated
Name Port ID Prio Cost Sts Cost Bridge ID Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet1/7 128.48 128 19 FWD 0 32768 c800.0768.0000 128.48
FastEthernet1/8 128.49 128 19 BLK 0 32768 c800.0768.0000 128.49
FastEthernet1/9 128.50 128 19 FWD 19 32768 c801.0768.0000 128.50
FastEthernet1/10 128.51 128 19 FWD 19 32768 c801.0768.0000 128.51
FastEthernet1/11 128.52 128 19 FWD 19 32768 c801.0768.0000 128.52
FastEthernet1/12 128.53 128 19 FWD 19 32768 c801.0768.0000 128.53
ALS1#sh spanning-tree brief
VLAN1
Spanning tree enabled protocol ieee
Root ID Priority 32768
Address c800.0768.0000
Cost 19
Port 52 (FastEthernet1/11)
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 32768
Address c803.0768.0000
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 0
Interface Designated
Name Port ID Prio Cost Sts Cost Bridge ID Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet1/7 128.48 128 19 BLK 19 32768 c802.0768.0000 128.48
FastEthernet1/8 128.49 128 19 BLK 19 32768 c802.0768.0000 128.49
FastEthernet1/9 128.50 128 19 BLK 19 32768 c801.0768.0000 128.50
FastEthernet1/10 128.51 128 19 BLK 19 32768 c801.0768.0000 128.51
FastEthernet1/11 128.52 128 19 FWD 0 32768 c800.0768.0000 128.52
FastEthernet1/12 128.53 128 19 BLK 0 32768 c800.0768.0000 128.53
ALS2#sh spanning-tree brief
VLAN1
Spanning tree enabled protocol ieee
Root ID Priority 32768
Address c800.0768.0000
This bridge is the root
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Bridge ID Priority 32768
Address c800.0768.0000
Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec
Aging Time 0
Interface Designated
Name Port ID Prio Cost Sts Cost Bridge ID Port ID
-------------------- ------- ---- ----- --- ----- -------------------- -------
FastEthernet1/7 128.48 128 19 FWD 0 32768 c800.0768.0000 128.48
FastEthernet1/8 128.49 128 19 FWD 0 32768 c800.0768.0000 128.49
FastEthernet1/9 128.50 128 19 FWD 0 32768 c800.0768.0000 128.50
FastEthernet1/10 128.51 128 19 FWD 0 32768 c800.0768.0000 128.51
FastEthernet1/11 128.52 128 19 FWD 0 32768 c800.0768.0000 128.52
FastEthernet1/12 128.53 128 19 FWD 0 32768 c800.0768.0000 128.53
เมื่อเราเช็ค spanning-tree ดูแต่ล่ะ switch แล้ว สังเกตุได้ว่่าระหว่าง switch สองตัวจะมี 1 port ที่ block อยู่ครับซึ่งเป็นไปตาม spanning-tree โดยใน LAB นี้ก็เสร็จแล้วนะครับ ทำให้เราได้เห็นเรื่องของ spanning-tree โดยไปตามค่า default ของ switch ครับ
Cool article krub I can see you try on it