交換機及虛擬局域網組網技術-課件_第1頁
交換機及虛擬局域網組網技術-課件_第2頁
交換機及虛擬局域網組網技術-課件_第3頁
交換機及虛擬局域網組網技術-課件_第4頁
交換機及虛擬局域網組網技術-課件_第5頁
已閱讀5頁,還剩40頁未讀, 繼續免費閱讀

下載本文檔

版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領

文檔簡介

1、交換機及虛擬局域網組網技術陳開恒 交換機簡介 交換機是基于mac來工作,可以隔離沖突域不可以隔離廣播域。 本質鏈路的邏輯拓展沖突域 沖突域是數據必然發送到的區域。HUB組成的網絡是一個沖突域。交換機的一個接口下的網絡是一個沖突域,所以交換機可以隔離沖突域。廣播域 廣播數據時可以發送到的區域是一個廣播域。交換機對廣播幀是透明的,由交換機組成的網絡是一個廣播域。路由器的一個接口下的網絡是一個廣播域。所以路由器可以隔離廣播域。 交換機的工作原理交換機的作用:維護CAM表(context address memory),該表是交換機的端口和各計算機MAC的映射

2、表。根據CAM表進行數據幀的轉發。交換機對幀的處理:交換機收到幀后,查詢CAM表,如果查詢不到目的計算機所在的端口,交換機把幀從源端口以外的端口轉發。否則轉b交換機收到幀后,查詢CAM表。如果目的端口不是計算機接收幀的源端口,對幀進行轉發。否則轉c如果目的端口和源端口是同一端口,丟棄該幀。兩層交換機和三層交換機 兩層交換機運行在數據鏈路層,三層交換機簡單來講即是是一個帶有第三層路由功能的第二層交換機 。三層交換原理:假設兩個使用IP協議的站點A、B通過第三層交換機進行通信,發送站點A在開始發送時,把自己的IP地址與B站的IP地址比較,判斷B站是否與自己在同一子網內。若目的站B與發送站A在同一子

3、網內,則進行二層的轉發。若兩個站點不在同一子網內,如發送站A要與目的站B通信,發送站A要向“缺省網關”發出ARP(地址解析)封包。如果交換機在以前的通信過程中已經知道B站的MAC地址,則向發送站A回復B的MAC。 否則交換機根據路由信息向B站廣播一個ARP請求,B站得到此ARP請求后向回復其MAC地址,交換機保存此地址并回復給發送站A,同時將B站的MAC地址發送到二層交換MAC地址表中。從這以后,當A向B發送的數據包便全部交給二層交換處理。由于僅僅在路由過程中才需要三層處理,絕大部分數據都通過二層交換轉發,因此三層交換機的速度很快,接近二層交換機的速度。Note: 局域網必須通過路由器與公網實

4、現跨地域互聯 三層交換機不具有同時處理多個協議的能力 簡單交換機互連三臺終端通過交換機互連終端IP地址分別為 測試連通性仿真軟件下載地址/xinming/Network System experiment實驗仿真軟件.exe VLAN的應用背景及實現功能VLANVirtual Local Area Network【背景描述】某企業有兩個主要部門:技術部(A1、A3)和銷售部(A2、B1、B2),其中銷售部門的個人計算機系統分散連接,也就有一名銷售部的工作人員在技術部的辦公室,他的電腦連接在技術部的交

5、換機上。技術部之間、銷售部之間需要相互進行通信,但為了數據安全起見,技術部和銷售部需要進行相互隔離?!就負鋱D如下:】技術需求同一個部門的主機在同一個局域網上,并且部門內的數據流量不希望其他部門收到,也不希望干擾其他部門,也就是要求同一個部門在同一個“廣播域”上。顯然對于以上的物理拓撲,所有主機通過交換機相連,處在同一個廣播域(沒有劃分VLAN的交換機上的各個端口上的設備分別屬于不同的沖突域,每一交換端口構成一個沖突域,但同屬于一個廣播域)。如A1和A3之間的廣播,A2、B1、B2也會收到,這不是我們所希望的。不加限制,會產生廣播風暴問題廣播需求導致了VLAN的產生需要有一種辦法,在盡量不改動網

