{"id":946,"date":"2011-09-07T22:35:00","date_gmt":"2011-09-07T14:35:00","guid":{"rendered":"http:\/\/note.systw.net\/note\/?p=946"},"modified":"2023-11-07T22:46:47","modified_gmt":"2023-11-07T14:46:47","slug":"cisco-stp-enhance","status":"publish","type":"post","link":"https:\/\/systw.net\/note\/archives\/946","title":{"rendered":"Cisco STP Enhance"},"content":{"rendered":"\n<p>STP\u52a0\u5febconvergence<br>\u4e3b\u8981\u6709\u4ee5\u4e0b\u65b9\u6cd5<br><strong>portfast<\/strong>:access-layer node<br><strong>uplinkfast<\/strong>:access-layer uplinks<br><strong>backbonefast<\/strong>:core-layer redundant backbone paths<br>ps:\u6b64\u4e09\u500b\u662f\u70ba\u4e86\u89e3\u6c7a802.1d\u6a19\u6e96\u7684\u7f3a\u9ede<\/p>\n\n\n\n<p>\u555f\u7528portfast<br><strong>(config-if)#spanning-tree portfast<\/strong><br>or global enable portfast<br><strong>(config)# spanning-tree portfast default<\/strong><br>\u5c07listen\u548clearn\u72c0\u614b\u6240\u9700\u6642\u9593\u7e2e\u5230\u6975\u77ed,\u56e0\u6b64\u611f\u61c9\u5230link up\u6642(workstation\u9023\u5165\u7db2\u8def)\u6703\u7acb\u523b\u5230forward\u72c0\u614b<br>\u3000\u53ef\u6e1b\u5c1130sec<br>\u3000\u6703\u4fdd\u6301loop\u5075\u6e2c\u529f\u80fd,\u82e5\u6709\u5075\u6e2c\u5230\u5247\u5c07port\u6539\u6210blocking state<br>\u3000\u555f\u52d5\u6216\u95dc\u9589\u6642\u4e0d\u6703\u767c\u9001tcnbpdu&nbsp;<br>\u3000\u901a\u5e38\u7528\u5728\u9023\u63a5end user\u7684\u4ecb\u9762&nbsp;<br>\u3000\u9810\u8a2d\u6bcf\u500b\u4ecb\u9762\u90fd\u95dc\u9589<br>Verifying method<br>\u3000show running-config interface &lt; interface&gt;<br>ps:<br>(config-if)#switchport host\u6703\u57f7\u884c\u4e09\u500b\u6307\u4ee4,\u5176\u4e2d\u4e00\u500b\u6703\u555f\u7528portfast<br>ps:<br>\u4e5f\u53ef\u652f\u63f4trunk port,\u53ef\u7e2e\u77edtrunk\u4ecb\u9762\u5230forward\u72c0\u614b\u4e4b\u6642\u9593<br>(config-if)#spanning-tree portfast trunk<\/p>\n\n\n\n<p><br>\u555f\u7528uplinkfast<br>(config)#spanning-tree uplinkfast [max-update-rate &lt; pkts-per-second&gt;]<br>\u7576root port\u65b7\u7dda\u5247\u99ac\u4e0a\u5c07alternate port\u5f9eblocking status\u8b8a\u6210forwarding status<br>\u3000\u53ef\u6e1b\u5c1130sec<br>\u3000alternate port\u662f\u6307\u4e0b\u500b\u6709\u6700\u4f4eroot path cost\u7684root port<br>\u3000\u6703\u8a18\u9304\u6bcf\u4e00\u689d\u5230root bridge\u7684\u8def\u5f91<br>\u3000\u6703\u4fee\u6539bridge priority\u70ba49152\u4ee5\u907f\u514d\u6210\u70baroot bridge,\u4e26\u628a\u6240\u6709port cost\u63d0\u9ad8\u81f33000\u4ee5\u6210\u70baend switch<br>\u3000\u4e0d\u53ef\u5728root bridge\u4e0a\u4f7f\u7528,\u901a\u5e38\u7528\u5728end switch(edge switch)\u4e0a<br>\u3000\u5229\u7528Dummy Frame\u53bb\u5075\u6e2c,\u6bcf\u79d2150frame<br>\u53c3\u6578\u8aaa\u660e\u5982\u4e0b:\u3000<br>[max-update-rate] \u53ef\u8a2d\u7bc4\u570d\u70ba0-65535,\u9810\u8a2d150,\u6bcf\u79d2\u901a\u77e5\u4e0a\u6e38switch\u8cc7\u8a0a\u7684packet\u6578\u91cf<br>\u3000\u4e3b\u8981\u50b3\u9001dummy multicast frames\u52300100.0ccd.cdcd<br>ex:\u555f\u7528uplinkfast<br>(config)# spanning-tree uplinkfast<br># show spanning-tree uplinkfast<br>UplinkFast is enabled<br>Station update rate set to 150 packets\/sec.<br>UplinkFast statistics<br>Number of transitions via uplinkFast (all VLANs) : 2<br>Number of proxy multicast addresses transmitted (all VLANs) : 52<br>Name\u3000\u3000\u3000,Interface List<br>VLAN0001\u3000,Gi0\/1(fwd)<br>VLAN0010\u3000,Gi0\/1(fwd)<br>VLAN0100\u3000,Gi0\/1(fwd)<\/p>\n\n\n\n<p>\u555f\u7528backbonefast<br><strong>(config)#spanning-tree backbonefast<\/strong><br>\u5075\u6e2c\u9593\u63a5\u93c8\u8def\u6545\u969c,\u52a0\u5feb\u6536\u6582\u901f\u5ea6<br>\u3000\u5c07Max Age 20 sec\u6642\u9593\u7e2e\u77ed(\u5c07\u6536\u6582\u6642\u9593\u5f9e50\u79d2\u8b8a\u523030\u79d2)<br>\u3000\u6703\u555f\u7528RLQ protocol<br>ps:\u8a72\u7db2\u8def\u6240\u6709switch\u90fd\u555f\u7528backbonefast\u624d\u53ef\u6b63\u78ba\u7684\u904b\u4f5c,\u9810\u8a2d\u662f\u95dc\u9589<\/p>\n\n\n\n<p>&#8230;&nbsp;<\/p>\n\n\n\n<p>\u986f\u793auplinkfast\u72c0\u614b<br>#show spanning-tree uplinkfast<\/p>\n\n\n\n<p>\u986f\u793abackbonefast\u72c0\u614b<br>#show spanning-tree backbonefast<\/p>\n\n\n\n<p>&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;..<\/p>\n\n\n\n<p><strong>RSTP Configuration<\/strong><br>By default, a switch operates in PVST+ mode using traditional 802.1D STP.<br>Therefore, RSTP cannot be used until a different spanning-tree mode(MST or RPVST+) is enabled<br>ps:<br>RSTP is just the&nbsp;<strong>underlying mechanism<\/strong>&nbsp;that a spanning-tree mode can use to detect topology changes and converge a network into a loop-free topology<\/p>\n\n\n\n<p>enable the RPVST+ mode<br><strong>Switch(config)# spanning-tree mode rapid-pvst<\/strong><br>\u8981\u5c07\u8a72\u5340\u6240\u6709switch\u555f\u7528rstp,\u8a72\u5340\u624d\u6703\u5f62\u6210rstp\u7db2\u8def<br>ps:<br>After enable the RPVST+, the switch must begin supporting both RSTP and 802.1D STP neighbors. The switch can detect the neighbor&#8217;s STP type by the BPDU version that is received<br>ps<br>enable the PVST+ mode:#spanning-tree mode pvst<\/p>\n\n\n\n<p><br>To configure an RSTP edge port<br><strong>Switch(config-if)# spanning-tree portfast<\/strong><\/p>\n\n\n\n<p>To force the port to act as a point-to-point link, if port is operating in half duplex mode<br><strong>Switch(config-if)# spanning-tree link-type point-to-point<\/strong><br>ps:<br>By default, RSTP automatically decides that a port is a point-to-point link if it is operating<br>in full-duplex mode<\/p>\n\n\n\n<p>shows information about the RSTP<br><strong>#show spanning-tree [vlan &lt; vlan-id&gt; ]<\/strong><br>ps<br>Switch# show spanning-tree vlan 171 \u70ba\u4f8b,\u756b\u9762\u5927\u81f4\u5982\u4e0b<br>VLAN0171<br>\u3000Spanning tree enabled protocol<strong>&nbsp;rstp<\/strong><br>\u3000Root ID Priority 4267<br>\u3000\u3000\u3000\u3000\u3000\u3000Address 00d0.0457.38aa<br>\u3000\u3000\u3000\u3000\u3000\u3000Cost 3<br>\u3000\u3000\u3000\u3000\u3000\u3000Port 833 (Port-channel1)<br>\u3000\u3000\u3000\u3000\u3000\u3000Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec<br>Bridge ID Priority 32939 (priority 32768 sys-id-ext 171)<br>\u3000\u3000\u3000\u3000\u3000\u3000Address 0007.0d55.a800<br>\u3000\u3000\u3000\u3000\u3000\u3000Hello Time 2 sec Max Age 20 sec Forward Delay 15 sec<br>\u3000\u3000\u3000\u3000\u3000\u3000Aging Time 300<br>Interface Role Sts Cost Prio.Nbr Type<br>&#8212;&#8212;&#8212;&#8212;&#8212;- &#8212;- &#8212;- &#8212;&#8212;&#8212; &#8212;&#8212;&#8211; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;-<br>Gi7\/8 Desg FWD 4 128.392 P2p<br>Gi9\/6 Altn BLK 4 128.518&nbsp;<strong>P2p Peer(STP)<\/strong><br>Po1 Root FWD 3 128.833 P2p<br>Po2 Desg FWD 3 128.834 P2p<br>Po3 Desg FWD 3 128.835 P2p<br>\u8aaa\u660e\u5982\u4e0b<br>P2p denotes a point-to-point RSTP port type in which a full-duplex link connects two neighboring switches that both are running RSTP.<br>P2p Peer(STP), the port is a point-to-point type but the neighboring device is running traditional 802.1D STP<\/p>\n\n\n\n<p>&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;<\/p>\n\n\n\n<p><strong>MST Configuration<\/strong><br>1.<br>to must manually configure the MST configuration attributes on each switch in a region<br>ps:There is currently no method to propagate this information from one switch to another, as is done with a protocol such as VTP<br>2.<br>A switch cannot run both MST and PVST+ at the same time.<\/p>\n\n\n\n<p>&#8230;<\/p>\n\n\n\n<p>Enable MST on the switch:<br><strong>Switch(config)# spanning-tree mode mst<\/strong><br>After MST is enabled and configured, PVST+ operation stops and the switch changes to RSTP operation.<\/p>\n\n\n\n<p>MST configuration<br>1<br>Enter the MST configuration mode:<br><strong>Switch(config)# spanning-tree mst configuration<\/strong><br>2<br>Assign a &#8220;MST configuration name&#8221; for MST region<br><strong>Switch(config-mst)# name &lt; name&gt;<\/strong><br>&lt; name&gt; :up to 32 characters<br>3<br>Assign a &#8220;region configuration revision number&#8221; for MST region<br><strong>Switch(config-mst)# revision &lt; version&gt;<\/strong><br>&lt; version&gt; :0 to 65,535<br>4<br>Map VLANs to an MST instance in MST region:<br><strong>Switch(config-mst)# instance &lt; instance-id&gt; vlan &lt; vlan-list&gt;<\/strong><br>&lt; instance-id&gt; :maximum of 16 MSTIs in each region.<br>The IST always exists as MSTI 0, leaving MSTIs 1-15 available for use.<br>&lt; vlan-list&gt; :1 to 4,094<br>ps:<br>by default, all VLANs are mapped to instance 0, the IST.<br>5<br>Show the pending changes you have made:<br><strong>Switch(config-mst)# show pending<\/strong><\/p>\n\n\n\n<p>ex:<br>\u8a2d\u5b9amst,<br>region name=buildmst<br>revision=1<br>MST instance-to-VLAN mapping\u70ba msti1=vlan 51,52;msti2=vlan53-55<br>device1\u8a2d\u5b9a\u5982\u4e0b<br>device1(config)#spanning-tree mode mst<br>device1(config-mst)#spanning-tree mst configuration<br>device1(config-mst)#name buildmst<br>device1(config-mst)#revision 1 \/\/\u6240\u6709\u7684switch\u90fd\u8981\u76f8\u540c<br>device1(config-mst)#instance 1 vlan 51,52<br>device1(config-mst)#instance 2 vlan 53-55<br>device2\u8a2d\u5b9a\u5982\u4e0b<br>device2(config)#spanning-tree mode mst<br>device2(config-mst)#spanning-tree mst configuration<br>device2(config-mst)#name buildmst<br>device2(config-mst)#revision 1 \/\/\u6240\u6709\u7684switch\u90fd\u8981\u76f8\u540c<br>device2(config-mst)#instance 1 vlan 51,52<br>device2(config-mst)#instance 2 vlan 53-55<\/p>\n\n\n\n<p>&#8230;<\/p>\n\n\n\n<p>tune the parameters that MST uses when it interacts with CST or 802.1D.<\/p>\n\n\n\n<p>Set root bridge(macro).<br><strong>Switch(config)# spanning-tree mst &lt; instance-id&gt; root &lt; primary |secondary&gt; [diameter &lt; diameter&gt;]<\/strong><\/p>\n\n\n\n<p>Set bridge priority.<br><strong>Switch(config)# spanning-tree mst &lt; instance-id&gt; priority &lt; bridge-priority&gt;<\/strong><br>Set port cost.<br><strong>Switch(config)# spanning-tree mst &lt; instance-id&gt; cost &lt; cost&gt;<\/strong><br>Set port priority.<br><strong>Switch(config)# spanning-tree mst &lt; instance-id&gt; port-priority &lt; port-priority&gt;<\/strong><\/p>\n\n\n\n<p>Set STP timers.<br><strong>Switch(config)# spanning-tree mst hello-time &lt; seconds&gt;<br>Switch(config)# spanning-tree mst forward-time &lt; seconds&gt;<br>Switch(config)# spanning-tree mst max-age &lt; seconds&gt;<\/strong><\/p>\n\n\n\n<p>&#8230;<\/p>\n\n\n\n<p>Displays mst configuration information<br><strong>Switch#show spanning-tree mst configuration<\/strong><br>ps:<br>\u756b\u9762\u5927\u81f4\u5982\u4e0b<br>Name [cisco]<br>Revision 1<br>Instance Vlans mapped<br>&#8212;&#8212;&#8211; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br>0 11-4094<br>1 1-10<\/p>\n\n\n\n<p><br>Displays MSTP instance<br><strong>Switch#show spanning-tree mst &lt; instance_number&gt;<\/strong><br>ps:<br>Switch#show spanning-tree mst 1 \u70ba\u4f8b,\u756b\u9762\u5927\u81f4\u5982\u4e0b<br>###### MST01 vlans mapped: 1-10<br>Bridge address 00d0.00b8.1400 priority 32769 (32768 sysid 1)<br>Root this switch for MST01<br>Interface Role Sts Cost Prio.Nbr Status<br>&#8212;&#8212;&#8212;&#8212;&#8212;- &#8212;- &#8212; &#8212;&#8212;&#8212; &#8212;&#8212;&#8211; &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;<br>Fa4\/4 Back BLK 1000 240.196 P2p<br>Fa4\/5 Desg FWD 200000 128.197 P2p<br>Fa4\/48 Boun FWD 200000 128.240 P2p Bound(STP)<\/p>\n\n\n\n<p><br>&#8230;<\/p>\n\n\n\n<p>\u53c3\u8003\u8cc7\u6599<br>http:\/\/life.iiietc.ncu.edu.tw\/xms\/read_attach.php?id=21303<br>http:\/\/baike.baidu.com\/view\/123854.htm<br>http:\/\/networking.ctocio.com.cn\/StandardProtocol\/164\/9080664.shtml<br>http:\/\/www.china-ccie.com\/ccie\/lilun\/switching\/switching.html#11<br>http:\/\/wenku.baidu.com\/view\/2b8f2f0790c69ec3d5bb7530.html<\/p>\n","protected":false},"excerpt":{"rendered":"<p>STP\u52a0\u5febconvergence\u4e3b\u8981\u6709\u4ee5\u4e0b\u65b9\u6cd5portfas &#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"","fifu_image_alt":"","_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[34],"tags":[],"class_list":["post-946","post","type-post","status-publish","format-standard","hentry","category-cisco-layer2"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/posts\/946","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/comments?post=946"}],"version-history":[{"count":0,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/posts\/946\/revisions"}],"wp:attachment":[{"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/media?parent=946"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/categories?post=946"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/systw.net\/note\/wp-json\/wp\/v2\/tags?post=946"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}