stp協(xié)議的功能: 防止廣播風(fēng)暴. STP的工作原理: 1.算法: A 選擇根網(wǎng)橋(Root Bridge) 網(wǎng)橋ID是唯一的,,交換機之間選擇BID值最小的交換機作為網(wǎng)絡(luò)中的根網(wǎng)橋. B 選擇根端口(Root Por 根路徑成本最低 直連的網(wǎng)橋ID最小 端口ID最小 C 選擇指定端口(Designated Ports) 1.根橋上的端口全是指定端口 2.非根橋上的指定端口: a根路徑成本最低 b端口所在的網(wǎng)橋的ID值小 c端口ID值較小
2.BPDU包: 交換機之間使用BPDU來交換STP信息 3.生成樹端口的狀態(tài): 轉(zhuǎn)發(fā)(Forwarding):發(fā)送和接受用戶數(shù)據(jù) 學(xué)習(xí)(Learning):構(gòu)建網(wǎng)橋表 偵聽(Listening):構(gòu)建拓?fù)?/p> 阻塞(Blocking):只接受BPDU 禁用(Disable): 強制關(guān)閉 PVST: 工作作用:1.實現(xiàn)網(wǎng)絡(luò)負(fù)載分擔(dān) 2.配置上行速鏈路,實現(xiàn)備份的上行現(xiàn)鏈路快速恢復(fù) 3.配置速端口,使鏈路終端的端口快速進(jìn)入到轉(zhuǎn)發(fā)狀態(tài) 命令:啟用生成樹的命令 switch(config)# spanning-tree vlan vlan-list 配置根網(wǎng)橋命令的命令 switch(config)# spanning-tree vlan vlan-list root primary|secondary 修改網(wǎng)橋優(yōu)先級的命令 switch(config)# spanning-tree vlan vlan-list priority Bridge-priority 修改端口成本 switch(config)# spanning-tree vlan vlan-list cost cost 修改端口優(yōu)先級 switch(config)# spanning-tree vlan vlan-list port-priority priority 配置上行現(xiàn)鏈路 switch(config)# spanning-tree uplinkfast 配置速端口 switch(config)# spanning-tree protfast 查看生成樹的配置 switch#show spanning-tree 查看某個VLAN的生成樹詳細(xì)信息 switch#show spanning-tree vlan vlan-ID detail EthernetChannel: 1. 多條線路負(fù)載均衡,,帶寬提高 2. 容錯,當(dāng)一條線路失效時,其他線路通信,不會丟包
實驗拓?fù)洌?/span> 實驗?zāi)康模?/span> 1,、在交換機上設(shè)置VLAN,啟用STP,,實現(xiàn)不同的VLAN選擇不同的根網(wǎng)橋?qū)崿F(xiàn)負(fù)載分擔(dān),。 2、在接入交換機上配置上行速鏈路,。 3,、配置接入交換機連接主機的端口為速端口。 4,、在兩臺核心交換機之間配置以太網(wǎng)通道。 試驗步驟: (實驗設(shè)備:Cisco catalyst 3640) SW1: en conf t hostname s1 int vlan 1 ip address 192.168.1.1 255.255.255.0 no shut exit exit vlan database vlan 2 vlan 3 vlan 4 vtp domain instantwr vtp server exit conf t int range f0/13 - 14 switchport mode trunk no shut exit int range f0/1 - 2 channel-group 1 mode on exit spanning-tree vlan 1 root primary spanning-tree vlan 2 root primary SW2: en conf t hostname s2 int vlan 1 ip address 192.168.1.2 255.255.255.0 no shut exit exit vlan database vtp domain instantwr vtp client exit conf t int range f0/13 - 14 switchport mode trunk no shut exit int range f0/1 - 2 channel-group 1 mode on exit spanning-tree vlan 3 root primary spanning-tree vlan 4 root primary
SW3: en conf t hostname s3 int vlan 1 ip address 192.168.1.3 255.255.255.0 no shut exit exit vlan database vtp domain instantwr vtp client exit conf t int range f0/13 - 14 switchport mode trunk no shut exit int range f0/0 - 15 spanning-tree portfast exit spanning-tree uplinkfast
SW4: en conf t hostname s4 int vlan 1 ip address 192.168.1.4 255.255.255.0 no shut exit exit vlan database vtp domain instantwr vtp client exit conf t int range f0/13 - 14 switchport mode trunk no shut exit int range f0/0 - 15 spanning-tree portfast exit spanning-tree uplinkfast |
|