6、絡固有配置的前提下,通過靈活的、標準的、基于軟件的做法將具有相同需求的用戶放到一起,使之就象在一個LAN中那樣工作。它不但能夠在物理上使網絡延伸,還能使對網絡實施更靈活強大的控制功能成為可能。VLAN的出現使之成為可能。VLAN簡介沖突域和廣播域交換機能隔離沖突域,但不能隔離廣播域,通過多個交換機連接在一起的所有計算機都在一個廣播域中,任何一臺計算機發送的廣播包,其他計算機都會收到,這樣大大降低了帶寬的利用率。VLAN(Virtual LAN)可以隔離廣播域,VLAN工作在OSI模型的第2層,是交換機端口的邏輯組合。VLAN的主要優點廣播風暴防范安全性能提高提高管理效率VLAN的劃分基于端口的

7、VLAN在這種定義方法中,某個交換機上的端口(例如端口1、3、5)構成VLAN A,而該交換機上的其他端口構成VLAN B。早期基于端口的VLAN成員只能位于一個交換機中。第二代基于端口的VLAN支持多個交換機,例如交換機X上的端口1和端口2與交換機Y上的端口3和端口4構成一個VLAN?;贛AC地址的VLAN在這種定義方法中,若干個MAC地址構成VLAN成員。用戶屬于哪個VLAN由其網卡中的MAC地址決定。Trunk簡介VLAN可以把在同一個交換機上端口組合成一個VLAN,也可以不同交換機上的端口組合成一個VLAN。當一個VLAN跨過不同的交換機時,在同一個VLAN上但是接在不同的交換機上的

8、計算機如何實現通信?VLAN 2VLAN 1VLAN 1VLAN 2VLAN標記技術直觀的方法是為每一個VLAN增加連線,這樣多個VLAN會占用太多接口。可以采用Trunk技術實現跨交換機的VLAN內通信,Trunk技術使得在一條物理線路上可以傳遞多個VLAN的信息。為了區別多個VLAN的數據幀,需要某種標記技術。有兩種常見的Trunk幀標記技術:ISL和IEEE 802.1Q。ISL技術在原有的幀上重新加了一個幀頭,并重新生產了幀校驗序列(FCS)。ISL是思科特有的技術。IEEE 802.1Q技術是在原有幀的源MAC地址字段后插入4字節的標記字段,同時用新的CRC字段替代了原有的CRC字段

9、。IEEE 802.1Q是國際標準。采用ISL的Trunk使用ASIC執行對計算機透明,計算機看不到ISL頭部可以在交換機與交換機之間、交換機與路由器之間使用ISL幀格式封裝技術(Encapsulated)協議無關的(Protocol independent)將原有的幀封裝在新的幀中采用802.1Q的Trunk802.1Q幀格式標記技術(Tagged)協議相關的(Protocol dependent)在原有幀中添加一個字段采用Trunk技術實現了VLAN的跨計算機通信VLAN 2VLAN 1VLAN 1VLAN 2帶有VLAN 1標簽的以太網幀帶有VLAN 2標簽的以太網幀不帶VLAN標簽的以

10、太網幀DTP(Dynamic Trunk Protocol)簡介管理員可以手動指定交換機之間的鏈路是否形成Trunk,也可以讓交換機自動協商,這個協議稱為DTP,DTP還可以協商Trunk鏈路的封裝類型。配置了DTP的交換機會發送DTP協商包,或者對對方發送來的DTP包進行響應,雙方最終商討他們之間的鏈路是否形成Trunk,以及采用什么樣的Trunk封裝方式。Cisco網絡設備支持動態協商端口的工作狀態。根據動態協議的實現方式,Cisco網絡設備接口有多種不同的工作模式。交換機接口模式cisco網絡中,交換機在局域網中最終穩定狀態的接口類型主要有四種:access / trunk / mult

