伊莉討論區

標題: CCNA - 排除VLAN連接 [打印本頁]

作者: zhi666    時間: 2016-12-4 01:41 PM     標題: CCNA - 排除VLAN連接


Lesson 1Troubleshooting VLANConnectivity


排除VLAN連接


VLIN一個簡單就是broadcast domain對應到一個IP網段


VLAN的指令


SW1(config)# vlan 2


SW1(config-vlan)# name switch1ab99  


增加了VLAN 2並將其命名為switch1ab99”名字為選也可以不命名。


SW1(config)# interface FastEthernet 0/2


SW1(config-if)# switchport access vlan 2


分配界面FastEthernet0/2VLAN 2


SW1#show vlan


顯示所有配置的VLAN信息



Trunk Operation


Trunk操作


Trunk為同一個VLANswitch溝通     


Trunk提供VLAN不同switch之間的溝通在沒有Router的情況下不同VLAN是不能溝通的。


Access port Trunk port最大的差別是有沒有掛標籤,Access port是不掛標Trunk port是有掛標的。


設定Trunk port的指令:


1. 進入界面配置模式


2. 配置FA0/11界面作為一個VLANTrunk


3.  native VLAN更改為VLAN 99


SW1(config)# interface fa0/11


SW1(config-if)# switchport mode trunk


SW1(config-if)# switchport trunk native vlan99


Native vlan是唯一不掛標Native vlan預設值1


後續檢查


SW1# show interface FastEthernet 0/11 switchport


驗證switch port上的FastEthernet0/11設置


SW1# show interface FastEthernet 0/11 trunk


驗證FastEthernet0/11幹線


Status 表示現在目前的現況,Trunking成功Status才會出現Trunking


一台有設定一台沒設定會Trunking




Dynamic Trunking Protocol


        動態Trunking協定(DTP)


這個主題說明的DTPswitchport模式的目的



預設值是Dynamicauto(被動)意思是我可以行成Trunk但要看對方的意思


Dynamic Desirable(主動)是主動要行成Trunk最少要有一邊主動才會行成Trunk


一邊是Access一邊是Trunk就會變成Limited connectivity(有限的連接)只有幾個可以過。


the command nonegotiatedisables negotiation(命令nonegotiate禁用談判)


有個參數nonegotiate就是我不跟你溝通協調 靜態宣告AccessTrunkport這是一個而外的參數


如果有Dynamic就是要講通協調


最後有個建議:手動宣告最好靜態手動宣告網路設備跟網路設備之間盡可能用靜態手動宣告接末端設備用動態宣告很多東西要協商


  

  
  

Dynamic

  

Auto

  
  

Dynamic

  

Desirable

  
  

Trunk

  
  

Access

  
  

Dynamic

  

Auto

  
  

Access

  
  

Trunk

  
  

Trunk

  
  

Access

  
  

Dynamic

  

Desirable

  
  

Trunk

  
  

Trunk

  
  

Trunk

  
  

Access

  
  

Trunk

  

  
  

Trunk

  
  

Trunk

  
  

Trunk

  
  

Limited connectivity

  
  

Access

  

  
  

Access

  
  

Access

  
  

Limited connectivity

  
  

Access

  


VLAN Troubleshooting


Totroubleshoot VLAN issues when you have no connection between PCs, follow thesehigh-level steps:


要在PC之間沒有連接時排除VLAN問題,請按照以下高級步驟操作:


Usethe show vlan command to check whether the port belongs to the expected VLAN.If the port is assigned to the wrong VLAN, use the switchport access vlancommand to correct the VLAN membership.


使用show vlan命令檢查Port是否屬於預期的VLAN 如果Port分配到錯誤的VLAN,請使用switchport access vlan命令更正VLAN成員身份。


Ifthe VLAN to which the port is assigned is deleted, the port becomes inactive.Use the show vlan or show interfaces switchport command to verify that the VLANis present in the VLAN database.


如果刪除了分配了PortVLAN,則該Port將變為非活動狀態。 使用show vlanshow interfaces switchport命令驗證VLAN是否存在於VLAN數據庫中。


第一個要檢查這個port歸屬VLAN對不對show vlan就看的到


Show mac address-table的目地:到底這個設備送出來的封包有沒有收到如果有收的話一定會學MAK


