Got it

STP (Türkçe Anlatım&Örnek Yapilandirma)

Latest reply: Oct 15, 2021 07:24:50 480 4 2 0 0

 

Merhaba;

Cok Kısa olarak STP;

Spanning  tree  protokolü (STP)  ethernet networklerinde  loop oluşumunun önüne geçebilmek için  switch lerde kullanılan bir protokoldür.

 

STP Example1

1.STP Konfigurasyonu ve kontrolleri

STP protokolüne başlamak  için stp enable  diyerek açıyoruz.

STP modunu seçmek için stp mode stp diyoruz.

SWITCH-S1 ve SWITCH-S2 Cihazları  root durumlarını belirliyoruz(primary, secondary).


<Quidway>system-view

Enter system view, return user view with Ctrl+Z.

[Quidway]sysname SWITCH-S1

[SWITCH-S1]stp mode stp

[SWITCH-S1]stp root primary

<Quidway>system-view

Enter system view, return user view with Ctrl+Z.

[Quidway]sysname SWITCH-S2

[SWITCH-S2]stp mode stp

[SWITCH-S2]stp root secondary


İnterfacelerin STP port rollerini görüntülemek için display stp brief diyoruz.


[SWITCH-S1]display stp brief

MSTID           Port                        Role STP State     Protection

0   GigabitEthernet0/0/9       DESI FORWARDING     NONE

0   GigabitEthernet0/0/10       DESI FORWARDING     NONE

[SWITCH-S2]display stp brief

MSTID      Port                               Role STP State     Protection

0  GigabitEthernet0/0/9       ROOT FORWARDING     NONE

0   GigabitEthernet0/0/10       ALTE DISCARDING     NONE


Herhangi bir interfacein STP ile ilgili bilgileri ve durumunu görmek için display stp interface GigabitEthernet  0/0/10* deriz.    *görüntülemek istediğimiz interface.


[SWITCH-S1]display stp interface GigabitEthernet 0/0/10

—-[CIST][Port10(GigabitEthernet0/0/10)][FORWARDING]—-

Port Protocol       :enabled

Port Role           :Designated Port

Port Priority       :128

Port Cost(Dot1T )   :Config=auto / Active=20000

Desg. Bridge/Port   :0.80fb-06e8-d3c0 / 128.10

Port Edged         :Config=default / Active=disabled

Point-to-point     :Config=auto / Active=true

Transit Limit       :147 packets/hello-time

Protection Type     :None

Port Stp Mode       :STP

Port Protocol Type :Config=auto / Active=dot1s

PortTimes           :Hello 2s MaxAge 20s FwDly 15s RemHop 20

TC or TCN send :33

TC or TCN received :0

BPDU Sent           :874

TCN: 0, Config: 874, RST: 0, MST: 0

BPDU Received       :44

TCN: 0, Config: 44, RST: 0, MST: 0

[SWITCH-S2]display stp interface GigabitEthernet 0/0/10

—-[CIST][Port10(GigabitEthernet0/0/10)][DISCARDING]—-

Port Protocol       :enabled

Port Role           :Alternate Port

Port Priority       :128

Port Cost(Dot1T )   :Config=auto / Active=20000

Desg. Bridge/Port   :0.80fb-06e8-d3c0 / 128.10

Port Edged         :Config=default / Active=disabled

Point-to-point     :Config=auto / Active=true

Transit Limit       :147 packets/hello-time

Protection Type     :None

Port Stp Mode       :STP

Port Protocol Type :Config=auto / Active=dot1s

PortTimes           :Hello 2s MaxAge 20s FwDly 15s RemHop 0

TC or TCN send :17

TC or TCN received :0

BPDU Sent           :86

TCN: 0, Config: 86, RST: 0, MST: 0

BPDU Received       :796

TCN: 0, Config: 796, RST: 0, MST: 0


 2. Root Bridge SeçimiRoot bridge hakkında bilgi edinmek için display stp komutunu kullanıyoruz.


[SWITCH-S1]display stp

——-[CIST Global Info][Mode STP]——-

CIST Bridge         :0   .80fb-06e8-d3c3

Bridge Times       :Hello 2s MaxAge 20s FwDly 15s MaxHop 20

CIST Root/ERPC     :0   .80fb-06e8-d3c3 / 0