11、i / dot1q-tunnel。1、access: 主要用來接入終端設備,如PC機、服務器、打印服務器等。2、trunk: 主要用在連接其它交換機,以便在線路上承載多個VLAN。3、multi: 在一個線路中承載多個vlan,但不像trunk,它不對承載的數據打標簽。主要用于接入支持多vlan的服務器或者一些網絡分析設備?,F在基本不使用此類接口,在Cisco的網絡設備中,也基本不支持此類接口了。4、dot1q-tunnel: 用在Q-in-Q隧道配置中。Cisco交換機接口模式的設置1、switchport mode access:強制接口成為access接口,并且可以與對方主動進行協商,誘

12、使對方成為access模式。2、switchport mode trunk:強制接口成為trunk接口,并且主動誘使對方成為trunk模式,所以當鄰居交換機接口為trunk/desirable/auto時會成為Trunk接口。3、switchport mode dynamic desirable:主動協商建立trunk,發送并接收DTP信號。如果鄰居交換機模式為trunk/desirable/auto之一,則接口將變成trunk接口。如果不能形成trunk模式,則工作在access模式。4、switchport mode dynamic auto:被動協商建立trunk,只接收不發送DTP信號

13、。當鄰居接口為trunk/desirable之一時,才會成為trunk。如果不能形成trunk模式,則工作在access模式。5、switchport nonegotiate:嚴格的說,這不算是種接口模式,它的作用只是阻止交換機接口發出DTP數據包,它必須與switchport mode trunk或者switchport mode access一起使用。6、switchport mode dot1q-tunnel:配置交換機接口為隧道接口(非trunk),以便與用戶交換機的trunk接口形成不對稱鏈路。VLAN實驗【實驗目的】了解VLAN交換機的特性與應用場合掌握VLAN交換機組網的基本配置

14、方法【實驗環境】:模擬軟件 Cisco Packet Tracer 5.2Packet Tracer是思科公司為網絡學員認證學習而開發的一套用來設計、配置和排除故障的網絡模擬系統,目前最新版本為5.2。該軟件支持大量的設備仿真模型:路由器、交換機、無線網絡設備、服務器、各種連接電纜、終端等,還能仿真各種模塊,這在實際實驗設備中是無法配置齊全的。對設備均提供圖型化和終端兩種配置方法,各設備模型均有可視化的外觀仿真。VLAN實驗內容實驗器材:3560交換機2臺,PC機5臺,連接線若干。網絡拓撲圖如下:圖中:A1、A2、A3連接在Switch1上,B1、B2連接在Switch2上。假定應用場景是A1

15、、A3屬于技術部,B1、B2、A2屬于銷售部,要求同一部門的主機在同一個局域網上。VLAN實驗內容Switch1 InterfacesSwitch2 InterfacesFromToFromToFastEthernet 0/1A1FastEthernet 0/1B1FastEthernet 0/2A2FastEthernet 0/2B2FastEthernet 0/3A3FastEthernet 0/11Switch1, FastEthernet 0/11FastEthernet 0/11Switch2, FastEthernet 0/11交換機端口連接配置PC主機IP地址子網掩碼A1192.

16、168.1.1A2A3B1B2主機IP地址配置配置各臺主機配置主機IP地址點擊 主機 圖標,在彈出的窗口中,點擊“Desktop”選項卡,在“IP Configuration”里直接配置IP地址和子網掩碼?;蛘咴凇癈ommand Prompt”里,輸入命令ipconfig ip_addr net_mask配置完主機IP地址,回答【問題1】:每臺主機相互ping,查看哪些主機可以連

17、通,哪些不可以?為什么?注:可以用 ping -n 1 55 發起一個受限廣播,(參數 -n 1指明只發送一次,免得默認發送4次受到干擾),觀察都收到了哪些主機的回復?在交換機上配置VLANVLAN配置如下:VLAN numVLAN nameSwitch port2techSwitch1, port 2, 33salesSwitch1, port1; Switch2, port2, 3點擊 交換機 圖標,在彈出的窗口中,點擊“CLI”,進入交換機配置終端。在Switch上創建VLAN在Switch1上創建VLAN進入特權模式:Switchenable進入VLAN配置模

