應用環境
實體環路可以提高網絡的可靠性,當一條線路斷掉的時候,另一條線路仍然可以傳輸資料。
但會産生廣播風暴。(stp 用來防止廣播風暴)
1 STP (Spanning Tree Protocol )(生成樹協定)
STP叫做生産數協定。顧名思義,就是把一個環形的結構改變成一個樹形的結構。STP協定就是用來将實體上存在環路的網絡,通過一種算法,在邏輯上斷開一些端口,來生成一個邏輯上的樹形結構。
2 STP 工作原理 :
1 生成樹的算法:
選擇根網橋 (Root Bridge) 1 選擇根網橋的依據是網橋ID (ID 的值最小為根網橋 0-65535)
2 選擇根網橋依據MAC 位址 (MAC位址小的為根網橋)
選擇根端口 (Root ports ) 1 到根網橋最低的根路徑成本
2 直連的網橋ID 最小
3 端口ID 最小 (0-255)
選擇指定端口(Designated Ports ) 1 根路徑成本較低
2 所在的交換機的網橋ID 值較小
3 端口ID 值較小
3 BPDU (橋協定資料單元)
BPDU 的兩種類型:
一種是配置BPDU .用于生成樹計算。
一種是拓撲變更通告(Topology Change Notification , TCN ) BPDN ,用于通告網絡拓撲的變化。
4 交換機端口的5種STP 狀态
轉發(Forwarding) 發送/接收使用者資料
學習(Learning) 建構網橋表
偵聽(listening) 建構 活動 拓撲
阻塞 (Blocking) 隻接收BPDU
禁止 (Disabled) 強制關閉
5 STP 的配置指令
1 啟用生成樹指令
switch(config )# spanning-tree vlan vlan - list
2 配置網橋的指令
switch (config )# spanning-tree vlan vlan - list root primary | secondary
3 修改網橋優先級指令
switch (spanning-tree vlan vlan-list priority Bridge-priority
4 修改端口成本:
switch(config )# spanning-tree vlan vlan-list cost cost
5修改端口優先級:
switch (config )# spanning-tree vlan vlan-list port-priority priority
6 配置上行速鍊路:
switch(config )# spanning-tree uplinkfast
7 配置速端:
switch(config ) # spanning-tree portfast
8檢視生成樹的配置;
switch#show spanning-tree
swith#show spannin-tree brief
9 檢視某個VLAN 的生成樹詳細信:
switch#show spannin-tree vlan vlan-id detail
二 EthernetChannel (以太網通道)
1 兩條鍊路能夠負載均衡,提高鍊路帶寬,并能夠互相備份。
最多有6個通道
以太網每個通道最多可以捆8條實體鍊路 (因為交換機最多48口)
2 以太網通道的規則
參加捆綁的端口必須屬于同一vlan
相同模式的端口
同樣的速度和全/半模式
3 以太網通道的配置指令
switch(config ) #interface 接口(連續接口加上range )
switch(config )#channel-group 1- 6 mode on
switch(config )#speed 100
switch(config )#duplex auto/full/half