CIST RegRoot/IRPC   :0   .80fb-06e8-d3c3 / 0

CIST RootPortId     :0.0

BPDU-Protection     :disabled

CIST Root Type     :PRIMARY root

TC or TCN received :0

TC count per hello :0

STP Converge Mode   :Normal

Time since last TC :0 days 0h:32m:17s

—-[Port1(GigabitEthernet0/0/1)][DOWN]—-

Port Protocol       :enabled

Port Role           :Disabled Port

Port Priority       :128

Port Cost(Dot1T )   :Config=auto / Active=200000000

Desg. Bridge/Port   :0.80fb-06e8-d3c0 / 128.1

Port Edged         :Config=default / Active=disabled

Point-to-point     :Config=auto / Active=false

Transit Limit       :147 packets/hello-time

Protection Type     :None

Port Stp Mode       :MSTP

—- More —-

[SWITCH-S2]display stp

——-[CIST Global Info][Mode STP]——-

CIST Bridge         :4096 .80fb-06ae-2c2e

Bridge Times       :Hello 2s MaxAge 20s FwDly 15s MaxHop 20

CIST Root/ERPC     :0   .80fb-06e8-d3c0 / 20000

CIST RegRoot/IRPC   :4096 .80fb-06ae-2c2e / 0

CIST RootPortId     :128.9

BPDU-Protection     :disabled

CIST Root Type     :SECONDARY root

TC or TCN received :0

TC count per hello :0

STP Converge Mode   :Normal

Time since last TC :0 days 0h:32m:15s

—-[Port1(GigabitEthernet0/0/1)][DOWN]—-

Port Protocol       :enabled

Port Role           :Disabled Port

Port Priority       :128

Port Cost(Dot1T )   :Config=auto / Active=200000000

Desg. Bridge/Port   :4096.80fb-06ae-2c2e / 128.1

Port Edged         :Config=default / Active=disabled

Point-to-point     :Config=auto / Active=false

Transit Limit       :147 packets/hello-time

Protection Type     :None

Port Stp Mode       :MSTP

—- More —-


---->>Root bridge seçimini priority değerleri ile belirlemek için, stp root komutunu kapatırız ve stp priority değeri girerek root bridge seçimini sağlarız. Daha küçük priority değeri olan cihaz daha önceliklidir, en düşük priority değerine sahip olan cihaz Root Bridge seçilecektir.


[SWITCH-S1]undo stp root

[SWITCH-S1]stp priority 8192

[SWITCH-S2]undo stp root

[SWITCH-S2]stp priority 4096


Değiştirdiğimiz priority değerlerini görüntülemek için display stp komutunu kullanabiliriz. CIST Bridge ve CIST Root/ERPC değerleri aynı olan cihaz Root Bridge’imizdir.


<SWITCH-S1>display stp

——-[CIST Global Info][Mode STP]——-

CIST Bridge         :8192 .80fb-06e8-d3c0

Bridge Times       :Hello 2s MaxAge 20s FwDly 15s MaxHop 20

CIST Root/ERPC     :4096 .80fb-06ae-2c2e / 20000

CIST RegRoot/IRPC   :8192 .80fb-06e8-d3c0 / 0

CIST RootPortId     :128.9

BPDU-Protection     :disabled

TC or TCN received :35

TC count per hello :1

STP Converge Mode   :Normal

Time since last TC :0 days 0h:0m:0s

—-[Port1(GigabitEthernet0/0/1)][DOWN]—-

Port Protocol       :enabled

Port Role           :Disabled Port

Port Priority       :128

Port Cost(Dot1T )   :Config=auto / Active=200000000

Desg. Bridge/Port   :8192.80fb-06e8-d3c0 / 128.1

Port Edged         :Config=default / Active=disabled

Point-to-point     :Config=auto / Active=false

Transit Limit       :147 packets/hello-time

Protection Type     :None

Port Stp Mode       :MSTP

Port Protocol Type :Config=auto / Active=dot1s

—- More —-

<SWITCH-S2>display stp

——-[CIST Global Info][Mode STP]——-

CIST Bridge         :4096 .80fb-06ae-2c2e

Bridge Times       :Hello 2s MaxAge 20s FwDly 15s MaxHop 20