18、式:Switch#vlan databaseSwitch(vlan)#vlan 2 name techSwitch(vlan)#vlan 3 name salesSwitch(vlan)#exit進入全局設置模式Switch#configure terminal在Switch上創建VLAN將Switch1的各端口劃分在VLAN中Switch(config)#interface FastEthernet 0/1Switch(config-if)#switchport mode accessSwitch(config-if)#switchport access vlan 2Switch(confi

19、g-if)#interface FastEthernet 0/2Switch(config-if)#switchport mode accessSwitch(config-if)#switchport access vlan 3Switch(config-if)#interface FastEthernet 0/3Switch(config-if)#switchport mode accessSwitch(config-if)#switchport access vlan 2在Switch上創建VLAN配置與Switch2連接的Trunk接口Switch(config-if)#interfac

20、e FastEthernet 0/11Switch(config-if)#switchport mode trunk在Switch2上創建VLANSwitchenableSwitch#vlan database Switch(vlan)#vlan 3 name salesSwitch(vlan)#exitSwitch#configure terminal在Switch上創建VLAN將Switch2的各端口劃分在VLAN中Switch(config)#interface FastEthernet 0/1Switch(config-if)#switchport mode accessSwitch(

21、config-if)#switchport access vlan 3Switch(config-if)#interface FastEthernet 0/2Switch(config-if)#switchport mode accessSwitch(config-if)#switchport access vlan 3配置與Switch1連接的Trunk接口Switch(config-if)#interface FastEthernet 0/11Switch(config-if)#switchport mode trunk實驗結果在Switch1上用 show vlan 查看VLAN信息VL

22、AN Name Status Ports- - - -1 default active Fa0/4, Fa0/5, Fa0/6, Fa0/7 Fa0/8, Fa0/9, Fa0/10, Fa0/12 Fa0/13, Fa0/14, Fa0/15, Fa0/16 Fa0/17, Fa0/18, Fa0/19, Fa0/20 Fa0/21, Fa0/22, Fa0/23, Fa0/24 Gig0/1, Gig0/22 tech active Fa0/1, Fa0/33 sales active Fa0/21002 fddi-default act/unsup 1003 token-ring-def

23、ault act/unsup 1004 fddinet-default act/unsup 1005 trnet-default act/unsup VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2- - - - - - - - - - -1 enet 100001 1500 - - - - - 0 02 enet 100002 1500 - - - - - 0 03 enet 100003 1500 - - - - - 0 01002 fddi 101002 1500 - - - - - 0 0 1003

24、 tr 101003 1500 - - - - - 0 0 1004 fdnet 101004 1500 - - - ieee - 0 0 1005 trnet 101005 1500 - - - ibm - 0 0 Remote SPAN VLANs-Primary Secondary Type Ports- - - -實驗結果在Switch1上用 show interfaces FastEthernet 0/1 switchport 查看端口信息Name: Fa0/1Switchport: EnabledAdministrative Mode: static accessOperation

25、al Mode: static accessAdministrative Trunking Encapsulation: dot1qOperational Trunking Encapsulation: nativeNegotiation of Trunking: OffAccess Mode VLAN: 2 (tech)Trunking Native Mode VLAN: 1 (default)Voice VLAN: noneAdministrative private-vlan host-association: noneAdministrative private-vlan mappin

26、g: noneAdministrative private-vlan trunk native VLAN: noneAdministrative private-vlan trunk encapsulation: dot1qAdministrative private-vlan trunk normal VLANs: noneAdministrative private-vlan trunk private VLANs: noneOperational private-vlan: noneTrunking VLANs Enabled: AllPruning VLANs Enabled: 2-1

