#2 Huawei. Как настроить STP, RSTP и MSTP на Huawei

Настроим STP

На S1 GE1/0/2 и GE1/0/3 выключены, чтобы не было петель 

S1

sys
[~S1]stp mode stp
[*S1]stp priority 4096
[*S1]stp enable
Warning: The global STP state will be changed. Continue? [Y/N]:Y
[*S1]commit
[~S1]display stp
[~S1]disp stp br

S2

<S2>sys
[~S2]stp mode stp
[*S2]stp priority 8192
[*S2]stp enable
[*S2]commit
[~S2]display stp
[~S2]disp stp br

S3

<S3>sys
[~S3]stp mode stp
[*S3]stp enable
[*S3]commit
[~S3]disp stp

S4

<S4>sys
[~S4]stp mode stp
[*S4]stp enable
[*S4]commit
[~S4]display stp
[~S4]disp stp br

Включим на S1 GE1/0/2 и GE1/0/3

Подождем 

Проверим как изменилась топология, на коммутаторах выполним

display stp
disp stp br
disp stp interface GE1/0/3 // конкретный порт

Сбросим настройки коммутаторов

Настроим RSTP

На S1 GE1/0/1 и GE1/0/3 выключены, чтобы не было петель 

S1

<HUAWEI>sys
[~HUAWEI]sysname S1
[*HUAWEI]commit
[~S1]stp mode rstp
[*S1]stp priority 4096
[*S1]stp enable
Warning: The global STP state will be changed. Continue? [Y/N]:Y
[*S1]commit

S2

<HUAWEI>sys
[~HUAWEI]sysname S2
[*HUAWEI]commit
[~S2]stp mode rstp
[*S2]stp priority 8192
[*S2]stp enable
Warning: The global STP state will be changed. Continue? [Y/N]:Y
[*S2]commit

S3

<HUAWEI>sys
[~HUAWEI]sysname S3
[*HUAWEI]commit
[~S3]stp mode rstp
[*S3]stp enable
Warning: The global STP state will be changed. Continue? [Y/N]:Y
[*S3]commit

S4

<HUAWEI>sys
[~HUAWEI]sysname S4
[*HUAWEI]commit
[~S4]stp mode rstp
[*S4]stp enable
Warning: The global STP state will be changed. Continue? [Y/N]:Y
[*S4]commit

Включим на S1 GE1/0/1 и GE1/0/3

Проверим на всех коммутаторах как выглядит топология 

display stp brief

Внесем изменения в топологию с помощью Cost на интерфейсах

S1

[~S1]int GE1/0/1
[~S1-GE1/0/1]stp cost 20000
[*S1-GE1/0/1]q
[*S1]commit

S2

[~S2]int GE1/0/1
[~S2-GE1/0/1]stp cost 20000
[*S2-GE1/0/1]q
[*S2]commit

S3

[~S3]int GE1/0/3
[~S3-GE1/0/3]stp cost 100000
[*S3-GE1/0/3]q
[*S3]commit

S4

[~S4]int GE1/0/3
[~S4-GE1/0/3]stp cost 100000
[*S4-GE1/0/3]q
[*S4]commit

Проверим на всех коммутаторах как выглядит топология после внесенных изменений

display stp brief

В зависимости от того, как у вас ранее собралась топология, можно поиграться со стоимостью

Сбросим настройки коммутаторов

Настроим MSTP

S1

<HUAWEI>
<HUAWEI>sys
[~HUAWEI]sysname S1
[*HUAWEI]commit
[~S1]vlan batch 401 402 403 409
[*S1]int range GE1/0/1 GE1/0/3
[*S1-port-group]port link-type trunk
[*S1-port-group]undo port trunk allow-pass vlan 1
[*S1-port-group]port trunk allow-pass vlan 401 402 403 409
[*S1-port-group]q
[*S1]stp mode mstp
[*S1]stp enable
Warning: The global STP state will be changed. Continue? [Y/N]:Y
[*S1]stp region-configuration
[*S1-mst-region]region-name HQ
[*S1-mst-region]instance 1 vlan 401 403
[*S1-mst-region]instance 2 vlan 402 409
[*S1-mst-region]commit
[~S1-mst-region]q
[~S1]stp instance 1 priority 4096
[*S1]stp instance 2 priority 4096
[*S1]int GE1/0/1
[*S1-GE1/0/1]stp instance 1 cost 20000
[*S1-GE1/0/1]stp instance 2 cost 20000
[*S1-GE1/0/1]q
[*S1]commit

