《CCIE路由和交换认证考试指南(第5版) (第1卷)》——1.6节虚拟交换系统
本節(jié)書摘來自異步社區(qū)《CCIE路由和交換認(rèn)證考試指南(第5版) (第1卷)》一書中的第1章,第1.6節(jié)虛擬交換系統(tǒng),作者 【美】Narbik Kocharians(那比克 科查理安) , 【斯洛伐克】Peter Paluch(彼得 派拉奇),更多章節(jié)內(nèi)容可以訪問云棲社區(qū)“異步社區(qū)”公眾號(hào)查看
1.6 虛擬交換系統(tǒng)
在所有現(xiàn)代網(wǎng)絡(luò)中,我們發(fā)現(xiàn)最重要的事情是創(chuàng)建一個(gè)能夠?yàn)樵O(shè)備、連接和服務(wù),提供高可用性和高可靠性的拓?fù)洹榱伺渲眠@些特性和功能,網(wǎng)絡(luò)工程師通常使用的方法是創(chuàng)建冗余的二層交換環(huán)境,比如使用冗余的一對(duì)或多條鏈路來提供多路徑。圖1-10展示了常見的交換網(wǎng)絡(luò)配置。
可以看出,這些冗余網(wǎng)絡(luò)設(shè)備和鏈路的應(yīng)用和配置會(huì)快速提高網(wǎng)絡(luò)設(shè)計(jì)和操作的復(fù)雜性。有一個(gè)方法可以解決這種復(fù)雜性設(shè)計(jì),就是部署虛擬交換系統(tǒng)。這項(xiàng)技術(shù)能夠?qū)嶋H地簡化網(wǎng)絡(luò),因?yàn)樗鼫p少了網(wǎng)絡(luò)設(shè)備的數(shù)量,工程師無需再對(duì)冗余的交換機(jī)和鏈路進(jìn)行復(fù)雜管理了。運(yùn)行IOS-XE(在本章后文“IOS-XE”小節(jié)中詳細(xì)介紹)的Cisco Catalyst 6500和4500系列交換機(jī)能夠支持該特性。
在本節(jié)的討論中,我們使用VSS(虛擬交換系統(tǒng))將一對(duì)Catalyst 4500或4500-X系列交換機(jī)合并到一臺(tái)網(wǎng)絡(luò)設(shè)備中。VSS管理冗余鏈路的方式,從外部設(shè)備看來,就像是管理單個(gè)Port-Channel。
這種部署方式簡化了網(wǎng)絡(luò)配置和操作,因?yàn)樗粌H減少了三層路由鄰居的整體數(shù)量,同時(shí)還提供了無環(huán)的二層拓?fù)洹?/p>
1.6.1 虛擬交換系統(tǒng)
想要部署VSS最基本的原因是想要將一對(duì)交換機(jī)在邏輯上合并到一臺(tái)網(wǎng)絡(luò)設(shè)備中,這一點(diǎn)之前已經(jīng)提過了。為了更好地理解其中的過程,我們需要進(jìn)一步查看這個(gè)特性為邏輯拓?fù)渥瞿男┦虑椤Ee例來說,位于網(wǎng)絡(luò)中分布層的VSS會(huì)與低于自己的接入層和高于自己的核心層進(jìn)行通信,就好像它是一臺(tái)交換機(jī),如圖1-11所示。
從圖1-11中可以看出,接入層的每臺(tái)交換機(jī)各自使用一個(gè)邏輯的Port-Channel連接了兩臺(tái)VSS交換機(jī),因?yàn)閷?duì)于外部設(shè)備來說,VSS看起來就是一臺(tái)單獨(dú)的交換機(jī)——或者說邏輯交換機(jī)。VSS設(shè)備也做出了相應(yīng)的改進(jìn),比如它們可以在Port-Channel上管理冗余特性和負(fù)載均衡特性,以此來掌控鏈路的行為,即使它實(shí)際上連接了兩臺(tái)設(shè)備。雖然我們傾向于把VSS配置中的這些交換機(jī)看作是獨(dú)立的設(shè)備,但這么說并不準(zhǔn)確。雖然這些交換機(jī)在物理上是相互分離的實(shí)體,但從操作和控制平面看來,它們實(shí)際上是一個(gè)單元。這種改進(jìn)提供了無環(huán)的二層網(wǎng)絡(luò)拓?fù)洹S捎跍p少了網(wǎng)絡(luò)中路由對(duì)等體的數(shù)量,因此VSS也簡化了三層網(wǎng)絡(luò)拓?fù)?#xff0c;從而也將網(wǎng)絡(luò)的簡單化擴(kuò)展到了數(shù)據(jù)平面中。
1.6.2 VSS主用和VSS備用交換機(jī)
前文中討論的更新,提到了VSS中每臺(tái)設(shè)備的操作,相關(guān)內(nèi)容也可以延伸到“基于角色”的行為。在VSS的環(huán)境中,每臺(tái)獨(dú)立的交換機(jī)首先會(huì)為自己爭(zhēng)取到一個(gè)VSS進(jìn)程中的特定工作角色,然后根據(jù)自己的角色作出相應(yīng)行為。每一次工程師創(chuàng)建或重啟VSS時(shí),對(duì)等體交換機(jī)之間都會(huì)協(xié)商各自的角色。最終結(jié)果就是一臺(tái)設(shè)備成為VSS主用(Active)交換機(jī),另一臺(tái)設(shè)備成為VSS備用(Standby)交換機(jī)。
VSS主用交換機(jī)負(fù)責(zé)控制VSS,并在兩臺(tái)交換機(jī)上為交換模塊運(yùn)行二層和三層控制協(xié)議。VSS主用交換機(jī)也為VSS提供管理功能,比如模塊的在線插拔(OIR)操作和接口的控制。
VSS主用和備用交換機(jī)在自己本地的接口上,為入向數(shù)據(jù)流量執(zhí)行數(shù)據(jù)包轉(zhuǎn)發(fā)。但VSS備用交換機(jī)會(huì)把所有控制流量發(fā)送到VSS主用交換機(jī),讓主用交換機(jī)進(jìn)行 處理。
1.6.3 虛擬交換鏈路
前文提到過,為了使VSS中的兩臺(tái)交換機(jī)看起來像是一臺(tái)網(wǎng)絡(luò)設(shè)備,它們之間需要共享控制信息和數(shù)據(jù)流量;為了實(shí)現(xiàn)這種共享,它們需要具備各自的角色以及諸多不同用途的機(jī)制。在這些不同用途的機(jī)制設(shè)計(jì)中,最重要的是連接兩臺(tái)VSS設(shè)備的虛擬交換鏈路。
虛擬交換鏈路(VSL)是一條特殊的鏈路,它負(fù)責(zé)承載VSS兩臺(tái)交換機(jī)之間的控制流量和數(shù)據(jù)流量,詳見圖1-12。VSL通常被配置為EtherChannel,最多支持8條鏈路捆綁在一起。并不是只有這種特殊用途的鏈路能夠在VSS對(duì)等體之間提供通信路徑,但它的優(yōu)勢(shì)是能夠?yàn)榭刂坪凸芾砥矫娴牧髁刻峁└叩膬?yōu)先級(jí),使其優(yōu)先于數(shù)據(jù)流量,從而保障控制和管理消息從不會(huì)被丟棄。多條VSL鏈路之間的數(shù)據(jù)流量負(fù)載均衡可以通過默認(rèn)的方法實(shí)現(xiàn),也可以通過配置EtherChannel負(fù)載均衡算法來實(shí)現(xiàn)。
1.6.4 多機(jī)框EtherChannel(MEC)
讀者從前文中已經(jīng)可以看出EtherChannel的重要性了。EtherChannel(也可以稱為Port-Channel)是兩條或多條物理鏈路的集合,將這些物理鏈路合并成為一條邏輯鏈路。EtherChannel作為一個(gè)單獨(dú)的邏輯實(shí)體,交換機(jī)可以在它之上運(yùn)行二層協(xié)議。這一概念也使另一些協(xié)議進(jìn)行了相應(yīng)調(diào)整,比如生成樹協(xié)議(STP),STP通常會(huì)阻塞設(shè)備之間的冗余鏈路,以防止產(chǎn)生交換環(huán)路。但我們這里所描述的概念是一種特殊類型的Port-Channel,它不僅可以建立在兩臺(tái)物理設(shè)備之間,還可以建立在多個(gè)機(jī)框(Chassis)之間;提供了普通EtherChannel環(huán)境中無法提供的硬件或設(shè)備故障倒換功能。這是因?yàn)閂SS能夠創(chuàng)建MEC,而MEC這個(gè)EtherChannel中的成員接口可以分布在多臺(tái)VSS成員交換機(jī)上。非VSS交換機(jī)連接到VSS的話,MEC在它看來就是標(biāo)準(zhǔn)的EtherChannel,非VSS交換機(jī)可以使用雙站(Dual-Homed)的方式進(jìn)行連接。流經(jīng)MEC的流量可以在VSS成員交換機(jī)中實(shí)現(xiàn)負(fù)載均衡,這與標(biāo)準(zhǔn)EtherChannel非常類似。Cisco MEC支持動(dòng)態(tài)EtherChannel協(xié)議,包括工業(yè)標(biāo)準(zhǔn)的LACP(鏈路匯聚控制協(xié)議)和Cisco私有的PAgP(端口匯聚協(xié)議),MEC還支持靜態(tài)EtherChannel配置。總的來說,VSS最多可以支持256條EtherChannel,這一數(shù)量限制是普通EtherChannel和MEC的總和。
1.6.5 基本VSS配置
為了創(chuàng)建VSS所需的最基本配置,首先需要在VSS的兩臺(tái)設(shè)備上創(chuàng)建相同的虛擬交換域。在VSS的兩臺(tái)交換機(jī)上,這個(gè)交換域體現(xiàn)為一個(gè)編號(hào),這個(gè)編號(hào)必須在1~255的范圍內(nèi)。在分配好域編號(hào)后,工程是必須將其中一臺(tái)路由器配置為switch 1,另一臺(tái)交換機(jī)配置為switch 2,如例1-8所示。
例1-8 分配虛擬交換域和交換機(jī)號(hào)碼
SW1# conf t Enter configuration commands, one per line. End with CNTL/Z. SW1(config)# switch virtual domain 10 Domain ID 10 config will take effect only after the exec command 'switch convert mode virtual' is issued SW1(config-vs-domain)# switch 1 SW1(config-vs-domain)# exit SW1(config)#SW2# conf t Enter configuration commands, one per line. End with CNTL/Z. SW2(config)# switch virtual domain 10 Domain ID 10 config will take effect only after the exec command 'switch convert mode virtual' is issued SW2(config-vs-domain)# switch 2 SW2(config-vs-domain)# exit SW2(config)# 接下來,工程師需要?jiǎng)?chuàng)建VSL,這需要在每臺(tái)交換機(jī)上都創(chuàng)建一個(gè)唯一的Port-Channel,詳見例1-9。在配置過程中,兩個(gè)Port-Channel都是在VSS主動(dòng)交換機(jī)上建立的。如果VSS備用交換機(jī)的VSL Port-Channel號(hào)碼已經(jīng)用于了其他用途,VSS將會(huì)啟動(dòng)為路由處理器冗余模式。為了避免這種情況,要確保使用的Port-Channel號(hào)碼在兩臺(tái)交換機(jī)上都是可用的。例1-9 配置VSL Port-ChannelSW1(config)# int port-channel 5 SW1(config-if)# switchport SW1(config-if)# switch virtual link 1 SW1(config-if)# no shut SW1(config-if)# exit *Jan 24 05:19:57.092: %SPANTREE-6-PORTDEL_ALL_VLANS: Port-channel5 deleted from allVlansSW2(config)# int port-channel 10 SW2(config-if)# switchport SW2(config-if)# switch virtual link 2 SW2(config-if)# no shut SW2(config-if)# exit SW2(config)# *Jan 24 05:14:17.273: %SPANTREE-6-PORTDEL_ALL_VLANS: Port-channel10 deleted fromall Vlans 現(xiàn)在已經(jīng)配置好Port-Channel接口了,接下來需要將VSL物理成員接口添加到相應(yīng)的Port-Channel中。在例1-10中,SW1上的接口GE 7/3和7/4將要與SW2上的接口GE 4/45和4/46連接在一起。例1-10 配置VSL接口SW1(config)# int range gig7/3 - 4 SW1(config-if-range)# switchport mode trunk SW1(config-if-range)# channel-group 5 mode on WARNING: Interface GigabitEthernet7/3 placed in restricted config mode. Allextraneous configs removed! WARNING: Interface GigabitEthernet7/4 placed in restricted config mode. Allextraneous configs removed! SW1(config-if-range)# exitSW2(config)# int range gig4/45 - 46 SW2(config-if-range)# switchport mode trunk SW2(config-if-range)# channel-group 10 mode on WARNING: Interface GigabitEthernet4/45 placed in restricted config mode. Allextraneous configs removed! WARNING: Interface GigabitEthernet4/46 placed in restricted config mode. Allextraneous configs removed! SW2(config-if-range)# exit 注釋: 在使用channel-group命令將接口放入VSL Port-Channel后,接口會(huì)進(jìn)入“notconnect(無連接)”狀態(tài)。接口狀態(tài)會(huì)顯示為“up”,但線路協(xié)議狀態(tài)將顯示為“down”。在交換機(jī)重啟之前,接口將一直為up/down (notconnect)狀態(tài)。 接著工程師需要在SW1上使用命令switch convert mode virtual,完成交換機(jī)轉(zhuǎn)換過程。系統(tǒng)會(huì)提示工程師確認(rèn)這一行為,這時(shí)輸入yes,詳見例1-11。這時(shí)系統(tǒng)會(huì)創(chuàng)建一個(gè)轉(zhuǎn)換配置文件,并存入系統(tǒng)的bootflash中。在兩臺(tái)交換機(jī)上都確認(rèn)完畢后,運(yùn)行配置文件(running-config)會(huì)被保存為啟動(dòng)配置文件(startup-config),并且交換機(jī)會(huì)重啟。重啟后,交換機(jī)就進(jìn)入了虛擬交換模式。例1-11 將交換機(jī)轉(zhuǎn)換為虛擬交換模式SW1# switch convert mode virtualThis command will convert all interface names to naming convention "interface-type switch-number/slot/port", save the running config to startup-config andreload the switch. Do you want to proceed? [yes/no]: yes Converting interface names Building configuration... Compressed configuration from 6551 bytes to 2893 bytes[OK] Saving converted configuration to bootflash: ... Destination filename [startup-config.converted_vs-20130124-062921]? Please stand by while rebooting the system... Restarting system.Rommon (G) Signature verification PASSED Rommon (P) Signature verification PASSED FPGA (P) Signature verification PASSEDSimilarly you need to enter the "switch convert mode virtual" command on Switch 2for converting to Virtual Switch Mode.SW2# switch convert mode virtualThis command will convert all interface names to naming convention "interface-type switch-number/slot/port", save the running config to startup-config and reload the switch. Do you want to proceed? [yes/no]: yes Converting interface names Building configuration... Compressed configuration from 6027 bytes to 2774 bytes[OK] Saving converted configuration to bootflash: ... Destination filename [startup-config.converted_vs-20130124-052526]? Please stand by while rebooting the system... Restarting system.Rommon (G) Signature verification PASSED Rommon (P) Signature verification PASSED FPGA (P) Signature verification PASSED************************************************************ * * * Welcome to Rom Monitor for WS-X45-SUP7-E System. * * Copyright (c) 2008-2012 by Cisco Systems, Inc. * * All rights reserved. * * * ************************************************************1.6.6 VSS檢查過程
工程師可以使用簡單的show命令來查看與特定VSS對(duì)相關(guān)的VSS配置信息,通過命令show switch virtual可以查看每臺(tái)交換機(jī)的交換機(jī)號(hào)碼和角色,詳見例1-12。
例1-12 查看虛擬交換域編號(hào)
SW1# sh switch virtualExecuting the command on VSS member switch role = VSS Active, id = 1Switch mode : Virtual Switch Virtual switch domain number : 10 Local switch number : 1 Local switch operational role : Virtual Switch Active Peer switch number : 2 Peer switch operational role : Virtual Switch StandbyExecuting the command on VSS member switch role = VSS Standby, id = 2Switch mode : Virtual Switch Virtual switch domain number : 10 Local switch number : 2 Local switch operational role : Virtual Switch Standby Peer switch number : 1 Peer switch operational role : Virtual Switch Active 要想讓VSS正常運(yùn)行,最重要的一點(diǎn)是確保一臺(tái)交換機(jī)是主用交換機(jī),另一臺(tái)是備用交換機(jī)。備用交換機(jī)的控制模式應(yīng)該與例1-13所示相同。例1-13 備用交換機(jī)的控制模式SW2-standby> Standby console disabled正如理論部分所討論的,對(duì)于VSS來說,有很多角色和配置要求。工程師可以使用命令show switch virtual role來查看VSS中每臺(tái)交換機(jī)的變量。例1-14展示了使用這條命令輸出的類型和詳細(xì)信息。
工程師可以使用命令show switch virtual link來查看有關(guān)VSL的信息,詳見例1-15。
例1-14 虛擬角色分配和優(yōu)先級(jí)
SW1# sh switch virtual role Executing the command on VSS member switch role = VSS Active, id = 1 RRP information for Instance 1 -------------------------------------------------------------------- Valid Flags Peer Preferred ReservedCount Peer Peer -------------------------------------------------------------------- TRUE V 1 1 1 Switch Switch Status Preempt Priority Role Local RemoteNumber Oper(Conf) Oper(Conf) SID SID -------------------------------------------------------------------- LOCAL 1 UP FALSE(N ) 100(100) ACTIVE 0 0 REMOTE 2 UP FALSE(N ) 100(100) STANDBY 6834 6152Peer 0 represents the local switchFlags : V - Valid In dual-active recovery mode: NoExecuting the command on VSS member switch role = VSS Standby, id = 2RRP information for Instance 2-------------------------------------------------------------------- Valid Flags Peer Preferred ReservedCount Peer Peer-------------------------------------------------------------------- TRUE V 1 1 1Switch Switch Status Preempt Priority Role Local RemoteNumber Oper(Conf) Oper(Conf) SID SID -------------------------------------------------------------------- LOCAL 2 UP FALSE(N ) 100(100) STANDBY 0 0 REMOTE 1 UP FALSE(N ) 100(100) ACTIVE 6152 6834Peer 0 represents the local switchFlags : V - Valid In dual-active recovery mode: No 例1-15 虛擬交換鏈路詳情SW1# sh switch virtual linkExecuting the command on VSS member switch role = VSS Active, id = 1VSL Status : UP VSL Uptime : 3 minutes VSL Control Link : Gi1/7/4Executing the command on VSS member switch role = VSS Standby, id = 2VSL Status : UP VSL Uptime : 3 minutes VSL Control Link : Gi2/4/45除此之外,工程師還可以使用命令show switch virtual link port-channel來查看有關(guān)VSL Port-Channel配置的信息,詳見例1-16。
例1-16 查看VSL Port-Channel
SW1# sh switch virtual link port-channelExecuting the command on VSS member switch role = VSS Active, id = 1Flags: D - dow- P - bundled in port-channelI - stand-alone s - suspendedH - Hot-standby (LACP only)R - Layer3 S - Layer2U - in use N - not in use, no aggregationf - failed to allocate aggregatorM - not in use, no aggregation due to minimum links not metm - not in use, port not aggregated due to minimum links not metu - unsuitable for bundlingd - default portw - waiting to be aggregatedGroup Port-channel Protocol Ports ------+-------------+---------+------------------- 5 Po5(SU) - Gi1/7/3(P) Gi1/7/4(P) 10 Po10(SU) - Gi2/4/45(P) Gi2/4/46(P)Executing the command on VSS member switch role = VSS Standby, id = 2Flags: D - dow- P - bundled in port-channelI - stand-alone s - suspendedH - Hot-standby (LACP only)R - Layer3 S - Layer2U - in use N - not in use, no aggregationf - failed to allocate aggregatorM - not in use, no aggregation due to minimum links not metm - not in use, port not aggregated due to minimum links not metu - unsuitable for bundlingd - default portw - waiting to be aggregatedGroup Port-channel Protocol Ports ------+-------------+-----------+------------------- 5 Po5(SU) - Gi1/7/3(P) Gi1/7/4(P) 10 Po10(SU) - Gi2/4/45(P) Gi2/4/46(P)SW1#總結(jié)
以上是生活随笔為你收集整理的《CCIE路由和交换认证考试指南(第5版) (第1卷)》——1.6节虚拟交换系统的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 梦到逃跑是什么意思
- 下一篇: 《软件工程(第4版?修订版)》—第1章1