春风十里不如你 —— Taozi - VLAN
https://xiongan.host/index.php/tag/VLAN/
-
【ENSP】RSTP和MSTP基础配置
https://xiongan.host/index.php/archives/209/
2023-05-22T19:00:23+08:00
RSTP、MSTP基础配置实验组网任务步骤设备开启STP,并将STP模式切换为RSTP[S1]stp enable
[S1]stp mode rstp
[S2]stp enable
[S2]stp mode rstp
[S3]stp enable
[S3]stp mode rstp
[S4]stp enable
[S4]stp mode rstp查看STP的状态和统计信息摘要在S1上查看STP的状态和统计信息(S1为根桥交换机)根桥选举控制配置S1为主根桥,S2为备份根桥[S1]stp priority 4096
[S2]stp priority 8192在另外两台交换机保持默认桥优先级(32768)的情况下,S1拥有最小的桥优先级,S2次之。再次查看S1上的状态信息(此时S1的桥优先级为4096,并且此时仍然是根桥)取消S1、S2上手动调整桥优先级的配置,使用stp root命令指定根桥和备份根桥[S1]undo stp priority
[S1]stp root primary
[S2]undo stp priority
[S2]stp root secondary查看S1和S2的stp状态信息S1的桥优先级为0,而S2的桥优先级为4096,此时S1为根桥,S2为备份根桥。修改接口开销控制根端口选举在S4上查看stp状态和统计信息S4上0/0/2拥有更小的RPC(根路径开销),从而成为根端口查看S4的0/0/2的STP状态和统计信息此时路径开销计算方法为Dotlt,接口的STP cost的值为20000修改S4的0/0/2的STP cost值为40001[S4]interface g0/0/2
[S4-GigabitEthernet0/0/2]stp cost 40001
[S4-GigabitEthernet0/0/2]查看s4的STP状态信息此时0/0/1的RPC为40000,小鱼0/0/2的RPC 40001 S4的0/0/1接口成为根端口修改接口优先级控制根端口选举查看S2的STP状态信息S2上GE0/0/10、GE0/0/11接口收到的BPDU拥有相同的RPC、网桥ID、接口优先级,此时将会比较接收到的BPDU接口ID中的接口编号。在S1、S2上开启LLDP,查看接口的互联关系[S1]lldp enable
[S2]lldp enable
[S2]display lldp neighbor briefS2的GE0/0/10接口对端为S1的GE0/0/10接口,S2的GE0/0/11接口对端为S1的GE0/0/11接口,S2的GE0/0/10接口接收到的BPDU拥有更小的接口编号,这是GE0/0/10成为根端口的原因在S1上修改GE0/0/11的STP接口优先级,使其发送的BPDU优于 GE0/0/10发送的BPDU[S1]interface GigabitEthernet 0/0/11
[S1-GigabitEthernet0/0/11] stp port priority 64STP接口优先级为128,数值越小越优。再次查看S2的stp状态信息此时S2的GE0/0/10接口成为根端口。MSTP基础配置在所有交换机上创建VLAN10、20、30、40、50、60、70、80,配置MSTP域hcip,并创建两个新的实例:Instance 1、Instance 2,将VLAN10、30、50、70映射到Instance 1,将VLAN20、40、60、80映射到Instance 2,同时将SW1规划为MSTI1的主根桥、MSTI2的备份根桥,将SW2规划为MSTI2的主根桥、MSTI1的备份根桥。[S1]vlan batch 10 20 30 40 50 60 70 80
[S2]vlan batch 10 20 30 40 50 60 70 80
[S3]vlan batch 10 20 30 40 50 60 70 80
[S4]vlan batch 10 20 30 40 50 60 70 80将所有的互联接口(S1、S2、S3、S4)配置为Trunk接口,放通所有的(接口端口)Vlaninterface GigabitEthernet0/0/10
port link-type trunk
port trunk allow-pass vlan 10 20 30 40 50 60 70 80
#
interface GigabitEthernet0/0/11
port link-type trunk
port trunk allow-pass vlan 10 20 30 40 50 60 70 80
stp instance 0 port priority 64
#
interface GigabitEthernet0/0/12
port link-type trunk
port trunk allow-pass vlan 10 20 30 40 50 60 70 80
#
interface GigabitEthernet0/0/13
port link-type trunk
port trunk allow-pass vlan 10 20 30 40 50 60 70 80修改STP模式为MSTP[S1]stp mode mstp
[S2]stp mode mstp
[S3]stp mode mstp
[S4]stp mode mstp配置MSTP[S1]stp region-configuration
[S1-mst-region] region-name hcip
[S1-mst-region] revision-level 1
[S1-mst-region] instance 1 vlan 10 30 50 70
[S1-mst-region] instance 2 vlan 20 40 60 80
[S1-mst-region] active region-configuration
Info: This operation may take a few seconds. Please wait for a moment...done.
[S1-mst-region] quit
/
[S2]stp region-configuration
[S2-mst-region] region-name hcip
[S2-mst-region] revision-level 1
[S2-mst-region] instance 1 vlan 10 30 50 70
[S2-mst-region] instance 2 vlan 20 40 60 80
[S2-mst-region] active region-configuration
Info: This operation may take a few seconds. Please wait for a moment...done.
[S2-mst-region] quit
/
[S3]stp region-configuration
[S3-mst-region] region-name hcip
[S3-mst-region] revision-level 1
[S3-mst-region] instance 1 vlan 10 30 50 70
[S3-mst-region] instance 2 vlan 20 40 60 80
[S3-mst-region] active region-configuration
Info: This operation may take a few seconds. Please wait for a moment...done.
[S3-mst-region] quit
/
[S4]stp region-configuration
[S4-mst-region] region-name hcip
[S4-mst-region] revision-level 1
[S4-mst-region] instance 1 vlan 10 30 50 70
[S4-mst-region] instance 2 vlan 20 40 60 80
[S4-mst-region] active region-configuration
Info: This operation may take a few seconds. Please wait for a moment...done.
[S4-mst-region] quit在S1上检查MSTP实例和Vlan的映射关系//配置SW1为MSTI1的根桥、MSTI2的备份根桥
[S1]stp instance 1 root primary
[S1]stp instance 2 root secondary
//配置SW2为MSTI2的根桥、MSTI1的备份根桥
[S2]stp instance 1 root secondary
[S2]stp instance 2 root primary在S1上查看MST1状态信息S1上所有接口都是指定接口,S1为MSTI1的根桥S2上所有接口都是指定接口,S2为MSTI2的根桥。