交換配置手冊_第1頁
交換配置手冊_第2頁
交換配置手冊_第3頁
交換配置手冊_第4頁
交換配置手冊_第5頁
已閱讀5頁,還剩68頁未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請進(jìn)行舉報或認(rèn)領(lǐng)

文檔簡介

溫州高教網(wǎng)技術(shù)建議書PAGE中望商業(yè)機(jī)器有限公司PAGE3交換機(jī)配置維護(hù)手冊江蘇金智科技股份有限公司PAGEPAGE72江蘇金智科技股份有限公司目錄TOC\o"1-3"\h\z1.連接設(shè)備 41.1.從console連接 41.2.遠(yuǎn)程telnet連接 51.3.遠(yuǎn)程ssh連接 62.基本信息配置 72.1.設(shè)備名稱 72.2.telnet配置 72.3.ssh配置 82.4.密碼配置 92.5.snmp配置 102.6.ntp配置 102.7.logging配置 113.端口 123.1.配置一組端口 123.2.配置二層端口 143.2.1.配置端口速率及雙工模式 143.2.2.端口描述 153.3.配置三層口 163.4.監(jiān)控及維護(hù)端口 183.4.1.監(jiān)控端口和控制器的狀態(tài) 183.4.2.刷新、重置端口及計數(shù)器 203.4.3.關(guān)閉和打開端口 213.5.端口安全 224.VLAN 244.1.理解VLAN 244.2.可支持的VLAN 244.3.配置正常范圍的VLAN 254.3.1.生成、修改以太網(wǎng)VLAN 254.3.2.刪除VLAN 274.3.3.將端口分配給一個VLAN 274.4.配置VLANTrunks 284.4.2.使用STP實現(xiàn)負(fù)載均衡 314.5.Pvlan配置 365.EtherChannel 385.1.三層以太通道配置 385.2.三層物理端口配置 395.3.二層以太通道配置 415.4.配置以太通道負(fù)載均衡 436.SPAN 456.1.理解SPAN 456.2.SPAN會話 456.3.流量類型 456.4.SPAN流量 466.5.配置SPAN 466.5.1.指定源 466.5.2.指定目標(biāo) 476.5.3.監(jiān)視一個trunk接口上的源VLAN 477.VTP 487.1.1.Server模式 487.1.2.transparent模式 487.1.3.Client模式 497.1.4.VTP的裁剪 497.1.5.VTP配置 508.網(wǎng)關(guān) 519.防控 539.1.1.防問控制列表 539.1.2.Mac列表 569.1.3.Vlanmap 5710.交換機(jī)維護(hù) 5810.1.交換機(jī)IOS升級 5810.1.1.TFTP升級IOS 5810.1.2.console升級IOS 5910.2.交換機(jī)密碼恢復(fù) 6500交換機(jī)密碼恢復(fù) 6650交換機(jī)密碼恢復(fù) 62連接設(shè)備從console連接第一次對6000交換機(jī)進(jìn)行配置,必須從console進(jìn)入。首先先將機(jī)器上架,按要求接好電源,然后用隨機(jī)附帶的Console線和轉(zhuǎn)接頭將交換機(jī)的console口與PC的串口相聯(lián),如下:Com口設(shè)置如下:9600baud8databitsNoparity2stopbits檢查電源無誤后,開電,可能會出現(xiàn)類似下面的顯示,按黑粗體字回答:SystemBootstrap,Version6.1(2)Copyright(c)1994-2000byciscoSystems,Inc.c6k_sup2processorwith131072Kbytesofmainmemoryrommon1>bootslot0:c6sup22-jsv-mz.121-5c.EX.binSelfdecompressingtheimage:#############################################################################################################################################################################################################################################################################################################################################################################[OK]RestrictedRightsLegendUse,duplication,ordisclosurebytheGovernmentissubjecttorestrictionsassetforthinsubparagraph(c)oftheCommercialComputerSoftware-RestrictedRightsclauseatFARsec.52.227-19andsubparagraph(c)(1)(ii)oftheRightsinTechnicalDataandComputerSoftwareclauseatDFARSsec.252.227-7013.ciscoSystems,Inc.170WestTasmanDriveSanJoseCiscoInternetworkOperatingSystemSoftwareIOS(tm)MSFC2Software(C6MSFC2-BOOT-M),Version12.1(3a)E4,EARLYDEPLOYMENTRELEASESOFTWARE(fc1)Copyright(c)1986-2000byciscoSystems,Inc.CompiledSat14-Oct-0005:33byeaarmasImagetext-base:0x30008980,data-base:0x303B6000ciscoCat6k-MSFC2(R7000)processorwith114688K/16384Kbytesofmemory.ProcessorboardIDSAD04430J9KR7000CPUat300Mhz,Implementation39,Rev2.1,256KBL2,1024KBL3CacheLastresetfrompower-onX.25software,Version09Kbytesofnon-volatileconfigurationmemory.16384KbytesofFlashinternalSIMM(Sectorsize512K).PressRETURNtogetstarted!SystemConfigurationDialogWouldyouliketoentertheinitialdialog?[yes]:no回答:NO,進(jìn)入手工配置,在Switch>下,輸入enable回車,進(jìn)入全局模式遠(yuǎn)程telnet連接當(dāng)完成交換機(jī)配置,并起給交換機(jī)配置了管理地址,就可以直接采用遠(yuǎn)程telnet登陸進(jìn)入交換機(jī)了。switch#telnetTrying...OpenUserAccessVerificationPassword:switch>enablePassword:switch#遠(yuǎn)程ssh連接當(dāng)完成交換機(jī)配置,并起給交換機(jī)配置了管理地址,就可以直接采用遠(yuǎn)程ssh登陸進(jìn)入交換機(jī)了??梢酝ㄟ^ssh軟件登錄設(shè)備,下面圖為CRT軟件登錄界面基本信息配置設(shè)備名稱命令目的Step