CIST Root/ERPC     :4096 .80fb-06ae-2c2e / 0

CIST RegRoot/IRPC   :4096 .80fb-06ae-2c2e / 0

CIST RootPortId     :0.0

BPDU-Protection     :disabled

TC or TCN received :12

TC count per hello :0

STP Converge Mode   :Normal

Time since last TC :0 days 0h:0m:47s

—-[Port1(GigabitEthernet0/0/1)][DOWN]—-

Port Protocol       :enabled

Port Role           :Disabled Port

Port Priority       :128

Port Cost(Dot1T )   :Config=auto / Active=200000000

Desg. Bridge/Port   :4096.80fb-06ae-2c2e / 128.1

Port Edged         :Config=default / Active=disabled

Point-to-point     :Config=auto / Active=false

Transit Limit       :147 packets/hello-time

Protection Type     :None

Port Stp Mode       :MSTP

Port Protocol Type :Config=auto / Active=dot1s

—- More —-


Şimdi SWITCH-S2 Root Bridge olmuş  durumda. CIST Bridge ve CIST Root/ERPC değerleri aynı.

SWITCH-S2 üzerinde GigabitEthernet 0/0/9 ve GigabitEthernet 0/0/10 interfacelerini kapatıyoruz.


[SWITCH-S2]interface GigabitEthernet 0/0/9

[SWITCH-S2-GigabitEthernet0/0/9]shutdown

[SWITCH-S2-GigabitEthernet0/0/9]quit

[SWITCH-S2]interface GigabitEthernet 0/0/10

[SWITCH-S2-GigabitEthernet0/0/10]shutdown

<SWITCH-S1>display stp

——-[CIST Global Info][Mode STP]——-

CIST Bridge         :8192 .80fb-06e8-d3c0

Bridge Times       :Hello 2s MaxAge 20s FwDly 15s MaxHop 20

CIST Root/ERPC     :4096 .80fb-06ae-2c2e / 20000

CIST RegRoot/IRPC   :8192 .80fb-06e8-d3c0 / 0

CIST RootPortId     :128.10

BPDU-Protection     :disabled

TC or TCN received :70

TC count per hello :0

STP Converge Mode   :Normal

Time since last TC :0 days 0h:0m:51s

—-[Port1(GigabitEthernet0/0/1)][DOWN]—-

Port Protocol       :enabled

Port Role           :Disabled Port

Port Priority       :128

Port Cost(Dot1T )   :Config=auto / Active=200000000

Desg. Bridge/Port   :8192.80fb-06e8-d3c0 / 128.1

Port Edged         :Config=default / Active=disabled

Point-to-point     :Config=auto / Active=false

Transit Limit       :147 packets/hello-time

Protection Type     :None

Port Stp Mode       :MSTP

Port Protocol Type :Config=auto / Active=dot1s


Şimdi ise SWITCH-S2’nin bağlantısının kopması ile SWITCH-S1 Root Bridge olmuştur.

SWITCH-S2 üzerindeki interfaceleri tekrar aktif edelim.


[SWITCH-S2]interface GigabitEthernet 0/0/9

[SWITCH-S2-GigabitEthernet0/0/9]undo shutdown

[SWITCH-S2-GigabitEthernet0/0/9]quit

[SWITCH-S2]interface GigabitEthernet 0/0/10

[SWITCH-S2-GigabitEthernet0/0/10]undo shutdown

<SWITCH-S1>display stp

——-[CIST Global Info][Mode STP]——-

CIST Bridge         :8192 .80fb-06e8-d3c0

Bridge Times       :Hello 2s MaxAge 20s FwDly 15s MaxHop 20

CIST Root/ERPC     :4096 .80fb-06ae-2c2e / 20000

CIST RegRoot/IRPC   :8192 .80fb-06e8-d3c0 / 0

CIST RootPortId     :128.9

BPDU-Protection     :disabled

TC or TCN received :70

TC count per hello :0

STP Converge Mode   :Normal

Time since last TC :0 days 0h:3m:23s

—-[Port1(GigabitEthernet0/0/1)][DOWN]—-

Port Protocol       :enabled

Port Role           :Disabled Port

Port Priority       :128

Port Cost(Dot1T )   :Config=auto / Active=200000000

