交換機以太網通道及生成樹配置詳解,理論+實戰

一、SW之間配置以太網通道

交換機以太網通道及生成樹配置詳解,理論+實戰

 

SW1(config)#default interface range ethernet 1/0 - 1

SW1(config)#interface port-channel 10

SW1(config-if)#no switchport

SW1(config-if)#ip address 10.1.1.1 255.255.255.0

SW1(config)#interface range ethernet 1/0-1

SW1(config-if-range)#no switchport

SW1(config-if-range)#channel-group 10 mode active

交換機以太網通道及生成樹配置詳解,理論+實戰

 

SW2(config)#port-channel load-balance ? ---負載

dst-ip Dst IP Addr

dst-mac Dst Mac Addr

src-dst-ip Src XOR Dst IP Addr

src-dst-mac Src XOR Dst Mac Addr

src-ip Src IP Addr

src-mac Src Mac Addr

交換機以太網通道及生成樹配置詳解,理論+實戰

 

二、生成樹STP:

交換機以太網通道及生成樹配置詳解,理論+實戰

 

802.1D:STP 802.1w: RSTP 802.1s: mst

思科默認PVST+

SW2(config)#spanning-tree mode ?

mst Multiple spanning tree mode

pvst Per-Vlan spanning tree mode

rapid-pvst Per-Vlan rapid spanning tree mode

生成樹:

Port ID : 端口優先級(默認128)+端口ID

BID: 優先級+MAC地址(MAC不改變)

1、SW2成爲VLNA1的主根,VLAN10的備份,SW1成爲VLAN10的主,VLAN1的備份

SW2(config)#spanning-tree vlan 10 root secondary

SW2(config)#spanning-tree vlan 1 roo primary

SW1(config)#spanning-tree vlan 10 root primary

SW1(config)#spanning-tree vlan 1 root secondary

SW2#show run | include spann

spanning-tree mode rapid-pvst

spanning-tree extend system-id

spanning-tree vlan 1 priority 24576

spanning-tree vlan 10 priority 28672

如果配置優先級爲0則最大可能性成爲主根

SW1(config)#spanning-tree vlan 10 priority 0

SW2(config)#spanning-tree vlan 1 priority 0

交換機以太網通道及生成樹配置詳解,理論+實戰

 

根端口選舉: 接收最優的BPDU

(1、Cost 2、BID 3、Port ID )

2、Vlan10 中的sw2的E1/1變爲轉發狀態

A、SW2上修改

SW2(config-if)#spanning-tree vlan 10 cost 99

交換機以太網通道及生成樹配置詳解,理論+實戰

 

B、SW1(根)修改端口優先級

(1、Cost 2、BID 3、Port ID )

SW1(config)#interface e1/1

SW1(config-if)#spanning-tree vlan 10 port-priority 64

交換機以太網通道及生成樹配置詳解,理論+實戰

 

SW1修改完成後顯示的是影響鄰居的端口優先級

交換機以太網通道及生成樹配置詳解,理論+實戰

 

DP:指定端口發送、中繼最優的BPDU

SW3的f0/2通過目前阻塞狀態,需要通過修改成爲指定端口

交換機以太網通道及生成樹配置詳解,理論+實戰

 

SW3(config)#spanning-tree vlan 10 priority 4096

交換機以太網通道及生成樹配置詳解,理論+實戰

 

Backbonefast:

交換機以太網通道及生成樹配置詳解,理論+實戰

 

SW3的2口(RP)關閉,收不到最優的BPDU,發送自己爲根的BPDU給SW2(SW3的3口是DP);SW2的3口不接受該BPDU,SW2的3口從BLK切換到LIS需要20秒的maxage,另外兩個15秒的轉發延遲,SW2的3口變爲DP發送來自SW1的最優的BPDU

SW3的E1/2接口shutdown

SW3(config)#interface e1/2

SW3(config-if)#shutdown

交換機以太網通道及生成樹配置詳解,理論+實戰

 

交換機以太網通道及生成樹配置詳解,理論+實戰

 