1

configureterminal進(jìn)入配置狀態(tài)Step

2

Switch(config)#hostnameswitch修改設(shè)備名稱Step

3

end退回Step

4

showrunning-config驗證配置Step

5

copyrunning-configstartup-config保存例:Switch#configureterminalSwitch(config)#hostnameswitch3560telnet配置命令目的Step

1

configureterminal進(jìn)入配置狀態(tài)Step

2

Switch(config)#linevty04進(jìn)入線型配置Step

3

Switch(config-line)#passwordcisco配置登錄密碼Step

4

Switch(config-line)#login設(shè)置登錄Step

5

end退回Step

6showrunning-config或者telnet驗證配置Step

7

copyrunning-configstartup-config保存例:Switch#configureterminalSwitch(config)#linevty04Switch(config-line)#passwordciscoSwitch(config-line)#loginssh配置命令目的Step

1

configureterminal進(jìn)入配置狀態(tài)Step

2

Switch(config)#ipdomain-name設(shè)置域名Step

3

Switch(config)#cryptokeygeneratersageneral-keysmodulus1024生產(chǎn)密鑰Step

4

Switch(config)#usernameciscopasswordcisco創(chuàng)建用戶名與密碼Step

5

Switch(config)#linevty04進(jìn)入線型配置Step

6Switch(config-line)#transportinputsshtelnet配置登錄方式Step

7

Switch(config-line)#loginlocal設(shè)置本地登錄Step

8end退回Step

9showrunning-config或者telnet驗證配置Step

10copyrunning-configstartup-config保存例:Switch#configureterminalSwitch(config)#ipdomain-nameSwitch(config)#cryptokeygeneratersageneral-keysmodulus1024Switch(config)#usernameciscopasswordciscoSwitch(config-line)#loginlocalSwitch(config-line)#transportinputsshtelnet密碼配置命令目的Step

1

configureterminal進(jìn)入配置狀態(tài)Step

2

Switch(config)#enablesecretcisco配置密碼Step

3

end退回Step

4

showrunning-config驗證配置Step

5

copyrunning-configstartup-config保存例:Switch#configureterminalSwitch(config)#enablesecretciscosnmp配置命令目的Step

1

configureterminal進(jìn)入配置狀態(tài)Step

2

Switch(config)#snmp-servercommunityciscoRO設(shè)置snmp團(tuán)體只讀密鑰Step

3

Switch(config)#snmp-servercommunityciscorw設(shè)置snmp團(tuán)體讀寫密鑰Step

4

end退回Step

5

showrunning-config驗證配置Step

6copyrunning-configstartup-config保存例:Switch#configureterminalSwitch(config)#snmp-servercommunityciscoROSwitch(config)#snmp-servercommunityciscorwntp配置命令目的Step

1

configureterminal進(jìn)入配置狀態(tài)Step

2

Switch(config)#ntpupdate-calendar設(shè)置ntp定期更新Step

3

Switch(config)#ntpserver設(shè)置ntp服務(wù)器Step

4

end退回Step

5

showrunning-config或者showntpassociations驗證配置Step

6copyrunning-configstartup-config保存例:Switch#configureterminalSwitch(config)#ntpupdate-calendarSwitch(config)#ntpserverlogging配置命令目的Step

1

configureterminal進(jìn)入配置狀態(tài)Step

2

Switch(config)#loggingbuffered8192設(shè)置logging緩存Step

3

Switch(config)#logging設(shè)置logging服務(wù)器Step

4

end退回Step

5

showrunning-config驗證配置Step

6copyrunning-configstartup-config保存例:Switch#configureterminalSwitch(config)#loggingbuffered8192Switch(config)#logging端口配置一組端口命令目的Step