Desg. Bridge/Port   :8192.80fb-06e8-d3c0 / 128.1

Port Edged         :Config=default / Active=disabled

Point-to-point     :Config=auto / Active=false

Transit Limit       :147 packets/hello-time

Protection Type     :None

Port Stp Mode       :MSTP

Port Protocol Type :Config=auto / Active=dot1s

—- More —-

[SWITCH-S2]display stp

——-[CIST Global Info][Mode STP]——-

CIST Bridge         :4096 .80fb-06ae-2c2e

Bridge Times       :Hello 2s MaxAge 20s FwDly 15s MaxHop 20

CIST Root/ERPC     :4096 .80fb-06ae-2c2e / 0

CIST RegRoot/IRPC   :4096 .80fb-06ae-2c2e / 0

CIST RootPortId     :0.0

BPDU-Protection     :disabled

TC or TCN received :14

TC count per hello :0

STP Converge Mode   :Normal

Time since last TC :0 days 0h:0m:17s

—-[Port1(GigabitEthernet0/0/1)][DOWN]—-

Port Protocol       :enabled

Port Role           :Disabled Port

Port Priority       :128

Port Cost(Dot1T )   :Config=auto / Active=200000000

Desg. Bridge/Port   :4096.80fb-06ae-2c2e / 128.1

Port Edged         :Config=default / Active=disabled

Point-to-point     :Config=auto / Active=false

Transit Limit       :147 packets/hello-time

Protection Type     :None

Port Stp Mode       :MSTP

Port Protocol Type :Config=auto / Active=dot1s

—- More —-


SWITCH-S2 üzerindeki interfaceler aktif olduktan sonra, SWITCH-S2 görüldüğü üzere tekrar  Root Bridge olmuştur. CIST Bridge ve CIST Root/ERPC değerleri aynı.


 3. Root Port Seçimi

İnterface rollerini görüntülemek için display stp brief komutunu kullanırız.


<SWITCH-S1>display stp brief

MSTID Port                       Role STP State     Protection

0   GigabitEthernet0/0/9       ROOT FORWARDING     NONE

0   GigabitEthernet0/0/10       ALTE DISCARDING     NONE


Görüldüğü üzere G0/0/9 ‘un root port olduğunu, G0/0/10’un alternate port durumunda olduğunu gösteriyor. Port priority değerlerini değiştirerek G0/0/10’u root port, G0/0/9’u alternate port durumuna getirebiliriz.

G0/0/9 ve G0/0/10 için priority’leri SWITCH-S2 üzerinde değiştiriyoruz.


Port priority default da 128’dir. Root port seçiminde en büyük priority değerine sahip olan seçilir. G0/0/9 için 32, G0/0/10 için  16 priority değeri giriyoruz. SWITCH-S2 üzerinde bu değişiklikleri yaptığımızda SWITCH-S1 üzerinde G0/0/1 Root portumuz oluyor.


[SWITCH-S2]interface GigabitEthernet 0/0/9

[SWITCH-S2-GigabitEthernet0/0/9]stp port priority 32

[SWITCH-S2-GigabitEthernet0/0/9]quit

[SWITCH-S2]interface GigabitEthernet 0/0/10

[SWITCH-S2-GigabitEthernet0/0/10]stp port priority 16


Port priotity değerlerini SWITCH-S2 üzerinde değiştirdik, SWITCH-S1 üzerinde değil!


[SWITCH-S2]display stp interface GigabitEthernet 0/0/9

—-[CIST][Port9(GigabitEthernet0/0/9)][FORWARDING]—-

Port Protocol       :enabled

Port Role           :Designated Port

Port Priority       :32

Port Cost(Dot1T )   :Config=auto / Active=20000

Desg. Bridge/Port   :4096.80fb-06ae-2c2e / 32.9

Port Edged         :Config=default / Active=disabled

Point-to-point     :Config=auto / Active=true

Transit Limit       :147 packets/hello-time

Protection Type     :None

Port Stp Mode       :STP

Port Protocol Type :Config=auto / Active=dot1s

PortTimes           :Hello 2s MaxAge 20s FwDly 15s RemHop 20

TC or TCN send :36

TC or TCN received :1

BPDU Sent           :189

TCN: 0, Config: 189, RST: 0, MST: 0