第二VLAN有沒有出現在數據庫(database)如果VLAN2本來有後來被NO掉了,就會歸屬VLAN2port變成孤魂野鬼,只要是歸VLAN2的介面會shutdown就算你No shutdown也沒有用


這兩種情都會interface當掉




縮小範圍show指令某個介面所學來的


SW1# show mac address-tableinterface FastEthernet 0/1


解決缺少VLAN


SW1# show interfaceFastEthernet 0/1 switchport


VLAN: 10 後面多個(inactive)(inactive)代表portVLAN不見了,


port歸屬VLAN是正確的




VLAN Troubleshooting


To troubleshoot trunk issueswhen the trunk is not established or “VLAN leading” is occurring, follow thesehigh-level steps:


要在Trunk未建立或“VLAN領先發生時解決Trunk問題,請按照以下高級步驟操作:


1.    Use theshow interface trunk command to check whether a trunk has been established betweenswitches. You should statically configure trunk links whenever possible.However, Cisco Catalyst switch ports, by default, run DTP, which tries tonegotiate a trunk link.


使用show interface trunk命令檢查是否有trunk交換機之間建立。您應該靜態配置trunk link只要有可能。然而,Cisco Catalyst交換機port預設情況下,運行DTP,它試圖協商Trunk鏈路。


2.    Use theshow interface trunk command to check whether the local and peer native VLANsmatch. If the native VLAN does not match on both sides, VLAN leaking occurs.


使用show interface trunk命令,檢查是否在本地和對native VLAN的匹配。的本地VLAN不兩側匹配,發生洩漏的VLAN


為什麼會trunk失敗括兩邊所宣告native VLAN不一致trunk modes不一致


唯一兩邊都一致還是行成不了trunk就是那個auto(1-11)兩台switch接起來都沒做任何設定,兩邊都是預設值Dynamic Auto所以行成不了trunk


所以最少要一邊改掉改成TrunkDynamic Desirable就可以行成Trunk




SW1#show interface FastEthernet 0/3 trunk


如果trunking失敗就會出現not-trunking的狀態


圖例子兩邊都autoVLAN位置不一樣



作者: c_c_1965    時間: 2016-12-4 11:29 PM

很實用的CCNA考試指南, 感謝您的分享
作者: zhi666    時間: 2016-12-11 03:53 PM

Lesson 2:Building Redundant Switched Topologies
構建多餘交換式拓撲結構  
issues in Redundant Topologies
容錯拓撲中的問題
多台switch所產生的問題:
一但造成Switch Loop第一個是燈號會亮橘燈,閃個不停
一般Switch的CPU是底於百分之20以下,Router才可以能超過百分之50,因為Switch是用硬體的方式去處理,所以CPU不高,如果超過百分之50絕對是異常。
介紹有什麼機制去避免這個Loop
Spanning-tree(生成樹)這個協定是內鍵在switch裡,是一個標準的協定


IEEE這個機構底下的委員會,802.1D這個委員會專門去制定Spanning-tree(生成樹)的標準,這個協定就是自己找適當的port把他關掉(全自動)。
關掉Loop的指令並不是那個port shutdown,port還是打開的,他是Blocking(擋住)意思是把封包檔住。
Blocking是針對使用者的封包,Spanning-tree本生的封包不會檔(不會丟掉),是檔Spanning-tree以外的封包。
Blocking state(阻擋狀態)跟shutdown是不一樣的,shutdown是interface當下來。

Spanning-tree的操作
The spanning-tree algorithm follows these steps:
生成樹算法遵循以下步驟:
1.        Elects a root bridge
選擇根橋
2.        Elects a root port for each non-root switch
為每個非根交換機選擇根Port
3.        Elects a designated port for each segment
為每個段選擇指定Port
4.        Ports transition to forwarding or blocking state
Port轉換到轉發或阻塞狀態
運作原理:他是怎麼全自動
1、Spanning-tree會自動行成一個樹狀架構,他們彼此選出一個樹根的角色,
選定之後在針對non-root switch(其他台switch),沒有當選root,只會有一台當選root。  