27、001Capture Mode DisabledCapture VLANs Allowed: ALLProtected: falseUnknown unicast blocked: disabledUnknown multicast blocked: disabledAppliance trust: none實驗結果在Switch1上用 show interfaces FastEthernet 0/2 switchport 查看端口信息Name: Fa0/2Switchport: EnabledAdministrative Mode: static accessOperational Mode

28、: static accessAdministrative Trunking Encapsulation: dot1qOperational Trunking Encapsulation: nativeNegotiation of Trunking: OffAccess Mode VLAN: 3 (sales)Trunking Native Mode VLAN: 1 (default)Voice VLAN: noneAdministrative private-vlan host-association: noneAdministrative private-vlan mapping: non

29、eAdministrative private-vlan trunk native VLAN: noneAdministrative private-vlan trunk encapsulation: dot1qAdministrative private-vlan trunk normal VLANs: noneAdministrative private-vlan trunk private VLANs: noneOperational private-vlan: noneTrunking VLANs Enabled: AllPruning VLANs Enabled: 2-1001Cap

30、ture Mode DisabledCapture VLANs Allowed: ALLProtected: falseUnknown unicast blocked: disabledUnknown multicast blocked: disaAppliance trust: none實驗結果在Switch1上用 show interfaces FastEthernet 0/11 switchport查看端口信息Name: Fa0/11Switchport: EnabledAdministrative Mode: trunkOperational Mode: trunkAdministra

31、tive Trunking Encapsulation: dot1qOperational Trunking Encapsulation: dot1qNegotiation of Trunking: OnAccess Mode VLAN: 1 (default)Trunking Native Mode VLAN: 1 (default)Voice VLAN: noneAdministrative private-vlan host-association: noneAdministrative private-vlan mapping: noneAdministrative private-v

32、lan trunk native VLAN: noneAdministrative private-vlan trunk encapsulation: dot1qAdministrative private-vlan trunk normal VLANs: noneAdministrative private-vlan trunk private VLANs: noneOperational private-vlan: noneTrunking VLANs Enabled: AllPruning VLANs Enabled: 2-1001Capture Mode DisabledCapture

33、 VLANs Allowed: ALLProtected: falseUnknown unicast blocked: disabledUnknown multicast blocked: disabledAppliance trust: none實驗結果在Switch2上用 show vlan 查看VLAN信息VLAN Name Status Ports- - - -1 default active Fa0/3, Fa0/4, Fa0/5, Fa0/6 Fa0/7, Fa0/8, Fa0/9, Fa0/10 Fa0/12, Fa0/13, Fa0/14, Fa0/15 Fa0/16, Fa0

34、/17, Fa0/18, Fa0/19 Fa0/20, Fa0/21, Fa0/22, Fa0/23 Fa0/24, Gig0/1, Gig0/23 sales active Fa0/1, Fa0/21002 fddi-default act/unsup 1003 token-ring-default act/unsup 1004 fddinet-default act/unsup 1005 trnet-default act/unsup VLAN Type SAID MTU Parent RingNo BridgeNo Stp BrdgMode Trans1 Trans2- - - - -

35、- - - - - -1 enet 100001 1500 - - - - - 0 03 enet 100003 1500 - - - - - 0 01002 fddi 101002 1500 - - - - - 0 0 1003 tr 101003 1500 - - - - - 0 0 1004 fdnet 101004 1500 - - - ieee - 0 0 1005 trnet 101005 1500 - - - ibm - 0 0 Remote SPAN VLANs-Primary Secondary Type Ports- - - -實驗結果在Switch2上用 show int

36、erfaces FastEthernet 0/1 switchport 查看端口信息Name: Fa0/1Switchport: EnabledAdministrative Mode: static accessOperational Mode: static accessAdministrative Trunking Encapsulation: dot1qOperational Trunking Encapsulation: nativeNegotiation of Trunking: OffAccess Mode VLAN: 3 (sales)Trunking Native Mode V

37、LAN: 1 (default)Voice VLAN: noneAdministrative private-vlan host-association: noneAdministrative private-vlan mapping: noneAdministrative private-vlan trunk native VLAN: noneAdministrative private-vlan trunk encapsulation: dot1qAdministrative private-vlan trunk normal VLANs: noneAdministrative priva

