Hello everyone,
The topology and configuration are as follows:

[sw1]vlan batch 10 20
[sw1]stp enable
[sw1]int g0/0/1
[sw1-GigabitEthernet0/0/1]port link-type trunk
[sw1-GigabitEthernet0/0/1]port trunk allow-pass vlan all
[sw1-GigabitEthernet0/0/1]int g0/0/2
[sw1-GigabitEthernet0/0/2]port link-type trunk
[sw1-GigabitEthernet0/0/2]port trunk allow-pass vlan all
[sw1]stp root primary //Setting the root switch
[sw2]vlan batch 10 20
[sw2]stp enable
[sw2]int g0/0/1
[sw2-GigabitEthernet0/0/1]port link-type trunk
[sw2-GigabitEthernet0/0/1]port trunk allow-pass vlan all
[sw2-GigabitEthernet0/0/1]int g0/0/3
[sw2-GigabitEthernet0/0/3]port link-type trunk
[sw2-GigabitEthernet0/0/3]port trunk allow-pass vlan all
[sw2]stp root secondary
[sw2-GigabitEthernet0/0/1]stp cost 5
[sw3]vlan batch 10 20
[sw3]stp enable
[sw3]int g0/0/1
[sw3-GigabitEthernet0/0/1]port link-type trunk
[sw3-GigabitEthernet0/0/1]port trunk allow-pass vlan all
[sw3-GigabitEthernet0/0/1]int g0/0/3
[sw3-GigabitEthernet0/0/3]port link-type trunk
[sw3-GigabitEthernet0/0/3]port trunk allow-pass vlan all
Check the port status of each switch



The cost of GE 0/0/1 on SW2 is set to 5. Why is GE 0/0/1 still the root port? G0/0/3 should be the root port. In addition, G0/0/3 of SW3 should be enabled. Why is the red mark on the diagram the same as the result?
Please help me! Thank you!