有non-root就會有root port,會有root port的就是沒當選root的,root port就是到逹root最好的port,選成本最低的port,成本如果一樣第二個選Bridge ID(BID),第三個選port ID(PID)。
他看的是傳送端的PID或者是priority(優先)。
3、Designated port(指定的port),就是長在root身上所有的port都是指定的port。
選root port或designated port基本條件都是要看成本等三個條件
4、條件都選好了,最後每一個port都會進入fowirding(轉發)會亮綠燈或blocking(檔住) 會亮橘燈。
注意:任何一個port都有一個角色,沒有分配到角色的port就是被關掉
Priority(優先)是比最小的值,預設值是32768,如果插電就用預設都一樣就是看MAC address,全部都是比小的。
switch和switch之間會互相交換BPDU的封包來決定角色,都是倆倆之間的事情。
selectin criteria(選擇標準)所用的封包名字為BPDU封包。


Step 1: Elect a root bridge     選擇根橋
-        Decision based on lowest BID     基於最低BID的決策
選root bridge 簡單的原則看BID (BID=priority+MAC)看誰的最小,所以Switch B當選root。


Step 2: Elect a root port for each non-root switch.     
為每個非根交換機選擇根Port。
-        Decision based on lowest root path cost.
基於最低根路徑成本的決策。
-        If necessary, ties are broken by upstream BID and port ID values.
如果需要,綁定由上行BID和PortID值中斷。
有root port的是switch A、C、D
只有non-root 的switch才會去選root port(RP),為動作二選項
Upstream(上游)




Step 3: Elect a designated port for each segment.
      為每個段選擇指定Port。
-        Decision is based on the lowest root path cost.
決策基於最低的根路徑成本。
-        If necessary, ties are broken by upstream BID and port ID.
如果需要,綁定由上行BID和PortID中斷。
DP = Designated port (指定的port)
每個網段都要選DP,不具備DP(Designated port)和RP(root port)的switch port全部關掉。
被關掉的port就會出現blocking(檔住)會亮橘燈。

   types of spanning-tree protocols
   生成樹協定的類型
802.1D:
*CST:不管切多少個VLAN都是用同一個樹狀架構。
Cisco 看到CST的問題自己出PVST+,比如說有十個VLAN,一到五用一套樹狀架構六到十用另一套樹狀架構,充份的運用被關掉的port。
後來IEEE又出802.1W為快速的spanning-tree,Cisco 又更新為Rapid PVST+,最後IEEE也出802.1S。
改善1.快速收斂2.附載均衡(不同VLAN走不同的樹狀架構)。

802.1s的樹狀架構有分群組1到5用一個群組6到10用一個群組比較不會浪費記憶體,但cisco的Rapid PVST+是一個VLAN一個樹狀架構是個別的重疊的


default spanning tree configuration for Cisco Catalyst switches:
Cisco Catalyst交換機的預設生成樹配置:
-        PVST
-        Enabled on all ports     在所有Port上啟用
-        Slower convergence after topology change than with RSTP
拓撲變化後收斂比RSTP慢
spanning tree預設值是不用設定的。
了解spanning tree的預設1.他跑的是PVST  2.所有的port都enable
所以他預設值跑的比較慢可以改成Rapid PVST+。





Per VLAN Spanning Tree Plus
每VLAN生成樹加

這是Pre VLAN Spanning Tree的目地就是能善加利用每個port。
圖裡的虛線就是有port被關掉。

Modifying the Bridge ID
修改網橋ID
SW1#Show spanning-tree vlan 1
有root Port表示這台沒當選root,有root就有成本(cost),到逹root的成本是19。non root才會有root port

我要讓某一台當選root的指令:
SW1(config)# spanning-tree vlan 1 root primary     (primary = 主要)
為了方便打個Primary,事實上Primary這個參數還是用priority。
Primary這個參數priority是給多少,是動態決定。
Primary = root priority – 2 x 4096。為32768 – 8192 = 24576。全部比小的值
這個指令下完會出現This bridge is the root,意思是SW1當選vlan 1 的root
24577是因為24576加上vlan 1所以是24577。為全自動下完指今就會跑出來