BPDU Received       :2

TCN: 1, Config: 1, RST: 0, MST: 0

[SWITCH-S2]display stp interface GigabitEthernet 0/0/10

—-[CIST][Port10(GigabitEthernet0/0/10)][FORWARDING]—-

Port Protocol       :enabled

Port Role           :Designated Port

Port Priority       :16

Port Cost(Dot1T )   :Config=auto / Active=20000

Desg. Bridge/Port   :4096.80fb-06ae-2c2e / 16.10

Port Edged         :Config=default / Active=disabled

Point-to-point     :Config=auto / Active=true

Transit Limit       :147 packets/hello-time

Protection Type     :None

Port Stp Mode       :STP

Port Protocol Type :Config=auto / Active=dot1s

PortTimes           :Hello 2s MaxAge 20s FwDly 15s RemHop 20

TC or TCN send :35

TC or TCN received :1

BPDU Sent           :224

TCN: 0, Config: 224, RST: 0, MST: 0

BPDU Received       :1

TCN: 1, Config: 0, RST: 0, MST: 0


SWITCH-S1 üzerinde display stp brief komutunu yazdığımızda, interface rollerini görüyoruz.


<SWITCH-S1>display stp brief

MSTID Port                       Role STP State     Protection

0   GigabitEthernet0/0/9       ALTE DISCARDING     NONE

0   GigabitEthernet0/0/10       ROOT FORWARDING     NONE


SWITCH-S1 üzerinde G0/0/10 Root port olmuş  durumda, G0/0/9 ise alternatif port durumuna geçmiş.

SWITCH-S1 üzerinde G0/0/10 interfaceini kapatalım ve rol durumlarına bakıyoruz.


[SWITCH-S1]interface GigabitEthernet 0/0/10

[SWITCH-S1-GigabitEthernet0/0/10]shutdown

[SWITCH-S1-GigabitEthernet0/0/10]quit

[SWITCH-S1]display stp brief

MSTID Port                      Role STP State     Protection

0   GigabitEthernet0/0/9       ROOT LEARNING       NONE


Bu durumda G0/0/9’un Root port olduğunu görüyoruz.

SWITCH-S2 üzerinde G0/0/9 ve G0/0/10 içibn default priority değerlerine geri dönelim ve SWITCH-S1 üzerinde G0/0/10 interfaceimizi tekrar aktif hale getirelim.


[SWITCH-S2]interface GigabitEthernet 0/0/9

[SWITCH-S2-GigabitEthernet0/0/9]undo stp port priority

[SWITCH-S2-GigabitEthernet0/0/9]quit

[SWITCH-S2]interface GigabitEthernet 0/0/10

[SWITCH-S2-GigabitEthernet0/0/10]undo stp port priority

[SWITCH-S1]interface GigabitEthernet 0/0/10

[SWITCH-S1-GigabitEthernet0/0/10]undo shutdown


SWITCH-S1 üzerinde interface rollerini görüntülemek için; display stp brief ve display stp interface komutlarını kullanalım.


[SWITCH-S1]display stp brief

MSTID Port                       Role STP State     Protection

0   GigabitEthernet0/0/9       ROOT FORWARDING     NONE

0   GigabitEthernet0/0/10       ALTE DISCARDING     NONE

[SWITCH-S1]display stp interface GigabitEthernet 0/0/9

—-[CIST][Port9(GigabitEthernet0/0/9)][FORWARDING]—-

Port Protocol       :enabled

Port Role           :Root Port

Port Priority       :128

Port Cost(Dot1T )   :Config=auto / Active=20000

Desg. Bridge/Port   :4096.80fb-06ae-2c2e / 128.9

Port Edged         :Config=default / Active=disabled

Point-to-point     :Config=auto / Active=true

Transit Limit       :147 packets/hello-time

Protection Type     :None

Port Stp Mode       :STP

Port Protocol Type :Config=auto / Active=dot1s

PortTimes           :Hello 2s MaxAge 20s FwDly 15s RemHop 0

TC or TCN send :3

TC or TCN received :73

BPDU Sent           :4

TCN: 3, Config: 1, RST: 0, MST: 0

BPDU Received       :519

TCN: 0, Config: 519, RST: 0, MST: 0

