思科交換機(jī)配置命令_第1頁(yè)
思科交換機(jī)配置命令_第2頁(yè)
思科交換機(jī)配置命令_第3頁(yè)
思科交換機(jī)配置命令_第4頁(yè)
思科交換機(jī)配置命令_第5頁(yè)
已閱讀5頁(yè),還剩3頁(yè)未讀, 繼續(xù)免費(fèi)閱讀

下載本文檔

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

文檔簡(jiǎn)介

1、Cmd1. switch配置命令(1)模式轉(zhuǎn)換命令用戶模式-特權(quán)模式,使用命令"enable"特權(quán)模式-全局配置模式,使用命令"config t"全局配置模式-接口模式,使用命令"interface+接口類型+接口號(hào)"全局配置模式-線控模式,使用命令"line+接口類型+接口號(hào)"注:用戶模式:查看初始化的信息.特權(quán)模式:查看所有信息、調(diào)試、保存配置信息全局模式:配置所有信息、針對(duì)整個(gè)路由器或交換機(jī)的所有接口接口模式:針對(duì)某一個(gè)接口的配置線控模式:對(duì)路由器進(jìn)行控制的接口配置(2)配置命令show running co

2、nfig 顯示所有的配置show versin 顯示版本號(hào)和寄存器值shut down 關(guān)閉接口no shutdown 打開接口ip add +ip地址 配置IP地址secondary+IP地址 為接口配置第二個(gè)IP地址show interface+接口類型+接口號(hào) 查看接口管理性show controllers interface 查看接口是否有DCE電纜show history 查看歷史記錄show terminal 查看終端記錄大小hostname+主機(jī)名 配置路由器或交換機(jī)的標(biāo)識(shí)config memory 修改保存在NVRAM中的啟動(dòng)配置exec timeout 0 0 設(shè)置控制臺(tái)會(huì)話

3、超時(shí)為0service password-encryptin 手工加密所有密碼enable password +密碼 配置明文密碼ena sec +密碼 配置密文密碼line vty 0 4/15 進(jìn)入telnet接口password +密碼 配置telnet密碼line aux 0 進(jìn)入AUX接口password +密碼 配置密碼line con 0 進(jìn)入CON接口password +密碼 配置密碼bandwidth+數(shù)字 配置帶寬no ip address 刪除已配置的IP地址show startup config 查看NVRAM中的配置信息copy run-config atartup

4、config 保存信息到NVRAMwrite 保存信息到NVRAMerase startup-config 清除NVRAM中的配置信息show ip interface brief 查看接口的謫要信息banner motd # +信息 + # 配置路由器或交換機(jī)的描素信息description+信息 配置接口聽描素信息vlan database 進(jìn)入VLAN數(shù)據(jù)庫(kù)模式vlan +vlan號(hào)+ 名稱 創(chuàng)建VLANswitchport access vlan +vlan號(hào) 為VLAN為配接口interface vlan +vlan號(hào) 進(jìn)入VLAN接口模式ip add +ip地址 為VLAN配置管理

5、IP地址vtp+service/tracsparent/client 配置SW的VTP工作模式vtp +domain+域名 配置SW的VTP域名vtp +password +密碼 配置SW的密碼switchport mode trunk 啟用中繼no vlan +vlan號(hào) 刪除VLANshow spamming-tree vlan +vlan號(hào) 查看VLA怕生成樹議2. 路由器配置命令ip route+非直連網(wǎng)段+子網(wǎng)掩碼+下一跳地址 配置靜態(tài)/默認(rèn)路由show ip route 查看路由表show protocols 顯示出所有的被動(dòng)路由協(xié)議和接口上哪些協(xié)議被設(shè)置show ip proto

6、cols 顯示了被配置在路由器上的路由選擇協(xié)議,同時(shí)給出了在路由選擇協(xié)議中使用的定時(shí)器 等信息router rip 激活RIP協(xié)議network +直連網(wǎng)段 發(fā)布直連網(wǎng)段interface lookback 0 激活邏輯接口passive-interface +接口類型+接口號(hào) 配置接口為被動(dòng)模式 debug ip +協(xié)議 動(dòng)態(tài)查看路由更新信息undebug all 關(guān)閉所有DEBUG信息router eigrp +as號(hào) 激活EIGRP路由協(xié)議network +網(wǎng)段+子網(wǎng)掩碼 發(fā)布直連網(wǎng)段show ip eigrp neighbors 查看鄰居表show ip eigrp topology