Analyzing the STP Topology
分析STP拓撲
To analyze STP topology, follow these steps:
要分析STP拓撲,請按照下列步驟操作:
1.        Discover the physical Layer 2 topology. You could use network documentation, if it exists, or use the show cdp neighbors command to discover the physical topology.
發現物理第2層拓撲。 您可以使用網路文檔(如果存在的話),或使用show cdp neighbors命令發現物理拓撲。
2.        Afire you have discovered the physical topology, use your knowledge of STP to determine the expected Layer 2 path. You will need to know which switch is the root bridge.
您已經發現物理拓撲,使用您的STP知識確定預期的第2層路徑。 您需要知道哪個交換機是根橋。
3.        Use the show spanning-tree vlan command to determine which switch is the root bridge.
使用show spanning-tree vlan命令確定哪個交換機是根網橋。
4.        Use the show spanning-tree vlan command on all switches to find out which ports are in blocking or forwarding state, and thus confirm your expected Layer 2 path.
在所有交換機上使用show spanning-tree vlan命令查找哪些Port處於阻塞或轉發狀態,從而確認您預期的第2層路徑。
雖然他是全自動,如果要檢查你的spanning-tree
先show cdp neighbors看他目前的接線狀態(拓撲),到底是從哪個port接到哪個port。

Analyzing the STP topology
分析STP拓撲
verify that the actual STP topology matches the expected topology
驗證實際STP拓撲的預期相匹配的拓撲

如圖:你的拓撲長這樣子,你要用什麼指令確認。

Switch A# show spanning-tree vlan 100
這邊的Bridge ID是指自己的Bridge ID,priority都一樣可是MAC輸掉了,所以Root ID是當選root。

Spanning-Tree Failure Consequences
Spanning-Tree故障後果
What will happen to this network if switch D erroneously transitions both its ports to the forwarding state?
會發生什麼這個網路如果switch D轉換錯誤其兩個port Forwarding狀態?
Any frame that enters a bridging loop will continue to be forwarded by the switches indefinitely.
進入橋接迴路的任何幀將繼續通過開關無限期轉發。

The consequences of STP failure are severe
STP失敗的後果是嚴重的
1.The load on all links in the switched LAN quickly starts increasing
在交換局域網的所有鏈路的負荷迅速開始增加
2.Due to the very high load for the CPU, the switch becomes unreachable.
由於CPU的非常高的負荷,且又無法到達該開關。
該關的port沒有關會大Loop封包一直repeat停不下來,switch本身也會做repeat的工作,這個網路會掛掉switch的CPU會飆高。

PortFast and BPDU Guard
接末端設備會加一個功能PortFast。
PortFast的意思是說:我這個port不要經過慢長的等待,可以立即進入forwarding。
原本的預設值橘燈會閃30秒,如果加了PortFast立即變成forwarding。
一開始接上末端設會先閃30秒,這30秒是不能使用的。
PortFast的功能讓switch所接的port立即進入forwarding。

通常會順便加上一個功能叫BPDU Guard,這個功能也是用在access port。
既然是接末端設備就不會接switch,不接switch的話就不該收到BPDU的封包
BPDU Guard的意思:如果有看到BPDU的封包立即刪掉,不只丟掉而且shutdown很嚴格讓這個port不能用了。
意思是說port不能在接switch設備,switch一接上來會發BPDU的封包,一有BPDU封包會馬上shutdown。
後來有更好的機制就是自動化,會自動判斷一接上switch就shutdown,接回access又打開。
最後PortFast和BPDU Guard 是用在access末端設備。switch和switch之間是trunk port。
因為PortFast的目的是最小化連接到用戶設備和伺服器的接入Port必須等待生成樹收斂的時間,所以它應該僅在接入Port上使用。 如果在連接到另一台交換機的Port上啟用PortFast,則有創建生成樹循環的風險。 唯一的例外是當Trunk線連接到非交換機設備(通常是伺服器)時。


Switch(config)# interface FastEthernet 0/1
Switch(config-if)# spanning-tree portfast
Switch(config-if)# spanning-tree bpduguard enable
Configures BPDU Guard and PortFast on interface FastEthernet 0/1
在介面FastEthernet 0/1配置BPDU Guard和PortFast
在個別的interface加這個功能。
Switch(config)# spanning-tree portfast bpduguard default
Switch(config)# spanning-tree portfast default
Enables PortFast on all nontrunking interfaces and enables BPDU Guard globally for all PortFast-enabled port
在所有非trunk介面上啟用的PortFast,使BPDU Guard全範圍內為所有啟用PortFast的port
default的意思是我全面性打開,你自己去幫我找,只要是access port就幫我加上這個功能,就不用一個一個打。

Switch# show running-config interface FastEternet 0/1

Switch# show spanning-tree interface FastEternet 0/1 portfast
Show狀態會出現
VLAN0010            enable       → 己啟用這個功能





歡迎光臨 伊莉討論區 (http://www10.eyny.com/) Powered by Discuz!