1

configureterminal進(jìn)入配置狀態(tài)Step

2

Switch(config)#interfacerange{vlanvlan_ID-vlan_ID}|{{fastethernet|gigabitethernet}slot/interface-interface}[,{vlanvlan_ID-vlan_ID}{{fastethernet|gigabitethernet}slot/interface-interface}]進(jìn)入組配置狀態(tài)Step

3

可以使用平時的端口配置命令進(jìn)行配置Step

4

end退回Step

5

showinterfaces[interface-id]驗證配置Step

6

copyrunning-configstartup-config保存當(dāng)使用interfacerange命令時有如下的規(guī)則:有效的組范圍:vlan從1到4094fastethernet槽位/{firstport}-{lastport}gigabitethernet槽位/{firstport}-{lastport}端口號之間需要加入空格,如:interfacerangefastethernet2/1–5是有效的,而interfacerangefastethernet2/1-5是無效的.interfacerange命令只能配置已經(jīng)存在的interfacevlan所有在同一組的端口必須是相同類別的。見以下例子:Switch#configureterminalSwitch(config)#interfacerangefastethernet2/1-5Switch(config-if-range)#noshutdownSwitch5(config-if-range)#*Oct608:24:35:%LINK-3-UPDOWN:InterfaceFastEthernet2/1,changedstatetoup*Oct608:24:35:%LINK-3-UPDOWN:InterfaceFastEthernet2/2,changedstatetoup*Oct608:24:35:%LINK-3-UPDOWN:InterfaceFastEthernet2/3,changedstatetoup*Oct608:24:35:%LINK-3-UPDOWN:InterfaceFastEthernet2/4,changedstatetoup*Oct608:24:35:%LINK-3-UPDOWN:InterfaceFastEthernet2/5,changedstatetoup*Oct608:24:36:%LINEPROTO-5-UPDOWN:LineprotocolonInterfaceFastEthernet2/05,changedstatetoup*Oct608:24:36:%LINEPROTO-5-UPDOWN:LineprotocolonInterfaceFastEthernet2/3,changedstatetoup*Oct608:24:36:%LINEPROTO-5-UPDOWN:LineprotocolonInterfaceFastEthernet2/4,changedstatetoup以下的例子顯示使用逗號來配置不同類型端口的組:Switch#configureterminalSwitch(config)#interfacerangefastethernet2/1–3,gigabitethernet3/1-2Switch(config-if-range)#noshutdownSwitch(config-if-range)#*Oct608:29:28:%LINK-3-UPDOWN:InterfaceFastEthernet2/1,changedstatetoup*Oct608:29:28:%LINK-3-UPDOWN:InterfaceFastEthernet2/2,changedstatetoup*Oct608:29:28:%LINK-3-UPDOWN:InterfaceFastEthernet2/3,changedstatetoup*Oct608:29:28:%LINK-3-UPDOWN:InterfaceGigabitEthernet3/1,changedstatetoup*Oct608:29:28:%LINK-3-UPDOWN:InterfaceGigabitEthernet3/2,changedstatetoup*Oct608:29:29:%LINEPROTO-5-UPDOWN:LineprotocolonInterfaceGigabitEthernet0/1,changedstatetoup*Oct608:29:29:%LINEPROTO-5-UPDOWN:LineprotocolonInterfaceFastEthernet0/2,changedstatetoup*Oct608:29:29:%LINEPROTO-5-UPDOWN:LineprotocolonInterfaceFastEthernet0/3,changedstatetoup配置二層端口交換機(jī)的所有端口缺省的端口都是二層口,如果此端口已經(jīng)配置成三層端口的話,則需要用switchport來使其成為二層端口。配置端口速率及雙工模式可以配置快速以太口的速率為10/100Mbps及千兆以太口的速率為10/100/1000-Mbps;但對于光端口則不能配置速率及雙工模式,有時可以配置nonegotiate,當(dāng)需要連聯(lián)接不支持自適應(yīng)的其它千兆端口時命令目的Step

1

configureterminal進(jìn)入配置狀態(tài).Step

2

interfaceinterface-id進(jìn)入端口配置狀態(tài).Step

3

speed{10|100|1000|auto|}設(shè)置端口速率Step

4

duplex{auto|full|half}設(shè)置全雙工或半雙工.Step

5

end退出Step

6

showinterfacesinterface-id顯示有關(guān)配置情況Step

7

copyrunning-configstartup-config保存例:Switch#configureterminalSwitch(config)#interfacefastethernet2/3Switch(config-if)#speed10Switch(config-if)#duplexhalf端口描述端口描述主要是做記錄便于其它維護(hù)人員了解網(wǎng)絡(luò)情況命令目的Step

1

configureterminal進(jìn)入配置模式Step