SW2(config)#spanning-tree backbonefast ---backbonefast每臺設備都要配置節省掉20S秒時間maxage

======================================================

快速生成樹802.1w:

SW1(config)#spanning-tree mode rapid-pvst

SW1#show spanning-tree summary totals

Switch is in rapid-pvst mode

類型shr和P2P,10M爲shr,10M以上爲P2P

SW1(config)#spanning-tree mode mst --修改成MST模式

SW1(config)#spanning-tree mst configuration

SW1(config-mst)#name CCIE

SW1(config-mst)#instance 1 vlan 1

SW1(config-mst)#instance 2 vlan 10

SW1#show spanning-tree mst configuration

Name [CCIE]

Revision 0 Instances configured 3

Instance Vlans mapped

-------- ---------------------------------------------------------------------

0 2-9,11-4094

1 1

2 10

=======================================================

802.1S

SW1#sho run | s mst

spanning-tree mode mst

spanning-tree mst configuration

name CCIE

instance 1 vlan 1

instance 2 vlan 10

MST:cost 2000000變化 ,版本變爲3 flag相同

=======================================================

Bpdugard:

SW1(config)#spanning-tree portfast defaul ---全局下針對Portfast終端

SW1(config)#spanning-tree portfast edge bpduguard

交換機以太網通道及生成樹配置詳解,理論+實戰

 

SW1(config)#spanning-tree portfast defaul ---全局下針對Portfast終端

SW1(config)#no spanning-tree portfast edge bpduguard

SW1(config)#interface range ethernet 1/0-1

SW1(config-if-range)#shu

SW1(config-if-range)#no sh

SW1(config-if-range)#switchport trunk encapsulation dot1q

SW1(config-if-range)#switchport mode trunk

SW1(config-if-range)#switchport nonegotiate

注意: 接口下面開啓Bpdugard即使沒有配置portfast,也會生效

SW1(config)#interface range ethernet 1/0-1

SW1(config-if-range)#spanning-tree bpduguard enabl

==================================================

Bpdufilte:

SW1(config)#spanning-tree portfast edge bpdufilter default

如果把SW1的E1/1配置爲bpdufilter則該接口不會發送BPDU報文,則對端SW2 E1/1接口收不到任何BPDU報文從BLK狀態變爲轉發FWD,此時就產生環路。---不建議使用

====================================================

Loopbuard: 在DP指定端口配置Loopbuard:

SW1(config)#spanning-tree mode rapid-pvs ----R1R2R3配置快速生成樹

SW1(config)#interface e1/2

SW1(config-if)#spanning-tree guard root

SW1:spanning-tree vlan 10 priority 4096

SW3:spanning-tree vlan 10 priority 0 ---讓SW3成爲根橋

交換機以太網通道及生成樹配置詳解,理論+實戰

 

SW1(config-if)#

*Nov 30 08:08:35.335: %SPANTREE-2-ROOTGUARD_BLOCK: Root guard blocking port Ethernet1/2 on VLAN0010.

交換機以太網通道及生成樹配置詳解,理論+實戰

 

SW2(config)#interface e1/0 ----在RP或備份端口配置

交換機以太網通道及生成樹配置詳解,理論+實戰

 

SW2(config-if)#spanning-tree guard loop

SW1(config)#interface e1/0

SW1(config-if)#spanning-tree bpdufilter enable

交換機以太網通道及生成樹配置詳解,理論+實戰

 

===================================================

UDLD: 單向鏈路檢測

SW2(config)#udld aggressive

SW1(config)#errdisable recovery cause udld ---自動恢復

歡迎轉發學網絡的小夥伴們,希望能幫助到大家,關注分享該WX Gongzhonghao: 【huayinetwork】持續分享乾貨網絡技術,公開答疑!

同時爲方便廣大網絡愛好者一起共同學習交流,開設了華爲&思科網絡技術交流qun,qun裏上傳大量免費學習資料,定期技術答疑,歡迎廣大網絡愛好者進羣學習交流!

 

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章