7、查看拓?fù)浔韘how ip eigrp traffic 查看發(fā)送包數(shù)量router ospf +process-ID 激活OSPF協(xié)議network+直連網(wǎng)段+area+區(qū)域號(hào) 發(fā)布直連網(wǎng)段show ip ospf 顯示OSPF的進(jìn)程號(hào)和ROUTER-IDencapsulation+封裝格式 更改封裝格式no ip admain-lookup 關(guān)閉路由器的域名查找ip routing 在三層交換機(jī)上啟用路由功能 show user 查看SW的在線用戶clear line +線路號(hào) 清除線路3. 三層交換機(jī)配置命令配置一組二層端口configure terminal 進(jìn)入配置狀態(tài)nterface

8、range port-range 進(jìn)入組配置狀態(tài)配置三層端口configure terminal 進(jìn)入配置狀態(tài)interface fastethernet | gigabitethernet interface-id | vlan vlan-id | port-channel port-channel-number 進(jìn)入端口配置狀態(tài)no switchport 把物理端口變成三層口ip address ip_address subnet_mask 配置IP地址和掩碼no shutdown 激活端口 例: Switch(config)# interface gigabitethernet0/2 S

9、witch(config-if)# no switchport Switch(config-if)# ip address 1 Switch(config-if)# no shutdown配置VLANconfigure terminal 進(jìn)入配置狀態(tài)vlan vlan-id 輸入一個(gè)VLAN號(hào), 然后進(jìn)入vlan配態(tài),可以輸入一個(gè)新的VLAN號(hào)或舊的來進(jìn)行修改。name vlan-name 可選)輸入一個(gè)VLAN名,如果沒有配置VLAN名,缺省的名字是VLAN號(hào)前面用0填滿的4位數(shù),如VLAN0004是VLAN4的缺省名字mtu mtu-si

10、ze (可選) 改變MTU大小 例 Switch# configure terminal Switch(config)# vlan 20 Switch(config-vlan)# name test20 Switch(config-vlan)# end 或 Switch# vlan database Switch(vlan)# vlan 20 name test20 Switch(vlan)# exit將端口分配給一個(gè)VLANconfigure terminal 進(jìn)入配置狀態(tài)interface interface-id 進(jìn)入要分配的端口switchport mode access 定義二層口s

11、witchport access vlan vlan-id 把端口分配給某一VLAN 例 Switch# configure terminal Enter configuration commands, one per line. End with CNTL/Z. Switch(config)# interface fastethernet0/1 Switch(config-if)# switchport mode access Switch(config-if)# switchport access vlan 2 Switch(config-if)# end Switch#配置VLAN tr

12、unkconfigure terminal 進(jìn)入配置狀態(tài)interface interface-Id 進(jìn)入端口配置狀態(tài)switchport trunk encapsulation isl | dot1q | negotiate配置trunk封裝ISL 或 802.1Q 或自動(dòng)協(xié)商switchport mode dynamic auto | desirable | trunk 配置二層trunk模式。dynamic auto自動(dòng)協(xié)商是否成為trunkdynamic desirable把端口設(shè)置為trunk如果對(duì)方端口是trunk, desirable, 配置Native VLAN(802.1q)

13、或自動(dòng)模式,trunk設(shè)置端口為強(qiáng)制的trunk方式,而不理會(huì)對(duì)方端口是否為trunkswitchport access vlan vlan-id 可選) 指定一個(gè)缺省VLAN, 如果此端口不再是trunkswitchport trunk native vlan vlan-id 指定802.1Q native VLAN號(hào) 例: Switch# configure terminal Enter configuration commands, one per line. End with CNTL/Z. Switch(config)# interface fastethernet0/4 Switc

14、h(config-if)# switchport mode trunk Switch(config-if)# switchport trunk encapsulation dot1q Switch(config-if)# end 定義TRUNK允許的VLANconfigure terminal子 進(jìn)入配置狀態(tài)interface interface-id 進(jìn)入端口配置switchport mode trunk 配置二層口為trunkswitchport trunk allowed vlan add | all | except | remove vlan-list可選) 配置trunk允許的VL

15、AN.使用add, all, except, remove關(guān)健字no switchport trunk allowed vlan 允許所有VLAN通過 例 Switch(config)# interface fastethernet0/1 Switch(config-if)# switchport trunk allowed vlan remove 2 Switch(config-if)# end配置Native VLAN(802.1q)configure terminal 進(jìn)入配置狀態(tài)interface interface-id 進(jìn)入配置成802.1qtrunk的端口switchport t

16、runk native vlan vlan-Id 配置native VLAN號(hào)no switchport trunk native vlan 端口配置命令回到缺省的狀態(tài)配置基于端口權(quán)值的負(fù)載均衡configure terminal 進(jìn)入Switch 1配置狀態(tài)vtp domain domain-name 配置VTP域vtp mode server 將Switch 1配置成VTP server.show vtp status 驗(yàn)證VTP的配置show vlan 驗(yàn)證VLANconfigure terminal 進(jìn)入配置狀態(tài)interface fastethernet 0/1 進(jìn)入F0/1端口sw