2

interfaceinterface-id進(jìn)入要加入描述的端口Step

3

descriptionstring加入描述(最多240個字符).Step

4

end退回.Step

5

showinterfacesinterface-iddescriptionorshowrunning-config驗證.Step

6

copyrunning-configstartup-config保存例:Switch#configterminalEnterconfigurationcommands,oneperline.EndwithCNTL/Z.Switch(config)#interfacefastethernet2/4Switch(config-if)#descriptionConnectstoMarketingSwitch(config-if)#endSwitch#showinterfacesfastethernet2/4descriptionInterfaceStatusProtocolDescriptionFa2/4updownConnectstoMarketing配置三層口CatalystSwitch支持三種類型的三層端口:SVIs:即interfacevlan三層以太網(wǎng)通道口(EtherChannel).路由口:路由口是指某一物理端口在端口配置狀態(tài)下用noswitchport命令生成的端口所有的三層都需要IP地址以實現(xiàn)路由交換配置步驟如下:命令目的Step

1

configureterminal進(jìn)入配置狀態(tài)Step

2

interface{{fastethernet|gigabitethernet}interface-id}|{vlanvlan-id}|{port-channelport-channel-number}進(jìn)入端口配置狀態(tài)Step

3

noswitchport把物理端口變成三層口Step

4

ipaddressip_addresssubnet_mask配置IP地址和掩碼Step

5

noshutdown激活端口Step

6

end退出Step

7

showinterfaces[interface-id]showipinterface[interface-id]showrunning-configinterface[interface-id]驗證配置Step

8

copyrunning-configstartup-config保存配置配置舉例如下:Switch#configureterminalEnterconfigurationcommands,oneperline.EndwithCNTL/Z.Switch(config)#interfacegigabitethernet3/2Switch(config-if)#noswitchportSwitch(config-if)#ipaddress1Switch(config-if)#noshutdownSwitch(config-if)#endshowipinterface命令:Switch#showipinterfacegigabitethernet3/2GigabitEthernet3/2isup,lineprotocolisupInternetaddressis1/24Broadcastaddressis55AddressdeterminedbysetupcommandMTUis1500bytesHelperaddressisnotsetDirectedbroadcastforwardingisdisabled<outputtruncated>監(jiān)控及維護(hù)端口監(jiān)控端口和控制器的狀態(tài)主要命令見下表:ShowCommandsforInterfacesCommand目的showinterfaces[typeslot/interface]顯示所有端口或某一端口的狀態(tài)和配置.showinterfacesinterface-idstatus[err-disabled]顯示一系列端口的狀態(tài)或錯誤-關(guān)閉的狀態(tài)showinterfaces[interface-id]switchport顯示二層端口的狀態(tài),可以用來決定此口是否為二層或三層口。showinterfaces[interface-id]description顯示端口描述showprotocols[typeslot/interface]顯示在任何已配置協(xié)議下全局和接口的狀態(tài)showrunning-configinterface[interface-id]顯示當(dāng)前配置中的端口配置情況showversion顯示軟硬件等情況舉例如下:Switch#showinterfacesstatusPortNameStatusVlanDuplexSpeedTypeGi1/1notconnect1autoautoNoGbicGi1/2notconnect1autoautoNoGbicGi5/1notconnect1autoauto10/100/1000-TXGi5/2notconnect1autoauto10/100/1000-TXGi5/3notconnect1autoauto10/100/1000-TXGi5/4notconnect1autoauto10/100/1000-TXFa6/1connected1a-fulla-10010/100BaseTXFa6/2connected2a-fulla-10010/100BaseTXFa6/3notconnect1autoauto10/100BaseTXFa6/4notconnect1autoauto10/100BaseTXSwitch#Thisexampleshowshowtodisplaythestatusofinterfacesinerror-disabledstate:Switch#showinterfacesstatuserr-disabledPortNameStatusReasonFa9/4err-disabledlink-flapinformationalerrormessagewhenthetimerexpiresonacause5d04h:%PM-SP-4-ERR_RECOVER:Attemptingtorecoverfromlink-flaperr-disablestateonFa9/4Switch#Switch#showprotocolsfastethernet5/5FastEthernet5/5isup,lineprotocolisupSwitch#刷新、重置端口及計數(shù)器Clear命令目的clearcounters{typeslot/interface}清除端口計數(shù)器.clearinterface{typeslot/interface}重置某一端口的硬件邏輯clearline[number|console0|vtynumber]重置異步串口的硬件邏輯舉例如下:Switch#clearcountersfastethernet5/5Clear"showinterface"countersonthisinterface[confirm]ySwitch#*Sep3008:42:55:%CLEAR-5-COUNTERS:ClearcounteroninterfaceFastEthernet5/5byvty1(0)可使用clearinterface或clearline命令來清除或重置某一端口或串口,在大部分情況下并不需要這樣做:Switch#clearinterfacefastethernet0/5關(guān)閉和打開端口命令目的Step