S2

<HUAWEI>sys
[~HUAWEI]sysname S2
[*HUAWEI]commit
[~S2]vlan batch 401 402 403 409
[*S2]int range GE1/0/1 GE1/0/3
[*S2-port-group]port link-type trunk
[*S2-port-group]undo port trunk allow-pass vlan 1
[*S2-port-group]port trunk allow-pass vlan 401 402 403 409
[*S2-port-group]q
[*S2]stp mode mstp
[*S2]stp enable
Warning: The global STP state will be changed. Continue? [Y/N]:Y
[*S2]stp region-configuration
[*S2-mst-region]region-name HQ
[*S2-mst-region]instance 1 vlan 401 403
[*S2-mst-region]instance 2 vlan 402 409
[*S2-mst-region]commit
[~S2-mst-region]q
[~S2]stp instance 1 priority 8192
[*S2]stp instance 2 priority 8192
[*S2]int GE1/0/1
[*S2-GE1/0/1]stp instance 1 cost 20000
[*S2-GE1/0/1]stp instance 2 cost 20000
[*S2-GE1/0/1]q
[*S2]commit

S3

<HUAWEI>sys
[~HUAWEI]sysname S3
[*HUAWEI]commit
[~S3]vlan batch 401 402 403 409
[*S3]int range GE1/0/2 GE1/0/3
[*S3-port-group]port link-type trunk
[*S3-port-group]undo port trunk allow-pass vlan 1
[*S3-port-group]port trunk allow-pass vlan 401 402 403 409
[*S3-port-group]q
[*S3]stp mode mstp
[*S3]stp enable
Warning: The global STP state will be changed. Continue? [Y/N]:Y
[*S3]stp region-configuration
[*S3-mst-region]region-name HQ
[*S3-mst-region]instance 1 vlan 401 403
[*S3-mst-region]instance 2 vlan 402 409
[*S3-mst-region]commit
[~S3-mst-region]q
[~S3]int GE1/0/2
[~S3-GE1/0/2]stp instance 2 cost 100000
[*S3-GE1/0/2]q
[*S3]int GE1/0/3
[*S3-GE1/0/3]stp instance 1 cost 100000
[*S3-GE1/0/3]q
[*S3]commit

S4

<HUAWEI>sys
[~HUAWEI]sysname S4
[*HUAWEI]commit
[~S4]vlan batch 401 402 403 409
[*S4]int range GE1/0/2 GE1/0/3
[*S4-port-group]port link-type trunk
[*S4-port-group]undo port trunk allow-pass vlan 1
[*S4-port-group]port trunk allow-pass vlan 401 402 403 409
[*S4-port-group]q
[*S4]stp mode mstp
[*S4]stp enable
Warning: The global STP state will be changed. Continue? [Y/N]:Y
[*S4]stp region-configuration
[*S4-mst-region]region-name HQ
[*S4-mst-region]instance 1 vlan 401 403
[*S4-mst-region]instance 2 vlan 402 409
[*S4-mst-region]commit
[~S4-mst-region]q
[~S4]int GE1/0/2
[~S4-GE1/0/2]stp instance 2 cost 100000
[*S4-GE1/0/2]q
[*S4]int GE1/0/3
[*S4-GE1/0/3]stp instance 1 cost 100000
[*S4-GE1/0/3]q
[*S4]commit

Проверим

disp stp br
disp stp instance 1 br
disp stp instance 2 br