17、itchport trunk encapsulation isl | dot1q | negotiate配置trunk封裝switchport mode trunk 配置成trunkshow interfaces fastethernet0/1 switchport 驗(yàn)證VLAN配置按以上步驟對(duì)想要負(fù)載均衡的接口進(jìn)行配置在另一個(gè)交換機(jī)上進(jìn)行此配置show vlan 當(dāng)trunk已經(jīng)起來,在switch2上驗(yàn)證已經(jīng)學(xué)到相的vlan配置configure terminal 在Switch 1上進(jìn)入配置狀態(tài)interface fastethernet0/1 進(jìn)入要配置的端口spanning-tree

18、 vlan 8 port-priority 10 將端口權(quán)值10賦與VLAN 8.spanning-tree vlan 9 port-priority 10 將端口權(quán)值10賦與VLAN 9.spanning-tree vlan 10 port-priority 10 將端口權(quán)值10賦與VLAN 10.interface fastethernet0/2 進(jìn)入F0/2spanning-tree vlan 3 port-priority 10 將端口權(quán)值10賦與VLAN 3.spanning-tree vlan 4 port-priority 10 將端口權(quán)值10賦與VLAN 4spanning-t

19、ree vlan 5 port-priority 10 將端口權(quán)值10賦與VLAN 5spanning-tree vlan 6 port-priority 10 將端口權(quán)值10賦與VLAN 10end 退出show running-config 驗(yàn)證配置copy running-config startup-config 保存配置配置STP路徑值的負(fù)載均衡Trunk1走VLAN810,Trunk2走VLAN24configure terminal 進(jìn)入 Switch 1配置狀態(tài)interface fastethernet 0/1 進(jìn)入F0/1switchport trunk encapsula

20、tion isl | dot1q | negotiate配置封裝switchport mode trunk 配置Trunk,缺省是ISL封裝exit 退回在F0/2口上重復(fù)24步驟exit 退回show running-config 驗(yàn)證配置show vlan驗(yàn)證switch1 已經(jīng)學(xué)到Vlanconfigure terminal 進(jìn)入配置狀態(tài)interface fastethernet 0/1 進(jìn)入F0/1spanning-tree vlan 2 cost 30 設(shè)置Vlan2生成樹路徑值為30spanning-tree vlan 3 cost 30 設(shè)置Vlan3生成樹路徑值為30span

21、ning-tree vlan 4 cost 30 設(shè)置Vlan4生成樹路徑值為30end 退出在switch1的F0/2上重復(fù)911步驟設(shè)置VLAN8,9,10生成樹路徑值為30end 退出show running-config 驗(yàn)證配置copy running-config startup-config 保存配置補(bǔ)充:CISCO命令集路由選擇協(xié)議及排障 *ip route命令Router(config)# ip route <目錄網(wǎng)絡(luò)或子網(wǎng)號(hào)> 子網(wǎng)掩碼 <下一路由器IP地址 | 從本地出口的地址> 管理距離0255,默認(rèn)為1 (注:靜態(tài)地址配置) *ip defau

22、lt-network命令Router(config)# ip default-network <目標(biāo)網(wǎng)絡(luò)號(hào)> (注:配合路由協(xié)使用,用其中的一個(gè)動(dòng)態(tài)路由號(hào)作默認(rèn)路由配置)Router(config)# ip route <下一路由器IP地址 | 從本地出口的地址> (注:只有一個(gè)公網(wǎng)地址時(shí),在出口路由器上的配置) *內(nèi)部路由選擇協(xié)議 *使用router和network命令Router(config)# router <路由協(xié)議rip | igrp | eigrp | ospf | is-is等> 自主系統(tǒng)號(hào)Router(con

23、fig-router)# network <直接相連的要用此路由協(xié)議的網(wǎng)絡(luò)號(hào)>Router(config-router)# network <直接相連的要用此路由協(xié)議的網(wǎng)絡(luò)號(hào)> *路由信息協(xié)議RIPRouter(config)# router ripRouter(config-router)# network <直接相連的要用rip協(xié)議的有類別網(wǎng)絡(luò)號(hào)>Router# show ip protocolsRouter# show ip routeRouter# debug ip rip *內(nèi)部網(wǎng)關(guān)路由協(xié)議IGRPRouter(config)# router igrp <自主系統(tǒng)號(hào)>Router(config-router)# network <直接相連的要用igrp協(xié)議的有類別網(wǎng)絡(luò)號(hào)>Router# show ip interfaceRouter# show ip protocolsRouter# show ip routeRouter# debug ip rip *排除網(wǎng)絡(luò)故障 排除網(wǎng)絡(luò)故障的一個(gè)總體模型Router# ping <有故障的主機(jī) | 有故障的IP地址>Router# show ip routeRouter#

溫馨提示

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

評(píng)論

0/150

提交評(píng)論