实训十七 多实例生成树
一、 实训目的
1、 了解多实例生成树协议的作用。 2、 熟悉多实例生成树协议的配置。
二、 应用环境
相对于基本生成树,多实例生成树允许多个具有相同拓扑的VLAN映射到一个生成树实例上,而这个生成树拓扑同其它生成树实例相互独立。这种机制多重生成树实例为映射到它的VLAN的数据流量提供了独立的发送路径,实现不同实例间VLAN数据流量的负载分担。
多实例生成树由于多个VLAN可以映射到一个单一的生成树实例,IEEE 802.1s 委员会提出了 MST域的概念,用来解决如何判断某个VLAN映射到哪个生成树实例的问题。在这个实训环境中我们来进一步理解多VLAN的生成树协议原理和实际拓扑生成
三、 实训设备
1. 2. 3. 4.
DCRS-565-52CT交换机2台 PC机2台
Console线1-2根 直通网线4-8根
四、 实训拓扑
vlan10switchAvlan20PC1Vlan10PC2Vlan20switchB
五、 实训要求
网线连接:
交换机A e0/0/23 交换机A e0/0/24 PC1 PC2 交换机B e0/0/23 交换机B e0/0/24 交换机A e0/0/1 交换机A e0/0/9
如果多实例生成树成功,则通过Show spanning-tree mst观察到不同实例中trunk链路的阻塞状况,实现VLAN10只通过23口,VLAN20只通过24口,用多实例生成树完成数据流量的负载均衡。
六、 实训步骤
第一步:正确连接网线,恢复出厂设置之后,配置交换机的VLAN信息,配置端口到 vlan 的映射关系
交换机A:
SWITCHA#config
SWITCHA(Config)#vlan 10
SWITCHA(Config-Vlan10)#switchport interface ethernet 0/0/1-8 Set the port Ethernet0/0/1 access vlan 10 successfully Set the port Ethernet0/0/2 access vlan 10 successfully Set the port Ethernet0/0/3 access vlan 10 successfully Set the port Ethernet0/0/4 access vlan 10 successfully Set the port Ethernet0/0/5 access vlan 10 successfully Set the port Ethernet0/0/6 access vlan 10 successfully Set the port Ethernet0/0/7 access vlan 10 successfully Set the port Ethernet0/0/8 access vlan 10 successfully SWITCHA(Config-Vlan10)#exit SWITCHA(Config)#vlan 20
SWITCHA(Config-Vlan20)#switchport interface ethernet 0/0/9-16 Set the port Ethernet0/0/9 access vlan 20 successfully Set the port Ethernet0/0/10 access vlan 20 successfully Set the port Ethernet0/0/11 access vlan 20 successfully Set the port Ethernet0/0/12 access vlan 20 successfully Set the port Ethernet0/0/13 access vlan 20 successfully Set the port Ethernet0/0/14 access vlan 20 successfully Set the port Ethernet0/0/15 access vlan 20 successfully Set the port Ethernet0/0/16 access vlan 20 successfully SWITCHA(Config-Vlan20)#exit
SWITCHA(Config)#interface ethernet 0/0/23-24
SWITCHA(Config-If-Port-Range)#switchport mode trunk Set the port Ethernet0/0/23 mode TRUNK successfully Set the port Ethernet0/0/24 mode TRUNK successfully SWITCHA(Config-If-Port-Range)#exit SWITCHA(Config)#
交换机B:
SWITCHB#config
SWITCHB(Config)#vlan 10
SWITCHB(Config-Vlan10)#switchport interface ethernet 0/0/1-8 Set the port Ethernet0/0/1 access vlan 10 successfully Set the port Ethernet0/0/2 access vlan 10 successfully Set the port Ethernet0/0/3 access vlan 10 successfully Set the port Ethernet0/0/4 access vlan 10 successfully Set the port Ethernet0/0/5 access vlan 10 successfully Set the port Ethernet0/0/6 access vlan 10 successfully Set the port Ethernet0/0/7 access vlan 10 successfully Set the port Ethernet0/0/8 access vlan 10 successfully SWITCHB(Config-Vlan10)#exit SWITCHB(Config)#vlan 20
SWITCHB(Config-Vlan20)#switchport interface ethernet 0/0/9-16 Set the port Ethernet0/0/9 access vlan 20 successfully Set the port Ethernet0/0/10 access vlan 20 successfully Set the port Ethernet0/0/11 access vlan 20 successfully Set the port Ethernet0/0/12 access vlan 20 successfully Set the port Ethernet0/0/13 access vlan 20 successfully Set the port Ethernet0/0/14 access vlan 20 successfully Set the port Ethernet0/0/15 access vlan 20 successfully Set the port Ethernet0/0/16 access vlan 20 successfully SWITCHB(Config-Vlan20)#exit
SWITCHB(Config)#interface ethernet 0/0/23-24
SWITCHB(Config-If-Port-Range)#switchport mode trunk Set the port Ethernet0/0/23 mode TRUNK successfully Set the port Ethernet0/0/24 mode TRUNK successfully SWITCHB(Config-If-Port-Range)#exit SWITCHB(Config)#
第二步:配置多实例生成树,在交换机A、B上分别将将 vlan 10映射到实例1上;将vlan 20映射到实例2上
交换机A:
SWITCHA(Config)# spanning-tree mst configuration SWITCHA(Config-Mstp-Region)#name mstp
SWITCHA(Config-Mstp-Region)#instance 1 vlan 10 SWITCHA(Config-Mstp-Region)#instance 2 vlan 20 SWITCHA(Config-Mstp-Region)#exit SWITCHA(Config)# spanning-tree
MSTP is starting now, please wait........... MSTP is enabled successfully.
交换机B:
SWITCHB(Config)# spanning-tree mst configuration SWITCHB(Config-Mstp-Region)#name mstp
SWITCHB(Config-Mstp-Region)#instance 1 vlan 10 SWITCHB(Config-Mstp-Region)#instance 2 vlan 20 SWITCHB(Config-Mstp-Region)#exit SWITCHB(Config)# spanning-tree
MSTP is starting now, please wait........... MSTP is enabled successfully.
第三步:在根交换机中配置端口在不同实例中的优先级,确保不同实例阻塞不同端口
查找根交换机:
switchA#show spanning-tree
-- MSTP Bridge Config Info --
Standard : IEEE 802.1s
Bridge MAC : 00:03:0f:0b:f8:12
Bridge Times : Max Age 20, Hello Time 2, Forward Delay 15 Force Version: 3
########################### Instance 0 ########################### Self Bridge Id : 32768 - 00:03:0f:0b:f8:12 Root Id : this switch Ext.RootPathCost : 0
Region Root Id : this switch Int.RootPathCost : 0 Root Port ID : 0
Current port list in Instance 0: ?????????? 从show中可以看出,交换机A是根交换机,在根交换机上修改trunk端口在不同实例中的优先级。
SWITCHA(Config)#interface ethernet 0/0/23
SWITCHA(Config-If-Ethernet0/0/23)#spanning-tree mst 1 port-priority 32 SWITCHA(Config-If-Ethernet0/0/23)#exit SWITCHA(Config)#interface ethernet 0/0/24
SWITCHA(Config-If-Ethernet0/0/24)#spanning-tree mst 2 port-priority 32 SWITCHA(Config-If-Ethernet0/0/24)#exit SWITCHA(Config)#
第四步:配置交换机B的loopback端口,验证多实例生成树
1、 配置交换机B上各vlan所属loopback端口,保证各vlan在线:
SWITCHB(Config)#interface ethernet 0/0/1
SWITCHB(Config-If-Ethernet0/0/1)#loopback SWITCHB(Config-If-Ethernet0/0/1)#exit SWITCHB(Config)#interface ethernet 0/0/9 SWITCHB(Config-If-Ethernet0/0/9)#loopback SWITCHB(Config-If-Ethernet0/0/9)#exit
2、 用“show spanning-tree mst”,观察各现象: SWITCHA#show spanning-tree mst
########################### Instance 0 ########################### vlans mapped : 1-9;11-19;21-4094
Self Bridge Id : 32768.00:03:0f:0b:f8:12 Root Id : this switch
Root Times : Max Age 20, Hello Time 2, Forward Delay 15 ,max hops 20
PortName ID ExtRPC IntRPC State Role DsgBridge DsgPort
-------------- ------- --------- --------- --- ---- ------------------ ------- Ethernet0/0/1 128.001 0 0 FWD DSGN 32768.00030f0bf812 128.001 Ethernet0/0/9 128.009 0 0 FWD DSGN 32768.00030f0bf812 128.009 Ethernet0/0/23 128.023 0 0 FWD DSGN 32768.00030f0bf812 128.023 Ethernet0/0/24 128.024 0 0 FWD DSGN 32768.00030f0bf812 128.024 ########################### Instance 1 ########################### vlans mapped : 10
Self Bridge Id : 32768-00:03:0f:0b:f8:12 Root Id : this switch
PortName ID IntRPC State Role DsgBridge DsgPort -------------- ------- --------- --- ---- ------------------ ------- Ethernet0/0/1 128.001 0 FWD DSGN 32768.00030f0bf812 128.001 Ethernet0/0/23 032.023 0 FWD DSGN 32768.00030f0bf812 032.023 Ethernet0/0/24 128.024 0 FWD DSGN 32768.00030f0bf812 128.024 ########################### Instance 2 ########################### vlans mapped : 20
Self Bridge Id : 32768-00:03:0f:0b:f8:12 Root Id : this switch
PortName ID IntRPC State Role DsgBridge DsgPort -------------- ------- --------- --- ---- ------------------ ------- Ethernet0/0/9 128.009 0 FWD DSGN 32768.00030f0bf812 128.009 Ethernet0/0/23 128.023 0 FWD DSGN 32768.00030f0bf812 128.023 Ethernet0/0/24 032.024 0 FWD DSGN 32768.00030f0bf812 032.024 ########################### Instance 3 ###########################
SWITCHB(config)#sh spanning-tree mst
########################### Instance 0 ########################### vlans mapped : 1-9;11-19;21-4094