思科STP配置
- 格式:ppt
- 大小:556.00 KB
- 文档页数:36
STP配置例子和配置命令一、配置例子:1、全局spanning-tree mode pvstspanning-tree extend system-id 我不知道这个system-id是用来干什么的,但是它在各个vlan中一定和vlan id相同启用边缘端口interface GigabitEthernet0/1spanning-tree portfast2、Switch(config)#spanning-tree portfast ?bpdufilter Enable portfast bpdu filter on this switchbpduguard Enable portfast bpdu guard on this switchdefault Enable portfast by default on all access ports 在所有access端口上启用快速端口功能zhuyu4507R(config)#spanning-tree mode ?mst Multiple spanning tree modepvst Per-Vlan spanning tree mode 思科私有的生成树协议,相当于在每个vlan中单独运行stprapid-pvst Per-Vlan rapid spanning tree mode思科私有的生成树协议,相当于在每个vlan中单独运行rstpzhuyu4507R(config)#spanning-tree vlan 1-2 ?forward-time Set the forward delay for the spanning treehello-time Set the hello interval for the spanning treemax-age Set the max age interval for the spanning treepriority Set the bridge priority for the spanning treeroot Configure switch as root二、命令Switch(config)#spanning-tree ?backbonefast Enable BackboneFast Featureetherchannel Spanning tree etherchannel specific configurationextend Spanning Tree 802.1t extensionslogging Enable Spanning tree loggingloopguard Spanning tree loopguard optionsmode Spanning tree operating modemst Multiple spanning tree configurationpathcost Spanning tree pathcost optionsportfast Spanning tree portfast optionstransmit STP transmit parametersuplinkfast Enable UplinkFast Featurevlan VLAN Switch Spanning Tree启用环路监视Switch(config)#spanning-tree loopguard ?default Enable loopguard by default on all portszhuyu4507R(config)#spanning-tree mst ?WORD MST instance range, example: 0-3,5,7-9 configuration Enter MST configuration submode forward-time Set the forward delay for the spanning tree hello-time Set the hello interval for the spanning tree max-age Set the max age interval for the spanning tree max-hops Set the max hops value for the spanning tree1、Switch(config)#spanning-tree mst configuration Switch(config-mst)#?abort Exit region configuration mode, aborting changes exit Exit region configuration mode, applying changes instance Map vlans to an MST instancename Set configuration nameno Negate a command or set its defaultsprivate-vlan Set private-vlan synchronizationrevision Set configuration revision numbershow Display region configurationsSwitch(config-mst)#name mst-confSwitch(config-mst)#instance 1 vlan 1-3Switch(config-mst)#instance2 vlan 4-6设置交换机在每个mst实例中的优先级zhuyu4507R(config)#spanning-tree mst 1 ? priority Set the bridge priority for the spanning tree root Configure switch as root。
思科配置——生成树STP负载均衡二层交换机SW1代码如下:Switch>Switch>enSwitch#conf tSwitch(config)#hostname SW1SW1(config)#vlan 10SW1(config-vlan)#exitSW1(config)#vlan 20SW1(config-vlan)#exitSW1(config)#interface f0/1SW1(config-if)#switchport access vlan 10SW1(config-if)#exitSW1(config)#interface f0/2SW1(config-if)#switchport access vlan 20 SW1(config-if)#exitSW1(config)#interface range f0/3-4SW1(config-if-range)#switchport mode trunk SW1(config-if-range)#exitSW1(config)#interface range f0/1-2SW1(config-if-range)#spanning-tree portfast SW1(config-if-range)#exitSW1(config)#endSW1#writeBuilding configuration...[OK]SW1#二层交换机SW2代码如下:Switch>Switch>enSwitch#conf tSwitch(config)#vlan 10Switch(config-vlan)#vlan 20Switch(config-vlan)#exitSwitch(config)#interface f0/1Switch(config-if)#spanning-tree portfastSwitch(config-if)#exitSwitch(config)#interface f0/2Switch(config-if)#switchport access vlan 20 Switch(config-if)#spanning-tree portfast Switch(config-if)#exitSwitch(config)#interface range f0/3-4Switch(config-if-range)#switchport mode trunkSwitch(config-if-range)#Switch(config-if-range)#exitSwitch(config)#hostname SW2SW2(config)#SW2(config)#exitSW2#writeBuilding configuration...[OK]SW2#二层交换机SW3代码如下:Switch>Switch>enSwitch(config)#vlan 10Switch(config-vlan)#vlan 20Switch(config-vlan)#exitSwitch(config)#interface f0/1Switch(config-if)#switchport access vlan 10 Switch(config-if)#spanning-tree portfastSwitch(config-if)#Switch(config-if)#exitSwitch(config)#interface f0/2Switch(config-if)#switchport access vlan 20 Switch(config-if)#spanning-tree portfastSwitch(config-if)#exitSwitch(config)#interface range f0/3-4Switch(config-if-range)#switchport mode trunkSwitch(config-if-range)#exitSwitch(config)#hostname SW3SW3(config)#endSW3#writeBuilding configuration...[OK]三层交换机SW-3-1代码如下:Switch>Switch>enSwitch#conf tSwitch(config)#hostname SW-3-1SW-3-1(config)#ip routingSW-3-1(config)#SW-3-1(config)#vlan 10SW-3-1(config-vlan)#vlan 20SW-3-1(config-vlan)#exitSW-3-1(config)#spanning-tree vlan 10 root primarySW-3-1(config)#spanning-tree vlan 20 root secondarySW-3-1(config)#interface range f0/1-3SW-3-1(config-if-range)#switchport trunk encapsulation dot1q SW-3-1(config-if-range)#exitSW-3-1(config)#interface vlan 10SW-3-1(config-if)#ip address 192.168.10.1 255.255.255.0SW-3-1(config-if)#exitSW-3-1(config)#interface vlan 20SW-3-1(config-if)#ip address 192.168.20.1 255.255.255.0SW-3-1(config-if)#SW-3-1(config-if)#exitSW-3-1#SW-3-1#writeBuilding configuration...[OK]三层交换机SW-3-2代码如下:Switch>Switch>enSwitch#conf tSwitch(config)#hostname SW-3-2SW-3-2(config)#SW-3-2(config)#vlan 10SW-3-2(config-vlan)#vlan 20SW-3-2(config-vlan)#exitSW-3-2(config)#ip routingSW-3-2(config)#SW-3-2(config)#spanning-tree vlan 20 root primarySW-3-2(config)#spanning-tree vlan 10 root secondarySW-3-2(config)#interface range f0/1-3SW-3-2(config-if-range)#switchport trunk encapsulation dot1q SW-3-2(config-if-range)#exitSW-3-2(config)#interface vlan 10SW-3-2(config-if)#ip address 192.168.10.1 255.255.255.0SW-3-2(config)#interface vlan 20SW-3-2(config-if)#ip address 192.168.20.1 255.255.255.0 SW-3-2(config)#endSW-3-2#SW-3-2#writeBuilding configuration...[OK]。
CISCO交换机STP详细说明及配置一、STP概述STP(生成树协议)是一个二层管理协议。
在一个扩展的局域网中参与STP的所有交换机之间通过交换桥协议数据单元bp du(bridge protoc ol data unit)来实现;为稳定的生成树拓扑结构选择一个根桥;为每个交换网段选择一台指定交换机;将冗余路径上的交换机置为blocking,来消除网络中的环路。
IEEE 802.1d是最早关于STP的标准,它提供了网络的动态冗余切换机制。
STP使您能在网络设计中部署备份线路,并且保证:* 在主线路正常工作时,备份线路是关闭的。
* 当主线路出现故障时自动使能备份线路,切换数据流。
rSTP(rapidspanni ng tree protoc ol)是STP的扩展,其主要特点是增加了端口状态快速切换的机制,能够实现网络拓扑的快速转换。
1.1 设置STP模式使用命令configspanni ng-tree mode可以设置STP模式为802.1d STP或者802.1w rSTP.1.2 配置STP交换机中默认存在一个d efaul t STP域。
多域STP是扩展的802.1d,它允许在同一台交换设备上同时存在多个STP域,各个STP域都按照802.1d运行,各域之间互不影响。
它提供了一种能够更为灵活和稳定网络环境,基本实现在v l an中计算生成树。
1.2.1 创建或删除S T P利用命令createSTPd和d elete STPd可以创建或删除S TP.缺省的defaultSTP域不能手工创建和删除。
1.2.2 使能或关闭S T P交换机中ST P缺省状态是关闭的。
利用命令configSTPd可以使能或关闭S TP.1.2.3 使能或关闭指定STP的端口交换机中所有端口默认都是参与ST P计算的。
实验一生成树(STP)一、实验目的1):本实验的目的是通过配置以下三种拓朴图,让我们对生成树的工作原理有更深的认识。
2):掌握生成树在交换机上的配置方法,对生成树在网络上的应用有更深的了解。
二、实验要求:1):简述生成树协议的三个前提。
2):简述根桥、根端口、指定端口的选举原则。
三、实验内容:1、通过三种拓朴图来研究根桥、根端口、指定端口选举方法;2、根桥、根端口、指定端口查看方法四、实验步骤:第一种:实验拓朴:1)查看三台交换机那个台是根桥在交换机上使用命令show spanning-tree vlan 1 或show spanning—tree brif可以查看当前网络中的根桥、根端口、指定端口。
如下:可以看出SW!为根桥,SW2为非根桥,用同样的命令查看第三台交换机。
2)现在修改SW2的优先级让它成为根桥在交换机上使用此命令spanning-tree vlan 1 priority 4096SW2(config)# spanning-tree vlan 1 priority 4096SW2#sh spanning-tree bri 查看 spanning-tree第二种:实验拓朴1)查看二台交换机那个台是根桥在交换机上使用命令show spanning-tree vlan 1 或show spanning-tree brif可以查看当前网络中的根桥、根端口、指定端口。
可以看到交换机SW2上的F0/1是转发状态,F0/2是阻断状态。
2)指定为根端口方法有:a:改变接口上的cost值(在本端修改)命令为 spanning—tree vlan 1 cost 20b:改变发送者接口上ID值(在对端修改)命令为spanning-tree vlan 1 port-priority 96注:port-priority后的值是16倍数c:在物理上改变在这就不作详解了。
3)步聚如下:第一种方法:在本端修改接口cost值SW2(config)#int fa0/1SW2(config—if)# spanning-tree vlan 1 cost 20SW2#sh spanning-tree bri第二种方法:在对端修改发送者接口ID值SW1(config)#int fa0/2SW1 (config-if)#spanning-tree vlan 1 priority 96 SW2#sh spanning—tree bri (在对端查看)第三种:实验拓朴1)在一台交换上要修改根端口,则只需要修改发送者端口ID SW1(config)#int fa0/2SW1(config-if)#spanning-tree port—priority 127 SW1#sh spanning—tree bri。
STP配置1、左上角交换机配置vlan10,11,12:Switch(config)#vlan 10Switch(config-vlan)#vlan 11Switch(config-vlan)#vlan 12Switch(config-vlan)#Switch(config-vlan)#int f0/1Switch(config-if)#switchport trunk encapsulation dot1q //思科三层交换机必须封装dot1q,才能设置trunk链路Switch(config-if)#switchport mode trunkSwitch(config-if)#int f0/2Switch(config-if)#switchport trunk encapsulation dot1qSwitch(config-if)#switchport mode trunkSwitch(config-if)#switchport mode accessSwitch(config-if)#switchport access vlan 10Switch(config-if)#int f0/11Switch(config-if)#switchport mode accessSwitch(config-if)#switchport access vlan 11Switch(config-if)#int f0/12Switch(config-if)#switchport mode accessSwitch(config-if)#switchport access vlan 12Switch(config)#int vlan 10Switch(config-if)#Switch(config-if)#ip add 192.168.10.1 255.255.255.0Switch(config-if)#int vlan 11Switch(config-if)#Switch(config-if)#ip add 192.168.11.1 255.255.255.0Switch(config-if)#int vlan 12Switch(config-if)#ip add 192.168.12.1 255.255.255.0开启路由功能(三层交换机默认路由关闭)Switch>enSwitch#conf terEnter configuration commands, one per line. End with CNTL/Z. Switch(config)#ip routing2、右上角交换机配置:Switch(config)#int f0/3Switch(config-if)#switchport trunk encapsulation dot1q Switch(config-if)#switchport mode trunkSwitch(config)#int f0/1Switch(config-if)#switchport trunk encapsulation dot1q Switch(config-if)#switchport mode trunkSwitch(config)#vlan 10Switch(config-vlan)#vlan 20Switch(config-vlan)#3、最下面的交换机配置vlan10,11,12:Switch>enSwitch#conf terEnter configuration commands, one per line. End with CNTL/Z. Switch(config)#vlan 10Switch(config-vlan)#vlan 11Switch(config-vlan)#vlan 12Switch(config-vlan)#int f0/10Switch(config-if)#switchport mode accessSwitch(config-if)#switchport access vlan 10Switch(config-if)#int f0/11Switch(config-if)#switchport mode accessSwitch(config-if)#switchport access vlan 11Switch(config-if)#int f0/12Switch(config-if)#switchport mode accessSwitch(config-if)#switchport access vlan 12Switch(config-if)#此时让vlan10中两个计算机互ping会出现Ping不通的问题将右上角交换机的f0/1关闭后再重新ping正常Switch(config-if)#int f0/1Switch(config-if)#shutdown下面配置STP4、左上角交换机配置vlan10,vlan11为主根,vlan12为次根Switch>enSwitch#conf terSwitch(config)#spanning-tree vlan 10 priority 0Switch(config)#spanning-tree vlan 11 priority 0Switch(config)#spanning-tree vlan 12 priority 4096// #配置生成树的主根时,设置它的优先级,优先级默认是32768,比它小就越靠谱,#优先级默认是4096的倍数,0最高Switch(config)#5、右上角交换机配置vlan10,vlan11为次根,vlan12为主根Switch(config)#spanning-tree vlan 10 priority 4096Switch(config)#spanning-tree vlan 11 priority 4096Switch(config)#spanning-tree vlan 12 priority 0Switch(config)#6、测试(1)全部链路正常启动,将右上角交换机f0/1开启Switch(config-if)#int f0/1Switch(config-if)#no shutdownPC3 ping pc0(2)关闭左上角和下面交换机之间的端口会从备份右上角家交换机,使用pc3和pc0互通(3)关闭其他重复的链路查看通信情况(4)查看数据包通过哪条路传送到目的地总结:配置生成树,目的是为了防止物理环路的产生,防止广播风暴,好处是,可以起到负载均衡的作用,和链路的冗余备份。
Cisco交换机之STP协议简单详解及实验Cisco交换机之STP协议简单详解及实验前面的学习中,我们已经掌握通过交换机组网,但是,怎样加强企业网络的可靠性呢?在实际网络环境中,可以通过物理环路解决网络的可靠性,当一跳链路断开或者出现故障,另一条链路任然可以传输数据,但是,在交换网络中,当交换机收到一个未知目的地址的数据帧,交换机会广播出去,这样,在交换网络中,就会产生一个双向广播环,甚至广播风暴,导致交换机死机。
本章的STP(Spanning Tree Protocol 生成树协议),它就是在逻辑上断开物理环路,防止产生广播风暴,而一旦正在用的线路出现故障,被逻辑断开的线路又重新接通,继续传输数据。
在介绍STP之前,首先回顾一下交换机的工作原理(1)交换机通过学习数据帧中的源MAC地址生成MAC地址表。
(2)交换机查看数据帧的目标MAC地址,根据MAC地址表转发数据。
(3)如果交换机MAC地址表中没有匹配项,则向除了收到这个数据帧的端口以外的所有端口广播这个数据帧。
如果在一个物理环路的网络中,交换机收到一个未知目标地址的数据帧,它会向其他交换机广播,而其他交换机也没有相应的MAC地址对应,又会向除接受端口之外的端口广播,这样,在网络中就产生了双向广播环。
一.STP概述1.STP叫做生成树协议,就是把一个环形的结构改变成一个树形的结构二.STP工作原理 1.生成树算法(1)选择根网桥(Root Bridge)选择根网桥的依据是网桥ID(8字节的字段)前2字节为网桥优先级(范围是0--65535,默认值是32768),后6字节是网桥的MAC地址。
(2)选择根端口(Root Ports)选择根端口的依据按照顺序是:到根网桥最底的根路径成本直连的网桥ID最小端口ID最小下面是带宽与路径成本的关系链路带宽(Mb/s)路径成本10 10016 6245 39100 19155 14622 61000 410000 2端口ID是一个2字节的STP参数,前8位是端口优先级(范围是0--255,默认是128)后8位是端口编号,注意:端口编号不是端口号,但是端口号低的端口,端口编号值也较小。
实验一生成树(S T P)一、实验目的1):本实验的目的是通过配置以下三种拓朴图,让我们对生成树的工作原理有更深的认识。
2):掌握生成树在交换机上的配置方法,对生成树在网络上的应用有更深的了解。
二、实验要求:1):简述生成树协议的三个前提。
2):简述根桥、根端口、指定端口的选举原则。
三、实验内容:1、通过三种拓朴图来研究根桥、根端口、指定端口选举方法;2、根桥、根端口、指定端口查看方法四、实验步骤:第一种:实验拓朴:1)查看三台交换机那个台是根桥在交换机上使用命令show spanning-tree vlan 1 或show spanning-treebrif可以查看当前网络中的根桥、根端口、指定端口。
如下:可以看出SW!为根桥,SW2为非根桥,用同样的命令查看第三台交换机。
2)现在修改SW2的优先级让它成为根桥在交换机上使用此命令spanning-tree vlan 1 priority 4096SW2(config)# spanning-tree vlan 1 priority 4096SW2#sh spanning-tree bri 查看 spanning-tree第二种:实验拓朴1)查看二台交换机那个台是根桥在交换机上使用命令show spanning-tree vlan 1 或showspanning-tree brif可以查看当前网络中的根桥、根端口、指定端口。
可以看到交换机SW2上的F0/1是转发状态,F0/2是阻断状态。
2)指定为根端口方法有:a:改变接口上的cost值(在本端修改)命令为 spanning-tree vlan 1 cost 20b:改变发送者接口上ID值(在对端修改)命令为spanning-tree vlan 1 port-priority 96注:port-priority后的值是16倍数c:在物理上改变在这就不作详解了。
3)步聚如下:第一种方法:在本端修改接口cost值SW2(config)#int fa0/1SW2(config-if)# spanning-tree vlan 1 cost 20SW2#sh spanning-tree bri第二种方法:在对端修改发送者接口ID值SW1(config)#int fa0/2SW1 (config-if)#spanning-tree vlan 1 priority 96SW2#sh spanning-tree bri (在对端查看)第三种:实验拓朴1)在一台交换上要修改根端口,则只需要修改发送者端口IDSW1(config)#int fa0/2SW1(config-if)#spanning-tree port-priority 127 SW1#sh spanning-tree bri。
CISCO交换机STP详细说明及配置CISCO交换机STP详细说明及配置一、STP概述STP(生成树协议)是一个二层管理协议。
在一个扩展的局域网中参与STP的所有交换机之间通过交换桥协议数据单元bpdu(bridge protocol data unit)来实现;为稳定的生成树拓扑结构选择一个根桥;为每个交换网段选择一台指定交换机;将冗余路径上的交换机置为blocking,来消除网络中的环路。
IEEE 802.1d是最早关于STP的标准,它提供了网络的动态冗余切换机制。
STP 使您能在网络设计中部署备份线路,并且保证:* 在主线路正常工作时,备份线路是关闭的。
* 当主线路出现故障时自动使能备份线路,切换数据流。
rSTP(rapid spanning tree protocol)是STP的扩展,其主要特点是增加了端口状态快速切换的机制,能够实现网络拓扑的快速转换。
1.1 设置STP模式使用命令config spanning-tree mode可以设置STP模式为802.1d STP或者802.1w rSTP.1.2 配置STP交换机中默认存在一个default STP域。
多域STP是扩展的802.1d,它允许在同一台交换设备上同时存在多个STP域,各个STP 域都按照802.1d运行,各域之间互不影响。
它提供了一种能够更为灵活和稳定网络环境,基本实现在vlan中计算生成树。
1.2.1 创建或删除STP利用命令create STPd和delete STPd可以创建或删除STP.缺省的default STP域不能手工创建和删除。
1.2.2 使能或关闭STP交换机中STP缺省状态是关闭的。
利用命令config STPd可以使能或关闭STP.1.2.3 使能或关闭指定STP的端口交换机中所有端口默认都是参与STP计算的。
使用命令config STPd port可以使能或关闭指定的STP端口。
1.2.4 配置STP的参数运行某个指定STP的STP协议后,可以根据具体的网络结构调整该STP的一些参数。
CISCO Catalyst 3550与华为3026E混合环境,spanning-tree上有兼容问题。
CISCO STP模式默认是PVST,3550(config)#spanning-tree mode ?mst Multiple spanning tree modepvst Per-Vlan spanning tree moderapid-pvst Per-Vlan rapid spanning tree mode华为的STP模式是RSTP,[3026E]stp mode ?rstp Rapid Spanning Tree Protocol modestp Spanning Tree Protocol mode两者在默认状态生成树有问题,把CISCO改为Multiple spanning tree mode,华为改为Spanning Tree Protocol mode问题解决。
Feedback#1楼 [楼主] 回复引用查看2006-12-13 17:23 by 苹果引擎关于STP(生成树)配置一、STP概述STP(生成树协议)是一个二层管理协议。
在一个扩展的局域网中参与STP的所有交换机之间通过交换桥协议数据单元BPDU(Bridge Protocol Data Unit)来实现;为稳定的生成树拓扑结构选择一个根桥;为每个交换网段选择一台指定交换机;将冗余路径上的交换机置为Blocking,来消除网络中的环路。
IEEE 802.1d是最早关于STP的标准,它提供了网络的动态冗余切换机制。
STP使您能在网络设计中部署备份线路,并且保证:在主线路正常工作时,备份线路是关闭的。
当主线路出现故障时自动使能备份线路,切换数据流。
RSTP(Rapid Spanning Tree Protocol)是STP的扩展,其主要特点是增加了端口状态快速切换的机制,能够实现网络拓扑的快速转换。
1.1 设置STP模式使用命令config spanning-tree mode可以设置STP模式为802.1d STP或者802.1w RSTP。
C I S C O交换机S T P详细说明及配置CISCO交换机STP详细说明及配置一、STP概述STP(生成树协议)是一个二层管理协议。
在一个扩展的局域网中参与STP 的所有交换机之间通过交换桥协议数据单元bpdu(bridge protocol data unit)来实现;为稳定的生成树拓扑结构选择一个根桥;为每个交换网段选择一台指定交换机;将冗余路径上的交换机置为blocking,来消除网络中的环路。
IEEE 802.1d是最早关于STP的标准,它提供了网络的动态冗余切换机制。
STP使您能在网络设计中部署备份线路,并且保证:* 在主线路正常工作时,备份线路是关闭的。
* 当主线路出现故障时自动使能备份线路,切换数据流。
rSTP(rapid spanning tree protocol)是STP的扩展,其主要特点是增加了端口状态快速切换的机制,能够实现网络拓扑的快速转换。
1.1 设置STP模式使用命令config spanning-tree mode可以设置STP模式为802.1d STP或者802.1w rSTP.1.2 配置STP交换机中默认存在一个default STP域。
多域STP是扩展的802.1d,它允许在同一台交换设备上同时存在多个STP域,各个STP域都按照802.1d运行,各域之间互不影响。
它提供了一种能够更为灵活和稳定网络环境,基本实现在vlan中计算生成树。
1.2.1 创建或删除STP利用命令create STPd和delete STPd可以创建或删除STP.缺省的default STP域不能手工创建和删除。
1.2.2 使能或关闭STP交换机中STP缺省状态是关闭的。
利用命令config STPd可以使能或关闭STP.1.2.3 使能或关闭指定STP的端口交换机中所有端口默认都是参与STP计算的。
使用命令config STPd port可以使能或关闭指定的STP端口。
1.2.4 配置STP的参数运行某个指定STP的STP协议后,可以根据具体的网络结构调整该STP的一些参数。
Cisco交换机STP负载均衡配置步骤Cisco交换机STP负载均衡配置步骤的方法Cisco IOS交换机生成树负载均衡配置示例在第11章,我们已了解到,Cisco自己开发的PVST、PVST+和Rapid-PVST+l因为是基于VLAN分配生成树实例的,所以它不仅可以实现比IEEE 802.1D标准的STP更快的收敛速度,而且还可以实现负载均衡。
为了避免环路,PVST、PVST+和Rapid-PVST+l仅会在交换机间的一条中继链路对特定VLAN通信激活,其他的都会被全部阻止,以实现在多个中继端口上均衡VLAN通信。
在生成树VLAN通信均衡方案中,又可以通过使STP端口优先级或者STP路径开销在中继端口进行配置。
注意:对于使用STP端口优先级进行的负载均衡,负载均衡的多条中继链路必须与同一个交换机连接;对于使用STP路径开销进行的负载共享,每条用于负载均衡的中继链路可以连接到同一个交换机,也可以连接在两个不同的交换机上。
【说明】IEEE 802.1s MSTP生成树模式中同样可以实现VLAN 通信负载均衡,而且同样有两种方案:一种是基于端口优先级的,另一种是基于端口路径开销值的。
但要注意的是,在MSTP的负载均衡配置中均只需在中继链路的一端配置即可,与本节介绍的SST下的负载均衡配置中的端口优先级方案有些区别,但与端口开销值方案一样。
具体在本章最后介绍的PVST+到MSTP迁移配置示例中有体现。
使用STP端口优先级进行负载均衡的配置示例当在一个交换机上的两个端口形成环路时,交换机使用STP端口优先级来决定哪个端口是启用状态,哪个端口又是阻塞状态的。
可以在平行的中继端口上设置优先级,以便这个端口可以承载指定VLAN上的所有通信流,而在另一条中继链路承载其他VLAN的通信。
在一个VLAN中,具有更高优先值的中继端口将转发该VLAN中的通信流,而同一VLAN中优先值低的中继端口将对VLAN保持阻塞状态,使同一时间只有一个中继端口发送或者接收一个VLAN中的所有通信流。
Cisco基础(三):HSRP配置、三层交换配置HSRP、STP的配置、三层交换配置STP⼀、HSRP配置⽬标:在企业⽹络到外部的连接⽅案中,要求不⾼的条件下可以是单出⼝。
⼀旦该出⼝线路出现问题,整个企业⽹络就不能连接到外⽹了。
为了使得企业⽹络到外⽹连接的⾼可⽤性,可以设置两个以上的出⼝,然⽽多个出⼝对于内⽹主机意味着我个⽹关。
主机不能同时使⽤多个⽹关,当主机所使⽤的⽹关出现故障时,它不能实现⽹关的⾃动切换。
配置热备份路由协议⽅案:在出⼝设备上配置热备份路由协议(HSRP),组成⼀个HSRP组,组内两个出⼝设备共享⼀个虚拟IP地址,该IP地址作为内⽹主机的⽹关。
HSRP组成员有主备之分,虚拟IP地址被附加到主设备上。
如果主设备线路出故障,备份设备会成为主设备,虚拟IP地址也会迁移过来。
这样,不管哪⼀个出⼝设备出现问题,不管哪个出⼝设备在提供外⽹接⼊,内⽹主机的⽹关都不需要改变。
⽹络拓扑图如下图所⽰:步骤:步骤⼀:分别在三台路由器上配置端⼝IP地址tarena-R1(config)# interface f0/0tarena-R1(config-if)#ip address 192.168.1.252 255.255.255.0tarena-R1(config-if)#no shutdowntarena-R1(config-if)#interface f0/1tarena-R1(config-if)#ip address 192.168.2.1 255.255.255.0tarena-R1(config-if)#no shutdowntarena-R2(config)#interface f0/0tarena-R2(config-if)#ip address 192.168.1.253 255.255.255.0tarena-R2(config-if)#no shutdowntarena-R2(config-if)#interface f0/1tarena-R2(config-if)#ip address 192.168.3.1 255.255.255.0tarena-R2(config-if)#no shutdowntarena-R3(config)#interface f0/0tarena-R3(config-if)#ip address 192.168.2.2 255.255.255.0tarena-R3(config-if)#no shutdowntarena-R3(config-if)#interface f0/1tarena-R3(config-if)#ip address 192.168.3.2 255.255.255.0tarena-R3(config-if)#no shutdowntarena-R3(config-if)#interface f1/0tarena-R3(config-if)#ip address 192.168.4.254 255.255.255.0tarena-R3(config-if)#no shutdown步骤⼆:在R1和R2上配置到外⽹的默认路由tarena-R1(config)#ip route 0.0.0.0 0.0.0.0 192.168.2.2tarena-R1(config)#endtarena-R1#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area* - candidate default, U - per-user static route, o - ODRP - periodic downloaded static routeGateway of last resort is 192.168.1.2 to network 0.0.0.0C 192.168.1.0/24 is directly connected, FastEthernet0/0C 192.168.2.0/24 is directly connected, FastEthernet0/1S* 0.0.0.0/0 [1/0] via 192.168.2.2tarena-R1#tarena-R2(config)#ip route 0.0.0.0 0.0.0.0 192.168.3.2tarena-R2(config)#exittarena-R2#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area* - candidate default, U - per-user static route, o - ODRP - periodic downloaded static routeGateway of last resort is 192.168.2.2 to network 0.0.0.0C 192.168.1.0/24 is directly connected, FastEthernet0/0C 192.168.3.0/24 is directly connected, FastEthernet0/1S* 0.0.0.0/0 [1/0] via 192.168.3.2步骤三:在R3上配置到企业内⽹的静态路由tarena-R3(config)#ip route 192.168.1.0 255.255.255.0 192.168.2.1tarena-R3(config)#ip route 192.168.1.0 255.255.255.0 192.168.3.1tarena-R3(config)#endtarena-R3#show ip routeCodes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGPD - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter areaN1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGPi - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area* - candidate default, U - per-user static route, o - ODRP - periodic downloaded static routeGateway of last resort is not setS 192.168.1.0/24 [1/0] via 192.168.2.1[1/0] via 192.168.3.1C 192.168.2.0/24 is directly connected, FastEthernet0/0C 192.168.3.0/24 is directly connected, FastEthernet0/1C 192.168.4.0/24 is directly connected, FastEthernet1/0tarena-R3#步骤四:在R1上配置HSRP,指定其优先级为200HSRP的默认优先级为100,路由器启动后,根据优先级决定谁可以成为活跃路由器,优先级⾼的将胜出。
cisco思科怎么配置STP思科公司已成为公认的世界网络互联解决方案的领先厂商,该公司出产的一系列路由器更是引领世界,那么你知道cisco思科怎么配置STP吗?下面是店铺整理的一些关于cisco思科怎么配置STP的相关资料,供你参考。
cisco思科配置STP的方法:SwA(config)#spanning-tree vlan 1 root primarySwA(config)#spanning-tree vlan 2 root primaryv配置SwB在VLAN 3和4中优先级为4096SwB(config)#spanning-tree vlan 3 priority 4096v配置SwA为VLAN 1和2的根网桥SwB(config)#spanning-tree vlan 4 priority 4096v查看配置结果SwB# show spanning-treeVLAN0001Spanning tree enabled protocol ieeeRoot ID Priority 24577Address 000d.28bf.4b40Cost 19Port 24 (FastEthernet0/24)Hello Time 2 sec Max Age 20 sec Forward Delay 15 secBridge ID Priority 32769 (priority 32768 sys-id-ext 1)Address 0013.6007.6a00Hello Time 2 sec Max Age 20 sec Forward Delay 15 secAging Time 300Interface Role Sts Cost Prio.Nbr Type---------------- ---- --- --------- -------- --------------------------------Fa0/22 Altn BLK 19 128.22 P2pFa0/23 Altn BLK 19 128.23 P2pFa0/24 Root FWD 19 128.24 P2pVLAN0002Spanning tree enabled protocol ieeeRoot ID Priority 24578Address 000d.28bf.4b40Cost 19Port 24 (FastEthernet0/24)Hello Time 2 sec Max Age 20 sec Forward Delay 15 secBridge ID Priority 32770 (priority 32768 sys-id-ext 2)Address 0013.6007.6a00Hello Time 2 sec Max Age 20 sec Forward Delay 15 secAging Time 300Interface Role Sts Cost Prio.Nbr Type---------------- ---- --- --------- -------- --------------------------------Fa0/22 Altn BLK 19 128.22 P2pFa0/23 Altn BLK 19 128.23 P2pFa0/24 Root FWD 19 128.24 P2pv查看配置结果(VLAN 3 - 4)SwA#show spanning-treeVLAN0003Spanning tree enabled protocol ieeeRoot ID Priority 4099Address 0013.6007.6a00Cost 19Port 24 (FastEthernet0/24)Hello Time 2 sec Max Age 20 sec Forward Delay 15 secBridge ID Priority 32771 (priority 32768 sys-id-ext 3)Address 000d.28bf.4b40Hello Time 2 sec Max Age 20 sec Forward Delay 15 secAging Time 300Interface Role Sts Cost Prio.Nbr Type---------------- ---- --- --------- -------- --------------------------------Fa0/22 Altn BLK 19 128.22 P2pFa0/23 Altn BLK 19 128.23 P2pFa0/24 Root FWD 19 128.24 P2pv配置交换机 C上连接主机的端口为速端口SwC(config)#interface range fastEthernet 0/1 - 20SwC(config-if-range)#spanning-tree portfast%Warning: portfast should only be enabled on ports connected to a singlehost. Connecting hubs, concentrators, switches, bridges, etc... to thisinterface when portfast is enabled, can cause temporary bridging loops.Use with CAUTION%Portfast will be configured in 20 interfaces due to the range commandbut will only have effect when the interfaces are in a non-trunking mode.v在交换机C上配置上行速链路SwC(config)#spanning-tree uplinkfastv配置了上行速链路后查看生成树信息SwC#show spanning-treeVLAN0001Spanning tree enabled protocol ieeeRoot ID Priority 24577Address 000d.28bf.4b40Cost 3019Port 23 (FastEthernet0/23)Hello Time 2 sec Max Age 20 sec Forward Delay 15 secBridge ID Priority 49153 (priority 49152 sys-id-ext 1)Address 000d.2861.b100Hello Time 2 sec Max Age 20 sec Forward Delay 15 secAging Time 300Uplinkfast enabledInterface Role Sts Cost Prio.Nbr Type---------------- ---- --- --------- -------- --------------------------------Fa0/22 Altn BLK 3019 128.22 P2pFa0/23 Root FWD 3019 128.23 P2p。
思科交换机STP配置思科交换机STP配置配置步骤:1、设备间运行标准生成树协议,配置各设备的生成树参数,使3228-1成为根网桥。
观察设备能否根据配置的参数修剪环路,完成生成树。
2、断开3228-1和3228-2之间链路,观察设备是否可自动完成网络拓扑的重构3、三台设备间运行快速生成树协议,使3228-1成为根网桥4、断开3228-1和3228-2之间链路,观察设备是否可自动完成网络拓扑的重构5、将三台设备间链路设置为VLAN TRUNK,并配置5个VLAN:VLAN1-5。
运行MSTP生成树协议,VLAN1和VLAN2建立生成树1,VLAN3和VLAN4建立生成树2,VLAN5建立生成树3。
修改各设备的生成树参数,使生成树1和生成树2的根网桥为3228-1,生成树3的根网桥为3228-26、断开3228-1和3228-2之间链路,观察生成树1和生成树2是否可自动完成网络拓扑的重构,而VLAN5的业务应不受影响SSTP配置三台3228配置均相同,下面是配置及说明:ZXR10(config)#spanning-tree enable //使能生成树协议ZXR10(config)#spanning-tree mode sstp //配置生成树协议的.当前模式为sstp假定目前3228-1不是根网桥,则在3228-2和3228-3上执行如下配置:ZXR10(config)# spanning-tree mst instance 0 priority 61440 //修改实例0的网桥优先级,61440=15*4096,根据需要,优先级可设置为i*4096,i=0...15。
RSTP配置三台3228配置均相同,下面是配置及说明:ZXR10(config)#spanning-tree enable //使能生成树协议ZXR10(config)#spanning-tree mode rstp //配置生成树协议的当前模式为rstp假定目前3228-1不是根网桥,则在3228-2和3228-3上执行如下配置:ZXR10(config)# spanning-tree mst instance 0 priority 61440 //修改实例0的网桥优先级,61440=15*4096,根据需要,优先级可设置为i*4096,i=0 (15)8.6.3 MSTP配置三台3228配置均相同,下面是配置及说明:ZXR10#vlan databaseZXR10(vlan)#vlan 1-5 //配置vlan1-5ZXR10(config)#spanning-tree enable //使能生成树协议ZXR10(config)#spanning-tree mode mstp //配置生成树协议的当前模式为mstpZXR10(config)#spanning-tree mstp configuration //进入MSTP配置模式ZXR10(config-mstp)#name zte //设置mst_config_id中的配置名称为zte。