资源描述:
《思科设备交换机STP(生成树协议)配置.doc》由会员上传分享,免费在线阅读,更多相关内容在工程资料-天天文库。
1、本次讲解STP(生成树协议)配置方法:当交换机之间有多个VLAN时Trunk线路负载会过重,这时需要设置多个Trunk端II,但这样会形成网络环路。而STP协议便可以解决这个问题。vlan1vlan2fO/4fO/5Laptop・192.168.1.1Laptop-PT192.168.2.1Laptop-PT192.168.4.1Laptop-PT192.168.3.10-241£0/6SwitChAfO/3fO/3£0/1fO/22960-2SwitchBfO/6aptop-PT192.168.1.2vlan1vlan2£0/4Laptop-PT192.168.2.2Lap
2、top-PT192.168.3.2Laptop-PT192.168.4.2EO/5木例配置模世图命令行:SwitchA配置如下:SwitchA#vlandatabaseSwitchA(vlan)#vtpdomaintztSwitchA(vlan)#vtpserverSwitchA(vIan)#vIan2nameVLAN2VLAN2added:Name:VLAN2SwitchA(vIan)#vIan3nameVLAN3VLAN3added:Name:VLAN3SwitchA(vlan)#vlan4nameVLAN4VLAN4added:Name:VLAN4SwitchA(vIa
3、n)#exitSwitchA#configureterminalSwitchA(config)#interfacefO/1//配置switchA的fO/1端口为trunk模式,允许所有vIan通过SwitchA(config-if)#switchportmodetrunk
4、SwitchA(config-if)#switchporttrunkaIIowedvIanalISwitchA(config-if)#exitSwitchA(config)#interfacefO/2//配置switchA的fO/1端口为trunk模式,允许所有vlan通过
5、SwitchA(config-i
6、f)#switchportmodetrunkSwitchA(config-if)#switchporttrunkaIIowedvlanalISwitchA(config-if)#endSwitchA#write£SwitchA#configureterminaI//将模型图中switchA对应端口划分到各vlan中SwitchA(config)#interfacefO/4SwitchA(config-if)#switchportmodeaccessSwitchA(config-if)#switchportaccessvian2SwitchA(config-if)#exitSw
7、itchA(config)#interfacefO/5SwitchA(config-if)#switchportmodeaccessSwitchA(config-if)#switchportaccessvlan3SwitchA(config-if)#exitSwitchA(config)#interfacefO/6SwitchA(config-if)#switchportmodeaccessSwitchA(config-if)#switchportaccessvian4SwitchA(config-if)#exitSwitchA(config-if)#endSwitchA#w
8、riteSwitchA#showvlan//查看vlan信息VLANNameStatusPorts1defauItactiveFaO/3,FaO/11,FaO/15,FaO/19,FaO/23,FaO/8,FaO/9,Fa0/10FaO/12,FaO/16,Fa0/20,FaO/24.FaO/13,FaO/17,FaO/21,Gigl/1,FaO/14FaO/18FaO/22Gigl/22VLAN2activeFaO/43VLAN3activeFaO/54VLAN4activeFaO/65VLAN5activeFaO/7//在交换机SwitchA设置各VLAN在Trunk端口
9、的STP值SwitchA(config)#interfacefO/1SwitchA(config-if)#spanning-1reeSwitchA(config-if)#spanning-treeSwitchA(config-if)#exit/Ian1port-priority162port-priority16SwitchA(config)#interfacefO/2►SwitchA(config-if)#spanning-tree/Ian3port-priority16SwitchA(conf