新聞中心
交換技術(shù)之 Valn 的簡單理解及不同Vlan互通
10年積累的成都網(wǎng)站制作、網(wǎng)站設(shè)計經(jīng)驗,可以快速應(yīng)對客戶對網(wǎng)站的新想法和需求。提供各種問題對應(yīng)的解決方案。讓選擇我們的客戶得到更好、更有力的網(wǎng)絡(luò)服務(wù)。我雖然不認(rèn)識你,你也不認(rèn)識我。但先網(wǎng)站設(shè)計后付款的網(wǎng)站建設(shè)流程,更有通化免費網(wǎng)站建設(shè)讓你可以放心的選擇與我們合作。
一、Vlan解決的問題
解決同一個網(wǎng)段間廣播數(shù)據(jù)的隔離
擴展:借助三層設(shè)備可以即隔離了二層同網(wǎng)段的廣播數(shù)據(jù),也可以實現(xiàn)不同網(wǎng)段的鏈接互通。
二、Vlan簡單理解
在一個交換機上劃分了好幾個區(qū)域,每個區(qū)域都是一個相互隔離的容器(隔離的內(nèi)容就是網(wǎng)絡(luò)中的廣播數(shù)據(jù))。
不同的Vlan之間互通,一般是指不同的網(wǎng)段之間互通。既然網(wǎng)段都不一樣了,想要通信的那就在‘二層’無法做到,就需要‘三層’的路由技術(shù)(即需要‘網(wǎng)關(guān)’:門口管理員,想去那里和我說下,我看你能去不,哈哈哈)。
同一個Vlan分別在不同的交換機上的互通,就需要借助 trunk(中繼技術(shù))來實現(xiàn)。個人理解:就是在交換機 1上有10個口歸歸Vlan1管理 ,現(xiàn)在想擴展地盤了,連交換機2上邊的 Vlan1 的口子 也管理起來。
不同的Vlan之間互通的另一種方式是,用3層設(shè)備路由器去做‘看門的人 ’(網(wǎng)關(guān))。
三、模擬器實驗一
目的:通過Vlan 將同一個網(wǎng)段的廣播域隔離,即同一個網(wǎng)段的兩個IP ,當(dāng)屬于不同Vlan的時候不能互通。
拓?fù)洌?/p>
交換機配置:
Switch#show vlan br VLAN Name Status Ports ---- -------------------------------- --------- ------------------------------- 1 default active 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, Fa0/24 Gig1/1, Gig1/2 10 VLAN0010 active Fa0/1, Fa0/2 40 VLAN0040 active Fa0/4 1002 fddi-default active 1003 token-ring-default active 1004 fddinet-default active 1005 trnet-default active Switch#
四、模擬器實驗二
目的:通過3層交換機的路由功能實現(xiàn)不同網(wǎng)段互通
拓?fù)洌?/p>
交換機配置:
S1#show vlan br VLAN Name Status Ports ---- -------------------------------- --------- ------------------------------- 1 default active Fa2/1, Fa3/1, Fa4/1, Fa5/1 10 VLAN0010 active Fa0/1 1002 fddi-default active 1003 token-ring-default active 1004 fddinet-default active 1005 trnet-default active S1#
S2#show vlan brief VLAN Name Status Ports ---- -------------------------------- --------- ------------------------------- 1 default active Fa2/1, Fa3/1, Fa4/1, Fa5/1 20 VLAN0020 active Fa0/1 1002 fddi-default active 1003 token-ring-default active 1004 fddinet-default active 1005 trnet-default active S2#
S3#show vlan brief 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, Fa0/24, Gig0/1, Gig0/2 10 VLAN0010 active 20 VLAN0020 active 1002 fddi-default active 1003 token-ring-default active 1004 fddinet-default active 1005 trnet-default active S3#
S3#show interfaces trunk Port Mode Encapsulation Status Native vlan Fa0/1 desirable n-802.1q trunking 1 Fa0/2 auto n-802.1q trunking 1 Port Vlans allowed on trunk Fa0/1 1-1005 Fa0/2 1-1005 Port Vlans allowed and active in management domain Fa0/1 1,10,20 Fa0/2 1,10,20 Port Vlans in spanning tree forwarding state and not pruned Fa0/1 1,10,20 Fa0/2 1,10,20 S3#
S3#show ip interface brief Interface IP-Address OK? Method Status Protocol FastEthernet0/1 unassigned YES unset up up FastEthernet0/2 unassigned YES unset up up FastEthernet0/3 unassigned YES unset down down . . Vlan1 unassigned YES unset administratively down down Vlan10 192.168.1.254 YES manual up up Vlan20 192.168.2.254 YES manual up up S3#
五、模擬器實驗三
目的:通過路由器實現(xiàn)不同網(wǎng)段互通,即單臂路由或一根棍路由。
拓?fù)洌?/p>
交換機配置:
Switch#show vlan br VLAN Name Status Ports ---- -------------------------------- --------- ------------------------------- 1 default active 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 Fa0/24, Gig1/1, Gig1/2 10 VLAN0010 active Fa0/1 20 VLAN0020 active Fa0/2 1002 fddi-default active 1003 token-ring-default active 1004 fddinet-default active 1005 trnet-default active Switch#
路由器配置
Router#show ip route Codes: C - connected, S - static, I - IGRP, R - RIP, M - mobile, B - BGP D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2 E1 - OSPF external type 1, E2 - OSPF external type 2, E - EGP i - IS-IS, L1 - IS-IS level-1, L2 - IS-IS level-2, ia - IS-IS inter area * - candidate default, U - per-user static route, o - ODR P - periodic downloaded static route Gateway of last resort is not set C 192.168.1.0/24 is directly connected, FastEthernet0/0.1 C 192.168.2.0/24 is directly connected, FastEthernet0/0.2 Router#
Router#show ip interface brief Interface IP-Address OK? Method Status Protocol FastEthernet0/0 unassigned YES unset up up FastEthernet0/0.1 192.168.1.254 YES manual up up FastEthernet0/0.2 192.168.2.254 YES manual up up FastEthernet1/0 unassigned YES unset administratively down down Router#
Router#show running-config Building configuration... Current configuration : 800 bytes ! interface FastEthernet0/0 no ip address duplex auto speed auto ! interface FastEthernet0/0.1 encapsulation dot1Q 10 ip address 192.168.1.254 255.255.255.0 ! interface FastEthernet0/0.2 encapsulation dot1Q 20 ip address 192.168.2.254 255.255.255.0 ! Router#
六、總結(jié):
可以利用Vlan將1臺交換機劃分出不同Vlan,實現(xiàn)虛擬出多臺交換機的樣子
可以利用Vlan的三層交換功能實現(xiàn)不同Vlan(也是不同網(wǎng)段)之間互通,也可以通過將路由器的子接口封裝(encapsulation)成dot1Q(即Vlan)實現(xiàn)。
附件有Cisco PT 實驗?zāi)_本
#
網(wǎng)頁名稱:交換技術(shù)之Vlan的簡單理解及不同Vlan互通
轉(zhuǎn)載源于:http://www.dlmjj.cn/article/ieshic.html