1

configureterminal進(jìn)入配置狀態(tài)Step

2

interface{vlanvlan-id}|{{fastethernet|gigabitethernet}slot/port}|{port-channelport-channel-number}選擇要關(guān)閉的端口Step

3

shutdown關(guān)閉Step

4

end退出Step

5

showrunning-config驗證使用noshutdown命令重新打開端口.舉例如下:Switch#configureterminalSwitch(config)#interfacefastethernet2/5Switch(config-if)#shutdownSwitch(config-if)#*Sep3008:33:47:%LINK-5-CHANGED:InterfaceFastEthernet2/5,changedstatetoaadministrativelydownSwitch#configureterminalSwitch(config)#interfacefastethernet2/5Switch(config-if)#noshutdownSwitch(config-if)#*Sep3008:36:00:%LINK-3-UPDOWN:InterfaceFastEthernet2/5,changedstatetoup端口安全端口安全是思科交換機(jī)的特性,主要是端口上做一些限制連接設(shè)備的數(shù)量,這里的數(shù)量是以MAC地址來衡量的。一定程度上是控制病毒爆發(fā)。命令目的Step

1

configureterminal進(jìn)入配置狀態(tài)Step

2

interface{vlanvlan-id}|{{fastethernet|gigabitethernet}slot/port}|{port-channelport-channel-number}選擇要操作的端口Step

3

switchportport-security啟用端口安全Step

4

switchportport-securityviolation{restrict|protect|shutdown}端口安全模式Step

5

switchportport-securitymaximum10設(shè)置最大連接數(shù)量switchportport-securitymac-addresssticky設(shè)置動態(tài)的地址配置switchportport-securitymac-addressxxxx.xxxx.xxxx設(shè)置手動的地址配置Step

6end退出Step

7showrunning-config/showport-security驗證Step

8Copyrunning-configstartup-config保存舉例如下:Switch#configureterminalSwitch(config)#interfaceFastEthernet0/5Switch(config)#switchportaccessvlan82Switch(config)#switchportmodeaccessSwitch(config)#switchportport-securitymaximum10Switch(config)#switchportport-securitySwitch(config)#switchportport-securityviolationrestrictswitch#showport-securityinterfacefastEthernet0/5PortSecurity:EnabledPortStatus:Secure-downViolationMode:RestrictAgingTime:0minsAgingType:AbsoluteSecureStaticAddressAging:DisabledMaximumMACAddresses:10TotalMACAddresses:0ConfiguredMACAddresses:0StickyMACAddresses:0LastSourceAddress:Vlan:0000.0000.0000:0SecurityViolationCount:0VLAN理解VLAN一個VLAN就是一個交換網(wǎng),其邏輯上按功能、項目、應(yīng)用來分而不必考慮用戶的物理位置。任何交換口都可以屬于某一VLAN,IP包、廣播包及組播包均可以發(fā)送或廣播給在此VLAN內(nèi)的最終用戶。每一個VLAN均可看成是一個邏輯網(wǎng)絡(luò),發(fā)往另一VLAN的數(shù)據(jù)包必須由路由器或網(wǎng)橋轉(zhuǎn)發(fā)(如下圖)。由于VLAN被看成是一個邏輯網(wǎng)絡(luò),其具有自己的網(wǎng)橋管理信息庫(MIB)并可支持自己的生成樹

VLAN作為邏輯定義的網(wǎng)絡(luò)示意圖

可支持的VLANCatalystSwitch交換機(jī)將來的版本可支持4096個VLAN,可以分別是VTPclient,server,及transparentmodes.VLAN號可以從1到4094.VLAN號1002到1005保留給令牌環(huán)及FDDIVLAN.VTP只能學(xué)習(xí)到普通范圍的VLAN,即從VLAN到1到1005;VLAN號大于1005屬于擴(kuò)展VLAN,不存在VLAN數(shù)據(jù)庫中。交換機(jī)必須配置成VTP透明模式當(dāng)需要生成VLAN號從1006到4094.配置正常范圍的VLANVLAN號1,1002到1005是自動生成的不能被去掉。生成、修改以太網(wǎng)VLAN命令目的Step

1

configureterminal進(jìn)入配置狀態(tài)Step

2

vlanvlan-id輸入一個VLAN號,然后進(jìn)入vlan配置狀態(tài),可以輸入一個新的VLAN號或舊的來進(jìn)行修改。Step

3

namevlan-name(可選)輸入一個VLAN名,如果沒有配置VLAN名,缺省的名字是VLAN號前面用0填滿的4位數(shù),如VLAN0004是VLAN4的缺省名字Step

4