38、te-vlan trunk private VLANs: noneOperational private-vlan: noneTrunking VLANs Enabled: AllPruning VLANs Enabled: 2-1001Capture Mode DisabledCapture VLANs Allowed: ALLProtected: falseUnknown unicast blocked: disabledUnknown multicast blocked: disabledAppliance trust: none實驗結果在Switch2上用 show interface

39、s FastEthernet 0/11 switchport 查看端口信息Name: Fa0/11Switchport: EnabledAdministrative Mode: trunkOperational Mode: trunkAdministrative Trunking Encapsulation: dot1qOperational Trunking Encapsulation: dot1qNegotiation of Trunking: OnAccess Mode VLAN: 1 (default)Trunking Native Mode VLAN: 1 (default)Voic

40、e VLAN: noneAdministrative private-vlan host-association: noneAdministrative private-vlan mapping: noneAdministrative private-vlan trunk native VLAN: noneAdministrative private-vlan trunk encapsulation: dot1qAdministrative private-vlan trunk normal VLANs: noneAdministrative private-vlan trunk privat

41、e VLANs: noneOperational private-vlan: noneTrunking VLANs Enabled: AllPruning VLANs Enabled: 2-1001Capture Mode DisabledCapture VLANs Allowed: ALLProtected: falseUnknown unicast blocked: disabledUnknown multicast blocked: disabledAppliance trust: none查看各臺主機的連通性在配置VLAN之后,回答【問題2】:每臺主機相互ping,查看哪些主機可以連通

42、,哪些不可以?為什么?注:可以用 ping -n 1 55 發起一個受限廣播,(參數 -n 1指明只發送一次,免得默認發送4次受到干擾),觀察都收到了哪些主機的回復?DTP的配置 將Switch1的FastEthernet 0/11接口的Trunk配置為desirable模式:Switch1(config)#interface FastEthernet 0/11Switch1(config-if)#shutdownSwitch1(config-if)#switchport mode dynamic desirable Switch1(config-if)#no shu

43、tdown 將Switch2的FastEthernet 0/11接口的Trunk配置為auto模式:Switch2(config)#interface FastEthernet 0/11Switch2(config-if)#shutdownSwitch2(config-if)#switchport mode dynamic autoSwitch2(config-if)#no shutdown實驗結果在Switch1上用 show interfaces FastEthernet 0/11 switchport查看端口信息Name: Fa0/11Switchport: EnabledAdminis

44、trative Mode: dynamic desirableOperational Mode: trunkAdministrative Trunking Encapsulation: dot1qOperational Trunking Encapsulation: dot1qNegotiation of Trunking: OnAccess Mode VLAN: 1 (default)Trunking Native Mode VLAN: 1 (default)Voice VLAN: noneAdministrative private-vlan host-association: noneA

45、dministrative private-vlan mapping: noneAdministrative private-vlan trunk native VLAN: noneAdministrative private-vlan trunk encapsulation: dot1qAdministrative private-vlan trunk normal VLANs: noneAdministrative private-vlan trunk private VLANs: noneOperational private-vlan: noneTrunking VLANs Enabled: AllPruning VLANs Enabled: 2-1001Capture Mode DisabledCapture VLANs Allowed: ALLProtected: falseUnknown unicast blocked: disabledUnknown multicast blocked: disabledAppliance trust: none實驗結果在Switch2上用 show interface

溫馨提示

  • 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
  • 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯系上傳者。文件的所有權益歸上傳用戶所有。
  • 3. 本站RAR壓縮包中若帶圖紙,網頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
  • 4. 未經權益所有人同意不得將文件中的內容挪作商業或盈利用途。
  • 5. 人人文庫網僅提供信息存儲空間,僅對用戶上傳內容的表現方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
  • 6. 下載文件中如有侵權或不適當內容,請與我們聯系,我們立即糾正。
  • 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。

最新文檔

評論

0/150

提交評論