您好,登錄后才能下訂單哦!
這篇文章主要講解了“交換機劃分VLAN怎么配置”,文中的講解內(nèi)容簡單清晰,易于學(xué)習(xí)與理解,下面請大家跟著小編的思路慢慢深入,一起來研究和學(xué)習(xí)“交換機劃分VLAN怎么配置”吧!
某一公司內(nèi)財務(wù)部、銷售部的 PC 通過 2 臺交換機實現(xiàn)通信;要求財務(wù)部和銷售部的 PC 可以互通,但為了數(shù)據(jù)安全起見,銷售部和財務(wù)部需要進行互相隔離,現(xiàn)要在交換機上做適當(dāng)配置來實現(xiàn)這一目標(biāo)。 |
技術(shù)原理
VLAN(Virtual Local Area Network)的中文名為"虛擬局域網(wǎng)"。
虛擬局域網(wǎng)(VLAN)是一組邏輯上的設(shè)備和用戶,這些設(shè)備和用戶并不受物理位置的限制,可以根據(jù)功能、部門及應(yīng)用等因素將它們組織起來,相互之間的通信就好像它們在同一個網(wǎng)段中一樣,由此得名虛擬局域網(wǎng)。VLAN是一種比較新的技術(shù),工作在OSI參考模型的第2層和第3層,一個VLAN就是一個廣播域,VLAN之間的通信是通過第3層的路由器來完成的。與傳統(tǒng)的局域網(wǎng)技術(shù)相比較,VLAN技術(shù)更加靈活,它具有以下優(yōu)點: 網(wǎng)絡(luò)設(shè)備的移動、添加和修改的管理開銷減少;可以控制廣播活動;可提高網(wǎng)絡(luò)的安全性。
VLAN 是指在一個物理網(wǎng)段內(nèi),進行邏輯的劃分,劃分成若干個虛擬局域網(wǎng),VLAN做大的特性是不受物理位置的限制,可以進行靈活的劃分。VLAN 具備了一個物理網(wǎng)段所具備的特性。相同 VLAN 內(nèi)的主機可以相互直接通信,不同 VLAN 間的主機之間互相訪問必須經(jīng)路由設(shè)備進行轉(zhuǎn)發(fā),廣播數(shù)據(jù)包只可以在本 VLAN 內(nèi)進行廣播,不能傳輸?shù)狡渌?VLAN 中。
Port VLAN 是實現(xiàn) VLAN 的方式之一,它利用交換機的端口進行 VALN 的劃分,一個端口只能屬于一個 VLAN。
Tag VLAN 是基于交換機端口的另一種類型,主要用于是交換機的相同 Vlan 內(nèi)的主機之間可以直接訪問,同時對不同 Vlan 的主機進行隔離。Tag VLAN 遵循IEEE802.1Q 協(xié)議的標(biāo)準(zhǔn),在使用配置了 Tag VLAN 的端口進行數(shù)據(jù)傳輸時,需要在數(shù)據(jù)幀內(nèi)添加 4 個字節(jié)的 8021.Q 標(biāo)簽信息,用于標(biāo)示該數(shù)據(jù)幀屬于哪個 VLAN,便于對端交換機接收到數(shù)據(jù)幀后進行準(zhǔn)確的過濾。
實驗步驟
新建 Packet Tracer 拓撲圖;
劃分 VLAN;
將端口劃分到相應(yīng) VLAN 中;
設(shè)置 Tag VLAN Trunk 屬性;
測試
實驗設(shè)備
Switch_2960 2 臺;PC 4 臺;直連線
PC1 IP: 192.168.1.2 Submark: 255.255.255.0 Gateway: 192.168.1.1 PC2 IP: 192.168.1.3 Submark: 255.255.255.0 Gateway: 192.168.1.1 PC3 IP: 192.168.1.4 Submark: 255.255.255.0 Gateway: 192.168.1.1 PC4 IP: 192.168.1.5 Submark: 255.255.255.0 Gateway: 192.168.1.1 Switch2 en conf t vlan 2 exit vlan 3 exit inter fa 0/1 switch access vlan 2 exit inter fa 0/2 switch access vlan 3 exit inter fa 0/24 switch mode trunk end show vlan Switch3 en conf t vlan 2 exit vlan 3 exit int fa 0/1 switch access vlan 2 exit int fa 0/2 switch access vlan 3 exit int fa 0/24 switch mode trunk end show vlan PC1 ping PC2 timeout PC1 ping PC3 Reply
實戰(zhàn)演練
Switch2 Switch>en Switch#conf t Enter configuration commands, one per line. End with CNTL/Z. Switch(config)#vlan 2 Switch(config-vlan)#exit Switch(config)#vlan 3 Switch(config-vlan)#exit Switch(config)#inter fa 0/1 Switch(config-if)#switch access vlan 2 Switch(config-if)#exit Switch(config)#inter fa 0/2 Switch(config-if)#switch access vlan 3 Switch(config-if)#exit Switch(config)#inter fa 0/24 Switch(config-if)#switch mode trunk %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/24, changed state to down %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/24, changed state to up Switch(config-if)#end Switch# %SYS-5-CONFIG_I: Configured from console by console Switch#show 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/11, Fa0/12, Fa0/13, Fa0/14 Fa0/15, Fa0/16, Fa0/17, Fa0/18 Fa0/19, Fa0/20, Fa0/21, Fa0/22 Fa0/23, Gig1/1, Gig1/2 2 VLAN0002 active Fa0/1 3 VLAN0003 active Fa0/2 1002 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 ---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------ 1 enet 100001 1500 - - - - - 0 0 2 enet 100002 1500 - - - - - 0 0 3 enet 100003 1500 - - - - - 0 0 1002 fddi 101002 1500 - - - - - 0 0 --More-- Switch3 Switch>en Switch#conf t Enter configuration commands, one per line. End with CNTL/Z. Switch(config)#vlan 2 Switch(config-vlan)#exit Switch(config)#vlan 3 Switch(config-vlan)#exit Switch(config)#int fa 0/1 Switch(config-if)#switch access vlan 2 Switch(config-if)#exit Switch(config)#int fa 0/2 Switch(config-if)#switch access vlan 3 Switch(config-if)#exit Switch(config)#int fa 0/24 Switch(config-if)#switch mode trunk Switch(config-if)#end Switch# %SYS-5-CONFIG_I: Configured from console by console Switch#show 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/11, Fa0/12, Fa0/13, Fa0/14 Fa0/15, Fa0/16, Fa0/17, Fa0/18 Fa0/19, Fa0/20, Fa0/21, Fa0/22 Fa0/23, Gig1/1, Gig1/2 2 VLAN0002 active Fa0/1 3 VLAN0003 active Fa0/2 1002 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 ---- ----- ---------- ----- ------ ------ -------- ---- -------- ------ ------ 1 enet 100001 1500 - - - - - 0 0 2 enet 100002 1500 - - - - - 0 0 3 enet 100003 1500 - - - - - 0 0 1002 fddi 101002 1500 - - - - - 0 0 --More--
測試
PC>ipconfig IP Address......................: 192.168.1.2 Subnet Mask.....................: 255.255.255.0 Default Gateway.................: 192.168.1.1 PC>ping 192.168.1.3 Pinging 192.168.1.3 with 32 bytes of data: Request timed out. Request timed out. Ping statistics for 192.168.1.3: Packets: Sent = 2, Received = 0, Lost = 2 (100% loss), Control-C ^C PC>ping 192.168.1.4 Pinging 192.168.1.4 with 32 bytes of data: Reply from 192.168.1.4: bytes=32 time=16ms TTL=128 Reply from 192.168.1.4: bytes=32 time=17ms TTL=128 Reply from 192.168.1.4: bytes=32 time=15ms TTL=128 Reply from 192.168.1.4: bytes=32 time=18ms TTL=128 Ping statistics for 192.168.1.4: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 15ms, Maximum = 18ms, Average = 16ms PC>ipconfig IP Address......................: 192.168.1.3 Subnet Mask.....................: 255.255.255.0 Default Gateway.................: 192.168.1.1 PC>ping 192.168.1.4 Pinging 192.168.1.4 with 32 bytes of data: Request timed out. Ping statistics for 192.168.1.4: Packets: Sent = 2, Received = 0, Lost = 2 (100% loss), Control-C ^C PC>ping 192.168.1.5 Pinging 192.168.1.5 with 32 bytes of data: Reply from 192.168.1.5: bytes=32 time=16ms TTL=128 Reply from 192.168.1.5: bytes=32 time=15ms TTL=128 Reply from 192.168.1.5: bytes=32 time=16ms TTL=128 Reply from 192.168.1.5: bytes=32 time=15ms TTL=128 Ping statistics for 192.168.1.5: Packets: Sent = 4, Received = 4, Lost = 0 (0% loss), Approximate round trip times in milli-seconds: Minimum = 15ms, Maximum = 16ms, Average = 15ms
感謝各位的閱讀,以上就是“交換機劃分VLAN怎么配置”的內(nèi)容了,經(jīng)過本文的學(xué)習(xí)后,相信大家對交換機劃分VLAN怎么配置這一問題有了更深刻的體會,具體使用情況還需要大家實踐驗證。這里是億速云,小編將為大家推送更多相關(guān)知識點的文章,歡迎關(guān)注!
免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進行舉報,并提供相關(guān)證據(jù),一經(jīng)查實,將立刻刪除涉嫌侵權(quán)內(nèi)容。