mtumtu-size(可選)改變MTU大小Step

5

end退出Step

6

showvlan{namevlan-name|idvlan-id}驗證Step

7

copyrunning-configstartupconfig(可選)保存配置用novlanname或novlanmtu退回到缺省的vlan配置狀態(tài)舉例如下:Switch#configureterminalSwitch(config)#vlan20Switch(config-vlan)#nametest20Switch(config-vlan)#end也可以在enable狀態(tài)下,進(jìn)行VLAN配置命令目的Step

1

vlandatabase進(jìn)入VLAN配置狀態(tài)Step

2

vlanvlan-idnamevlan-name加入VLAN號及VLAN名Step

3

vlanvlan-idmtumtu-size(可選)修改MTU大小Step

4

Exit更新VLAN數(shù)據(jù)庫并退出Step

5

showvlan{namevlan-name|idvlan-id}驗證配置Step

6

copyrunning-configstartupconfig保存配置(可選)舉例如下:Switch#vlandatabaseSwitch(vlan)#vlan20nametest20Switch(vlan)#exitAPPLYcompleted.Exiting刪除VLAN當(dāng)刪除一個處于VTP服務(wù)器的交換機(jī)上刪除VLAN時,則此VLAN將在所有相同VTP的交換機(jī)上刪除。當(dāng)在透明模式下刪除時,只在當(dāng)前交換機(jī)上刪除。命令目的Step

1

configureterminal進(jìn)入配置狀態(tài)Step

2

novlanvlan-id刪除某一VLAN.Step

3

end退出Step

4

showvlanbrief驗證Step

5

copyrunning-configstartupconfig保存也可用vlandatabase進(jìn)入VLAN配置狀態(tài),用novlanvlan-id來刪除。將端口分配給一個VLAN命令目的Step

1

configureterminal進(jìn)入配置狀態(tài)Step

2

interfaceslot/port進(jìn)入要分配的端口Step

3

switchportmodeaccess定義二層口Step

4

switchportaccessvlanvlan-id把端口分配給某一VLANStep

5

end退出Step

6

showrunning-configinterfaceslot/port驗證端口的VLAN號Step

7

showinterfacesslot/portswitchport驗證端口的管理模式和VLAN情況Step

8

copyrunning-configstartup-config保存配置使用defaultinterfaceslot/port還原到缺省配置狀態(tài)。舉例如下:Switch#configureterminalEnterconfigurationcommands,oneperline.EndwithCNTL/Z.Switch(config)#interfacefastethernet2/1Switch(config-if)#switchportmodeaccessSwitch(config-if)#switchportaccessvlan2Switch(config-if)#endSwitch#配置VLANTrunks命令目的Step

1

configureterminal進(jìn)入配置狀態(tài)Step

2

interfaceinterface-id進(jìn)入端口配置狀態(tài)Step

3

switchporttrunkencapsulation{isl|dot1q|negotiate}配置trunk封裝ISL或802.1Q或自動協(xié)商Step

4

switchportmode{dynamic{auto|desirable}|trunk}配置二層trunk模式。dynamicauto—自動協(xié)商是否成為trunkdynamicdesirable—把端口設(shè)置為trunk如果對方端口是trunk,desirable,或自動模式trunk—設(shè)置端口為強(qiáng)制的trunk方式,而不理會對方端口是否為trunkStep

5

switchportaccessvlanvlan-id(可選)指定一個缺省VLAN,如果此端口不再是trunkStep

6

switchporttrunknativevlanvlan-id指定802.1QnativeVLAN號Step

7

end退出Step

8

showinterfacesinterface-idswitchport顯示有關(guān)switchport的配置Step

9

showinterfacesinterface-idtrunk顯示有關(guān)trunk的配置Step

10

copyrunning-configstartup-config保存配置舉例:Switch#configureterminalEnterconfigurationcommands,oneperline.EndwithCNTL/Z.Switch(config)#interfacefastetherne2/4Switch(config-if)#switchportmodetrunkSwitch(config-if)#switchporttrunkencapsulationdot1qSwitch(config-if)#end定義trunk允許的VLAN缺省情況下trunk允許所有的VLAN通過??梢允褂胹witchporttrunkallowedvlanremovevlan-list來去掉某一VLANCommandPurposeStep

1

configureterminal進(jìn)入配置狀態(tài)Step

2

interfaceinterface-id進(jìn)入端口配置Step

3

switchportmodetrunk配置二層口為trunkStep

4

switchporttrunkallowedvlan{add|all|except|remove}vlan-list(可選)配置trunk允許的VLAN.使用add,all,except,remove關(guān)健字Step

5

end退出Step

6

showinterfacesinterface-idswitchport驗證VLAN配置情況.Step

7