[SWITCH-S1]display stp interface GigabitEthernet 0/0/10

—-[CIST][Port10(GigabitEthernet0/0/10)][DISCARDING]—-

Port Protocol       :enabled

Port Role           :Alternate Port

Port Priority       :128

Port Cost(Dot1T )   :Config=auto / Active=20000

Desg. Bridge/Port   :4096.80fb-06ae-2c2e / 128.10

Port Edged         :Config=default / Active=disabled

Point-to-point     :Config=auto / Active=true

Transit Limit       :147 packets/hello-time

Protection Type     :None

Port Stp Mode       :STP

Port Protocol Type :Config=auto / Active=dot1s

PortTimes          :Hello 2s MaxAge 20s FwDly 15s RemHop 0

TC or TCN send :0

TC or TCN received :17

BPDU Sent           :1

TCN: 0, Config: 1, RST: 0, MST: 0

BPDU Received       :54

TCN: 0, Config: 54, RST: 0, MST: 0


G0/0/9 ve G0/0/10 için cost değerleri default’da  20000 olarak gözüküyor.  SWITCH-S1 üzerinde G0/0/9 için cost değerini 200000 olarak girelim.


[SWITCH-S1]interface GigabitEthernet 0/0/9

[SWITCH-S1-GigabitEthernet0/0/9]stp cost 200000


SWITCH-S1 üzerinde interface rollerini görüntülemek için; display stp brief ve display stp interface komutlarını giriyoruz.


<SWITCH-S1>display stp interface GigabitEthernet 0/0/9

—-[CIST][Port9(GigabitEthernet0/0/9)][DISCARDING]—-

Port Protocol       :enabled

Port Role           :Alternate Port

Port Priority       :128

Port Cost(Dot1T )   :Config=200000 / Active=200000

Desg. Bridge/Port   :4096.80fb-06ae-2c2e / 128.9

Port Edged         :Config=default / Active=disabled

Point-to-point     :Config=auto / Active=true

Transit Limit       :147 packets/hello-time

Protection Type     :None

Port Stp Mode       :STP

Port Protocol Type :Config=auto / Active=dot1s

PortTimes           :Hello 2s MaxAge 20s FwDly 15s RemHop 0

TC or TCN send :3

TC or TCN received :89

BPDU Sent           :4

TCN: 3, Config: 1, RST: 0, MST: 0

BPDU Received       :569

TCN: 0, Config: 569, RST: 0, MST: 0

<SWITCH-S1>display stp brief

MSTID Port                       Role STP State     Protection

0   GigabitEthernet0/0/9       ALTE DISCARDING     NONE

0   GigabitEthernet0/0/10       ROOT FORWARDING     NONE


Göründüğü gibi G0/0/10 Root port durumuna geçmiş.


ve sonuç!


<SWITCH-S1>display current-configuration

#

!Software Version V100R005C01SPC100

sysname SWITCH-S1

#

stp mode stp

stp instance 0 priority 8192

stp enable

#

interface GigabitEthernet0/0/9

stp instance 0 cost 200000

bpdu enable

#

interface GigabitEthernet0/0/10

bpdu enable

#

user-interface con 0

idle-timeout 0 0

user-interface vty 0 4

#

return

 


It's a good case, we also use ERPS to break the access ring.
View more
  • x
  • convention:

Thank you for sharing, my friend!
View more
  • x
  • convention:

you're welcome friends
View more
  • x
  • convention:

Thank you
View more
  • x
  • convention:

Comment

You need to log in to comment to the post Login | Register

Notice: To protect the legitimate rights and interests of you, the community, and third parties, do not release content that may bring legal risks to all parties, including but are not limited to the following:
  • Politically sensitive content
  • Content concerning pornography, gambling, and drug abuse
  • Content that may disclose or infringe upon others ' commercial secrets, intellectual properties, including trade marks, copyrights, and patents, and personal privacy
Do not share your account and password with others. All operations performed using your account will be regarded as your own actions and all consequences arising therefrom will be borne by you. For details, see " User Agreement."

My Followers

Login and enjoy all the member benefits

Login

Block
Are you sure to block this user?
Users on your blacklist cannot comment on your post,cannot mention you, cannot send you private messages.
Reminder
Please bind your phone number to obtain invitation bonus.