1.某公司的总部包含4个部门,为了增加网络的可靠性,需要所在的交换机上配置MSTP,确保网络不会出现环路问题,同时实现负载均衡。
(1)搭建网络拓扑,配置vlan,Trunk,链路聚合。
(2)在4台交换机上配置MSTP,在交换机2创建两个实例,将vlan2,vlan3划分到实例1中,将vlan4,vlan5划分到实列2中。
(3)通过配置MSTP,使实实例1和2的MSTI具有不同的根桥。SW1是实例1的根桥(优先级为4096),是实例2的次根桥(优先级为8192);SW2是实例2的根桥(优先级为4096),是实例1的次根桥(优先级为8192)。
(4)对以上配置逐项进行测试,确保局域网中没有环路。
3.项目实施。
SW1SW4 配置STP模式为MSTP,配置MSTP域(SW1SW4执行相同的命令)
----交换机SW1~SW4相同的命令。----
[SW]stp mode mstp //配置生成树的模式为MSTP
[SW]stp region-configuration //进入MST域视图
[SW-mst-region]region-name region1 //配置MST域的名称
[SW-mst-region]revision-level 1234 //MST域的修订级别,默认MST域的修订级别为0
[SW-mst-region]instance 1 vlan 2 to 3 //配置MST实列和vlan映射关系
[SW-mst-region]instance 2 vlan 4 to 5
[SW-mst-region]active region-configuration //激活MSTP域配置
SW1
[SW1]vlan batch 2 3 4 5 //创建VLAN4个端口
[SW1]int eth-trunk 1 //创建一个名为1 的链路聚合组
[SW1-Eth-Trunk1]trunkport GigabitEthernet 0/0/1 to 0/0/2 //加入
[SW1-Eth-Trunk1]port link-type trunk //修改接口设置
[SW1-Eth-Trunk1]port trunk allow-pass vlan 2 3 4 5 //允许通过的端口
[SW1-GigabitEthernet0/0/4]port link-type trunk
[SW1-GigabitEthernet0/0/4]port trunk allow-pass vlan 2 3 4 5
[SW1-GigabitEthernet0/0/3]port link-type trunk
[SW1-GigabitEthernet0/0/3]port trunk allow-pass vlan 2 3 4 5
[SW1]stp instance 0 priority 4096 //配置实例0的优先级,使交换机1是实例0的根桥
[SW1]stp instance 1 priority 4096 //配置实例1的优先级,使交换机1是实例1的根桥
[SW1]stp instance 1 priority 8192 //配置实例2的优先级,使交换机1是实例2的次根桥
SW2
[SW2]vlan batch 2 3 4 5
[SW2-Eth-Trunk1]trunkport GigabitEthernet 0/0/1 to 0/0/2
[SW2-Eth-Trunk1]port link-type trunk
[SW2-Eth-Trunk1]port trunk allow-pass vlan 2 3 4 5
[SW2-GigabitEthernet0/0/4]port link-type trunk
[SW2-GigabitEthernet0/0/4]port trunk allow-pass vlan 2 3 4 5
[SW2-GigabitEthernet0/0/3]port link-type trunk
[SW2-GigabitEthernet0/0/3]port trunk allow-pass vlan 2 3 4 5
[SW2]stp instance 0 priority 8192 //配置实例0的优先级,使交换机2是实例0的次根桥
[SW2]stp instance 1 priority 8192 //配置实例1的优先级,使交换机2是实例1的次根桥
[SW2]stp instance 2 priority 4096 //配置实例2的优先级,使交换机2是实例2的根桥
查看MSTP实例1的端口信息。
[SW3]dis stp instance 1 int gig0/0/1
-------[MSTI 1 Global Info]-------//全局信息
MSTI Bridge ID :32768.4c1f-ccf9-4bcc//MSTI桥ID
MSTI RegRoot/IRPC :8192.4c1f-cc01-3857 / 20000//MSTI根桥ID和内部路径开销
MSTI RootPortId :128.1//MSTI根端口ID
Master Bridge :4096.4c1f-cc01-3857//主桥ID
Cost to Master :20000//到达主桥的开销
TC received :14//接受TC的数量
TC count per hello :0//每个Hello Time发送TC的数量
Time since last TC :0 days 0h:30m:31s//最近一次接收TC的时间
Number of TC :5//TC的数量
Last TC occurred :GigabitEthernet0/0/1
----[Port1(GigabitEthernet0/0/1)][FORWARDING]----//端口1处于转发状态
Port Role :Root Port//端口角色为根端口
Port Priority :128//端口的优先级
Port Cost(Dot1T ) :Config=auto / Active=20000//端口开销的计算方法,Co手工配置,Ac实际路径开销
Designated Bridge/Port :8192.4c1f-cc01-3857 / 128.3//指定根桥ID的端口ID
Port Times :RemHops 20//端口定时器
TC or TCN send :2//指定端口发送的TC标记报文或TCN报文数目的统计
TC or TCN received :6//指定端口接收的TC标记报文或TCN报文数目的统计
查看MSTP拓扑变化相关的统计信息
[SW1]dis stp topology-change
CIST topology change information//CIST拓扑变化信息
Number of topology changes :23//从MSTP初始化开始,发送拓扑变化的总计次数
Time since last topology change :0 days 0h:36m:31s//距离最近一次变化时间
Topology change initiator(notified) :GigabitEthernet0/0/4//收到报文而触发的端口
Topology change last received from :4c1f-cc57-6c7c//拓扑变化报文来源的桥MAC地址
Number of generated topologychange traps : 14//产生的告警次数
Number of suppressed topologychange traps: 2//抑制的告警次数
MSTI 1 topology change information
Number of topology changes :10
Time since last topology change :0 days 0h:37m:2s
Topology change initiator(notified) :Eth-Trunk1
Topology change last received from :4c1f-cc91-04c4
Number of generated topologychange traps : 14
Number of suppressed topologychange traps: 2
MSTI 2 topology change information
Number of topology changes :8
Time since last topology change :0 days 0h:36m:31s
Topology change initiator(notified) :Eth-Trunk1
Topology change last received from :4c1f-cc91-04c4
Number of generated topologychange traps : 14
Number of suppressed topologychange traps: 2
查看交换设备上当前生效的MST域配置信息
[SW3]dis stp region-configuration
Oper configuration
Format selector :0 //格式选择器
Region name :region1 //配置名称
Revision level :1234 //修订级别
Instance VLANs Mapped //实列和VLAN映射表
0 1, 6 to 4094
1 2 to 3
2 4 to 5
display stp brief 查看交换机stp摘要信息
版权归原作者 网络的求学者 所有, 如有侵权,请联系我们删除。