copyrunning-configstartup-config保存配置回到允許所有VLAN通過時,可用noswitchporttrunkallowedvlan端口配置命令.舉例如下:Switch(config)#interfacefastethernet2/1Switch(config-if)#switchporttrunkallowedvlanremove2Switch(config-if)#end配置NativeVLAN(802.1q)封裝802.1q的trunk端口可以接受帶有標(biāo)簽和不帶標(biāo)簽的數(shù)據(jù)流,交換機(jī)向nativevlan傳送不帶標(biāo)簽的數(shù)據(jù)流,缺省情況下nativeVLAN是1。命令目的Step

1

configureterminal進(jìn)入配置狀態(tài)Step

2

interfaceinterface-id進(jìn)入配置成802.1qtrunk的端口Step

3

switchporttrunknativevlanvlan-id配置nativeVLAN號Step

4

end退出Step

5

showinterfacesinterface-idswitchport驗證nativeVLAN配置Step

6

copyrunning-configstartup-config保存配置使用noswitchporttrunknativevlan端口配置命令回到缺省的狀態(tài)使用STP實現(xiàn)負(fù)載均衡負(fù)載均衡可以使用流量分流到其它平行的trunks上去.交換機(jī)為了避免環(huán)路,STP通常是阻斷所有端口交換機(jī)之間只留一條鏈路。使用負(fù)載均衡后,可以把不同VLAN的流量分配到不同的trunk上??梢酝ㄟ^配置STP端口權(quán)值STP路徑值來實現(xiàn)負(fù)載均衡.如果使用STP端口權(quán)值來配置那么二條負(fù)載均衡的trunk必須聯(lián)同一交換機(jī)上。使用路徑值則即可以聯(lián)相同的交換機(jī)與可以聯(lián)不同的交換機(jī)。使用STP端口權(quán)值的負(fù)載均衡當(dāng)同一臺交換機(jī)的二個口形成環(huán)路時,STP端口權(quán)值用來決定那個口是enable的,那個口是阻斷的??梢酝ㄟ^配置端口權(quán)值來決定二對trunk各走那些VLAN,有較高權(quán)值的端口(數(shù)字較小的)vlan,將處于轉(zhuǎn)發(fā)狀態(tài),同一個VLAN在另一個trunk有較低的權(quán)值(數(shù)字較大)則將處在阻斷狀態(tài)。即同一VLAN只在一個trunk上發(fā)送接受。

基于端口權(quán)值的負(fù)載均衡示意圖trunk1將發(fā)送和接收VLAN8-10的數(shù)據(jù),trunk2將發(fā)送和接收VLAN3-6的數(shù)據(jù)配置如下:CommandPurposeStep

1

configureterminal進(jìn)入Switch

1配置狀態(tài)Step

2

vtpdomaindomain-name配置VTP域Step

3

vtpmodeserver將Switch1配置成VTPserver.Step

4

end退出Step

5

showvtpstatus驗證VTP的配置Step

6

showvlan驗證VLANStep

7

configureterminal進(jìn)入配置狀態(tài)Step

8

interfacefastethernet0/1進(jìn)入F0/1端口Step

9

switchporttrunkencapsulation{isl|dot1q|negotiate}配置trunk封裝Step

10

switchportmodetrunk配置成trunkStep

11

end退出Step

12

showinterfacesfastethernet0/1switchport驗證VLAN配置Step

13

在switch1上的F0/2上重復(fù)7到11步驟Step

14

在Switch2的F0/1,F0/2上重復(fù)7到11步驟。Step

15

showvlan當(dāng)trunk已經(jīng)起來,在switch2上驗證已經(jīng)學(xué)到相關(guān)的vlan配置Step

16

configureterminal在Switch1上進(jìn)入配置狀態(tài)Step

17

interfacefastethernet0/1進(jìn)入要配置的端口Step

18

spanning-treevlan8port-priority10將端口權(quán)值10賦與VLAN8.Step

19

spanning-treevlan9port-priority10將端口權(quán)值10賦與VLAN9.Step

20

spanning-treevlan10port-priority10將端口權(quán)值10賦與VLAN10.Step

21

exit退回.Step

22

interfacefastethernet0/2進(jìn)入F0/2Step

23

spanning-treevlan3port-priority10將端口權(quán)值10賦與VLAN3.Step

24

spanning-treevlan4port-priority10將端口權(quán)值10賦與VLAN4.Step

25

spanning-treevlan5port-priority10將端口權(quán)值10賦與VLAN5.Step

26

spanning-treevlan6port-priority10將端口權(quán)值10賦與VLAN10.Step

27

end退出Step

28

showrunning-config驗證配置Step

29

copyrunning-configstartup-config保存配置配置STP路徑值的負(fù)載均衡也可以通過配置配置STP路徑值來實現(xiàn)負(fù)載均衡,如下圖所示Trunk1走VLAN8-10,Trunk2走VLAN2-4命令目的Step

1

configureterminal進(jìn)入Switch

1配置狀態(tài)Step

2

interfacefastethernet0/1進(jìn)入F0/1Step

3

switchporttrunkencapsulation

{isl|dot1q|negotiate}配置封裝Step

4

switchportmodetrunk配置Trunk,缺省是ISL封裝Step

5

exit退回Step

6

在F0/2口上重復(fù)2-4步驟Step

7

end退出Step

8

showrunning-config驗證配置Step

9

showvlan驗證switch1已經(jīng)學(xué)到VlanStep

10

configureterminal進(jìn)入配置狀態(tài)Step

11

interfacefastethernet0/1進(jìn)入F0/1Step

12

spanning-treevlan2cost30設(shè)置Vlan2生成樹路徑值為30Step

13

spanning-treevlan3cost30設(shè)置Vlan3生成樹路徑值為30Step

14

spanning-treevlan4cost30設(shè)置Vlan4生成樹路徑值為30Step

15

end退出Step

16

在switch1的F0/2上重復(fù)9-11步驟設(shè)置VLAN8,9,10生成樹路徑值為30Step

17

exit退出Step

18

showrunning-config驗證配置Step

19

copyrunning-configstartup-config保存配置Pvlan配置介紹在PrivateVLAN的概念中,交換機(jī)端口有三種類型:Isolatedport,Communityport,Promiscuousport;它們分別對應(yīng)不同的VLAN類型:Isolatedport屬于IsolatedPVLAN,Communityport屬于CommunityPVLAN,而代表一個PrivateVLAN整體的是PrimaryVLAN,前面兩類VLAN需要和它綁定在一起,同時它還包括Promiscuousport。在IsolatedPVLAN中,Isolatedport只能和Promiscuousport通信,彼此不能交換流量;在CommunityPVLAN中,Communityport不僅可以和Promiscuousport通信,而且彼此也可以交換流量。Promiscuousport與路由器或第3層交換機(jī)接口相連,它收到的流量可以發(fā)往Isolatedport和Communityport。PVLAN的應(yīng)用對于保證接入網(wǎng)絡(luò)的數(shù)據(jù)通信的安全性是非常有效的,PVLAN功能可以保證同一個VLAN中的各個端口相互之間不能通信,但可以穿過Trunk端口。這樣即使同一VLAN中的用戶,相互之間也不會受到廣播的影響。PVALN配置Pvlan主要用于對同于廣播域中的主機(jī),進(jìn)行隔離,提供網(wǎng)絡(luò)安全性。每個PVLAN包括2中VLAN:主VLAN(primary)和輔助VALN(secondary)SecondaryVLAN分為:隔離VLAN(isolated)和團(tuán)體VLAN(community)PVLAN中有2中接口類型:主機(jī)端口(hostport),和混雜端口(promiscuousport)配置實例:如圖配置后,主機(jī)1,2,3,4都可以訪問外網(wǎng),主機(jī)3,4可以互訪,而主機(jī)1,2,不能訪問局域網(wǎng)的主機(jī),只能訪問外網(wǎng)。配置步驟如下:1.交換機(jī)VTP設(shè)為transparent模式,Switch(config)#vtpmodetransparent2.如圖創(chuàng)建VLAN100,200,201,關(guān)聯(lián)VALNSwitchA(config)#vlan100SwitchA(config-vlan)#private-vlanprimary配置主VLAN100SwitchA(config)#vlan200SwitchA(config-vlan)#private-vlanisolated配置隔離VLAN200SwitchA(config)#vlan201SwitchA(config-vlan)#private-vlancommunity配置團(tuán)體VLAN201SwitchA(config)#vlan100SwitchA(config-vlan)#private-vlanassociationadd200,201使主VLAN關(guān)聯(lián)輔助VLAN3.配置接口SwitchA(config)#interfacerangegig1/0/40-41SwitchA(config-if)#switchportmodeprivate-vlanhostSwitchA(config-if)#switchportprivate-vlanhost-association100200把G1/0/40和G1/0/41劃入主機(jī)接口,且關(guān)聯(lián)到isolatedVLAN200SwitchA(config)#interfacerangegig1/0/42-43SwitchA(config-if)#switchportmodeprivate-vlanhostSwitchA(config-if)#switchportprivate-vlanhost-association100201把G1/0/42和G1/0/41劃入主機(jī)接口,且關(guān)聯(lián)到communityVLAN201SwitchA(config)#interfacerangegig1/0/44SwitchA(config-if)#switchportmodeprivate-vlanpromiscuousSwitchA(config-if)#switchportpricate-vlanmapping100200,201配置G1/0/44劃入為混雜接口,切

溫馨提示

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

最新文檔

評論

0/150

提交評論