




版權(quán)說明:本文檔由用戶提供并上傳,收益歸屬內(nèi)容提供方,若內(nèi)容存在侵權(quán),請(qǐng)進(jìn)行舉報(bào)或認(rèn)領(lǐng)
文檔簡介
1、交換機(jī)支持的命令:交換機(jī)基本狀態(tài)switch 路由器是rommon> hostname> 用戶模式 hostname# 特權(quán)模式 hostname(config)# 全局配置模式 hostname(config-if)# 接口狀態(tài) 交換機(jī)口令設(shè)置: switch>enable 進(jìn)入特權(quán)模式 switch#config terminal 進(jìn)入全局配置模式 switch(config)#hostname
2、160;設(shè)置交換機(jī)的主機(jī)名 switch(config)#enable secret xxx 設(shè)置特權(quán)加密口令 switch(config)#enable password xxa 設(shè)置特權(quán)非密口令 switch(config)#line console 0 進(jìn)入控制臺(tái)口 switch(config-line)#line vty 0 4 進(jìn)入虛擬終端 switch(config-line)#login 允許
3、登錄 switch(config-line)#password xx 設(shè)置登錄口令xx switch#exit 返回命令 交換機(jī)VLAN設(shè)置: switch#vlan database 進(jìn)入VLAN設(shè)置 switch(vlan)#vlan 2 建VLAN 2 switch(vlan)#no vlan 2 刪vlan 2 switch(config)#int f0/1
4、0;進(jìn)入端口1 switch(config-if)#switchport access vlan 2 當(dāng)前端口加入vlan 2 switch(config-if)#switchport mode trunk 設(shè)置為干線 switch(config-if)#switchport trunk allowed vlan 1,2 設(shè)置允許的vlan switch(config-if)#switchport trunk
5、0;encap dot1q 設(shè)置vlan 中繼 switch(config)#vtp domain 設(shè)置vtp域名 switch(config)#vtp password 設(shè)置vtp密碼 switch(config)#vtp mode server 設(shè)置vtp模式 switch(config)#vtp mode client 設(shè)置vtp模式 交換機(jī)設(shè)置IP地址: swit
6、ch(config)#interface vlan 1 進(jìn)入vlan 1 switch(config-if)#ip address 設(shè)置IP地址 switch(config)#ip default-gateway 設(shè)置默認(rèn)網(wǎng)關(guān) switch#dir flash: 查看閃存 交換機(jī)顯示命令: switch#write 保存配置信息 switch#show vtp
7、;查看vtp配置信息 switch#show run 查看當(dāng)前配置信息 switch#show vlan 查看vlan配置信息 switch#show interface 查看端口信息 switch#show int f0/0 查看指定端口信息 路由器支持的命令: 路由器顯示命令: router#show run 顯示配置信息 router#sho
8、w interface 顯示接口信息 router#show ip route 顯示路由信息 router#show cdp nei 顯示鄰居信息 router#reload重新起動(dòng)路由器口令設(shè)置: router>enable 進(jìn)入特權(quán)模式 router#config terminal 進(jìn)入全局配置模式 router(config)#hostname 設(shè)置交換機(jī)的主機(jī)名 router(co
9、nfig)#enable secret xxx 設(shè)置特權(quán)加密口令 router(config)#enable password xxb 設(shè)置特權(quán)非密口令 router(config)#line console 0 進(jìn)入控制臺(tái)口 router(config-line)#line vty 0 4 進(jìn)入虛擬終端 router(config-line)#login 要求口令驗(yàn)證 router(config-line
10、)#password xx 設(shè)置登錄口令xx router(config)#(Ctrl+z) 返回特權(quán)模式 router#exit 返回命令 路由器配置: router(config)#int s0/0 進(jìn)入Serail接口 router(config-if)#no shutdown 激活當(dāng)前接口 router(config-if)#clock rate 64000 設(shè)置同步時(shí)鐘 router(confi
11、g-if)#ip address 設(shè)置IP地址 router(config-if)#ip address second 設(shè)置第二個(gè)IP router(config-if)#int f0/0.1 進(jìn)入子接口 router(config-subif.1)#ip address 設(shè)置子接口IP router(config-subif.1)#encapsulation dot1q 綁定vlan中
12、繼協(xié)議 router(config)#config-register 0x2142 跳過配置文件 router(config)#config-register 0x2102 正常使用配置文件 router#reload 重新引導(dǎo) 路由器文件操作: router#copy running-config startup-config 保存配置 router#copy running-config tftp 保存配置到tftp
13、60;router#copy startup-config tftp 開機(jī)配置存到tftp router#copy tftp flash: 下傳文件到flash router#copy tftp startup-config下載配置文件 ROM狀態(tài): Ctrl+Break 進(jìn)入ROM監(jiān)控狀態(tài) rommon>confreg 0x2142 跳過配置文件 rommon>confreg 0x2102 恢
14、復(fù)配置文件 rommon>reset 重新引導(dǎo) rommon>copy xmodem: flash: 從console傳輸文件 rommon>IP_ADDRESS= 設(shè)置路由器IP rommon>IP_SUBNET_MASK= 設(shè)置路由器掩碼 rommon>TFTP_SERVER= 指定TFTP服務(wù)器IP rommon>TFTP_FILE=c2600.bin
15、160;指定下載的文件 rommon>tftpdnld 從tftp下載 rommon>dir flash: 查看閃存內(nèi)容rommon>boot 引導(dǎo)IOS 靜態(tài)路由: ip route 命令格式 router(config)#ip route 靜態(tài)路由舉例 router(config)#ip route
16、; 默認(rèn)路由舉例 動(dòng)態(tài)路由: router(config)#ip routing 啟動(dòng)路由轉(zhuǎn)發(fā) router(config)#router rip 啟動(dòng)RIP路由協(xié)議。 router(config-router)#network 設(shè)置發(fā)布路由router(config-router)#negihbor 點(diǎn)對(duì)點(diǎn)幀中繼用。 幀中繼命令: router(config)#frame-r
17、elay switching 使能幀中繼交換 router(config-s0)#encapsulation frame-relay 使能幀中繼 router(config-s0)#fram-relay lmi-type cisco 設(shè)置管理類型 router(config-s0)#frame-relay intf-type DCE 設(shè)置為DCE router(config-s0)#frame-relay dlci 16 ro
18、uter(config-s0)#frame-relay local-dlci 20 設(shè)置虛電路號(hào) router(config-s0)#frame-relay interface-dlci 16 router(config)#log-adjacency-changes 記錄鄰接變化 router(config)#int s0/0.1 point-to-point 設(shè)置子接口點(diǎn)對(duì)點(diǎn)router#show frame pvc 顯示永久虛電路
19、router#show frame map 顯示映射 基本訪問控制列表: router(config)#access-list permit|deny router(config)#interface default:deny any router(config-if)#ip access-group in|out default:out 例1:router(config)#acces
20、s-list 4 permit router(config)#access-list 4 deny 55 router(config)#access-list 4 permit 55 router(config)#access-list 4 deny 55 router(config
21、)#access-list 4 permit any router(config)#int f0/0 router(config-if)#ip access-group 4 in 擴(kuò)展訪問控制列表: access-list permit|deny icmp <DESTINATIONIPwild>typeaccess-list permit|deny tcp
22、; <DESTINATIONIPwild>port 例3: router(config)#access-list 101 deny icmp any echo router(config)#access-list 101 permit ip any any router(config)#int s0/0 router(config-if)#ip ac
23、cess-group 101 in 例3: router(config)#access-list 102 deny tcp any eq 80 router(config)#access-list 102 permit ip any any router(config)#interface s0/1 router(config-if)#ip
24、access-group 102 out 刪除訪問控制例表: router(config)#no access-list 102 router(config-if)#no ip access-group 101 in 路由器的nat配置 Router(config-if)#ip nat inside 當(dāng)前接口指定為內(nèi)部接口 Router(config-if)#ip nat outside 當(dāng)前接口
25、指定為外部接口 Router(config)#ip nat inside source static p <私有IP><公網(wǎng)IP> port Router(config)#ip nat inside source static Router(config)#ip nat inside source static tcp
26、0; 80 80 Router(config)#ip nat pool p1 0 Router(config)#ip nat inside source list 1 pool p1 Router(config)#ip nat inside destination lis
27、t 2 pool p2 Router(config)#ip nat inside source list 2 interface s0/0 overload Router(config)#ip nat pool p2 type rotary Router#show ip nat t
28、ranslation rotary 參數(shù)是輪流的意思,地址池中的IP輪流與NAT分配的地址匹配。 overload參數(shù)用于PAT 將內(nèi)部IP映射到一個(gè)公網(wǎng)IP不同的端口上。 外部網(wǎng)關(guān)協(xié)議配置: routerA(config)#router bgp 100 routerA(config-router)#network routerA(config-router)#neighbor remote-as 200 配置P
29、PP驗(yàn)證: RouterA(config)#username password RouterA(config)#int s0 RouterA(config-if)#ppp authentication chap|pap 3PIX防火墻命令 Pix525(config)#nameif ethernet0 outside security0 命名接口和級(jí)別 Pix525(config)#interface ethernet0&
30、#160;auto 設(shè)置接口方式 Pix525(config)#interface ethernet1 100full 設(shè)置接口方式 Pix525(config)#interface ethernet1 100full shutdown Pix525(config)#ip address inside Pix525(config)#ip address outside
31、0; 52 Pix525(config)#global (if_name) natid ip-ip 定義公網(wǎng)IP區(qū)間 Pix525(config)#global (outside) 1 -5 例句 Pix525(config)#global (outside) 1 例句 Pix525(config)#no global
32、0;(outside) 1 去掉設(shè)置 Pix525(config)#nat (if_name) nat_id local_ip netmark Pix525(config)#nat (inside) 1 0 0 內(nèi)網(wǎng)所有主機(jī)(0代表)可以訪問global 1指定的外網(wǎng)。 Pix525(config)#nat (inside) 1 255.25
33、5.0.0 內(nèi)網(wǎng)/16網(wǎng)段的主機(jī)可以訪問global 1指定的外網(wǎng)。 Pix525(config)#route if_name 0 0 gateway_ip metric 命令格式 Pix525(config)#route outside 0 0 1 例句 Pix525(config)#route inside
34、60; 1 例句 Pix525(config)#static (inside, outside) 表示內(nèi)部ip地址,訪問外部時(shí)被翻譯成全局地址。 Pix525(config)#static (dmz, outside) 中間區(qū)域ip地址,訪問外部時(shí)被翻譯成全局地址。 &
35、#160; Cisco路由器的基礎(chǔ)配置 1、路由器模式詳解: Router>用戶模式,通常用來查看統(tǒng)計(jì)信息,但不能修改路由器的設(shè)置。 Router#特權(quán)模式,可以查看并修改路由器的配置,通常在這里運(yùn)行show命令。 Router(config)# 全局模式,在這里修改當(dāng)前運(yùn)行配置中的內(nèi)容。 Router(config-if)#接口模式,用來配置路由器的物理接口和環(huán)回接口。 Router(config-line)#控制臺(tái)接口模式,通常用來配置用戶模式口令,如Telnet的登錄密碼。
36、60;Router(config-subif)#子接口模式,用來配置在路由器中創(chuàng)建的邏輯接口Router(config-router)#路由協(xié)議接口模式,在這里配置路由協(xié)議,如RIP、OSPF、IGRP等。 2、常用的show命令: 查看路由信息 Router#show ip route 查看路由器版本 Router#show version 查看路由器flash Router#show flash: 查看歷史命令記錄
37、160; Router#show history 查看路由器ARP表 Router#show arp 查看路由器的時(shí)間設(shè)置 Router#show clock 查看接口簡要信息 Router#show ip interf
38、ace brief 查看接口物理相關(guān)信息 Router#show interfaces s0/0 查看接口協(xié)議相關(guān)信息 Router#show ip interface s0/0 查看路由器運(yùn)行配置文件
39、0; Router#show running-config 查看當(dāng)前所有連接到路由器的用戶 Router#show users 查看會(huì)話記錄,經(jīng)常在終端上使用 Router#show session 查看特定接口的硬件信息 Router#show controllers s0/0 查看全局
40、和接口的第三層協(xié)議的特定狀態(tài) Router#show protocols 查看下次路由器重新加載時(shí)將要使用的配置 Router#show startup-config CDP思科發(fā)現(xiàn)協(xié)議,查看直連的相鄰設(shè)備及其詳細(xì)信息 Router#show cdp neighbors 3、登錄路由器必要的配置: Router>enable &
41、#160; /進(jìn)入特權(quán)模式 Router#configure terminal /進(jìn)入全局模式 Router(config)#hostname R1 /配置路由器的主機(jī)名 R1(config)#no ip domain-lookup/關(guān)閉動(dòng)態(tài)的域名解析,作用是當(dāng)我們輸入錯(cuò)誤命令的時(shí)候,路由器會(huì)認(rèn)為這條命令沒有錯(cuò)誤,它只是一個(gè)域名的形式,路由器會(huì)進(jìn)行解析,從而浪費(fèi)寶貴的時(shí)間。 R1(config)#line
42、;console 0 /進(jìn)入控制臺(tái) R1(config-line)#exec-timeout 0 0 /關(guān)閉控制臺(tái)的會(huì)話超時(shí),也可用命令no exec-timeout,當(dāng)長時(shí)間不去操作路由器的時(shí)候,路由器會(huì)自動(dòng)的終止與我們的對(duì)話連接,跳轉(zhuǎn)到非連接狀態(tài),這時(shí)候,需要輸入enable 密碼重新登錄,從某種意義上來講是對(duì)安全性得到了保證,但對(duì)我們的操作卻是十分的不方便。 R1(config-line)#logging synchronous /關(guān)閉日志同步
43、,抑制控制臺(tái)的提示信息,使得路由器發(fā)送的控制臺(tái)屏幕的消息不會(huì)附加到命令行中。 路由器的口令設(shè)置 Router>enable/進(jìn)入特權(quán)模式 Router#configure terminal /進(jìn)入全局模式 Router(config)#enable password cisco1 /配置進(jìn)入特權(quán)模式的密碼(明文密碼),使用命令show running-config可以查看到設(shè)置的密碼。 Router(config)#enable
44、160;secret cisco2 /配置進(jìn)入特權(quán)模式的密碼(密文密碼),使用命令show running-config查看時(shí),設(shè)置的密碼是以密文顯示,權(quán)限更高。 Router(config)#line console 0 /進(jìn)入控制臺(tái) Router(config-line)#password cisco /設(shè)置登錄到路由器的密碼,在進(jìn)入用戶模式時(shí)驗(yàn)證。 Router(config-line)#login
45、; /啟用登錄 Router(config-line)#line vty 0 4 /設(shè)置telnet訪問路由器的5條線路,也可在全局模式下進(jìn)入 Router(config)#line vty 0 4。Router(config-line)#password cisco /設(shè)置telnet到路由器的密碼,如果不設(shè)置此密碼,服務(wù)將無法啟動(dòng)。 Router(config-line)#login Router(config-line)#li
46、ne aux 0 Router(config-line)#password 123 /設(shè)置輔助接口的密碼 Router(config-line)#login Router(config-line)#exit /退出 Router(config)#service password-encryption/此命令用來加密口令,對(duì)路由器配置的所有口令都進(jìn)行加密,如設(shè)置的en
47、able password查看時(shí)是以明文顯示,使用此命令后,通過命令show running-config查看時(shí),是以密文顯示。 路由器或交換機(jī)上常用的測(cè)試和診斷命令及其功能1、通用測(cè)試、診斷命令 1) ping x.x.x.x - 標(biāo)準(zhǔn)ping命令,用于測(cè)試設(shè)備間的物理連通性 2) ping - 擴(kuò)展ping命令,用于測(cè)試設(shè)備間的物理連通性。擴(kuò)展ping命令還支持靈活定義ping參數(shù),如ping數(shù)據(jù)包的大小、發(fā)送包的個(gè)數(shù)、等待響應(yīng)數(shù)據(jù)包的超時(shí)時(shí)間等 3)
48、;traceroute x.x.x.x - 用于跟蹤、顯示路由信息 4) show running-config - 用于顯示路由器、交換機(jī)運(yùn)行配置文件的內(nèi)容 5) show startup-config - 用于顯示路由器、交換機(jī)啟動(dòng)配置文件的內(nèi)容 6) show sessions - 用于顯示從當(dāng)前設(shè)備發(fā)出的所有呼出Telnet會(huì)話 7) disconnect - 用于斷開
49、與遠(yuǎn)程目標(biāo)主機(jī)的Telnet會(huì)話 8) show users - 用于查看呼入Telnet會(huì)話情況 9) clear line - 用于斷開遠(yuǎn)程主機(jī)的呼入Telnet連接 10) shutdown - 用于臨時(shí)將某個(gè)接口關(guān)閉 11) no shutdown - 用于手動(dòng)啟動(dòng)(激活)處于管理性關(guān)閉的接口 12) show arp - 用于顯示ARP緩存(ARP
50、表)的內(nèi)容 13) show ip arp - 用于顯示IP ARP緩存(ARP表)的內(nèi)容 14) show ip interface - 用于顯示IP接口的狀態(tài)及配置信息 15) show version - 用于顯示路由器硬件配置、軟件版本等信息 16) show etherchannel summary - 用于顯示端口捆綁的簡要信息 17)
51、 Ctrl+Shift+6+x - 也被稱為退出序列,用于終止正在執(zhí)行的某條命令或操作,也用于從呼出Telnet會(huì)話中暫時(shí)切換到本地連接 18) dir flash - 用于顯示閃存中的文件清單 19) dir nvram - 用于顯示非易失性內(nèi)存中的文件清單 20) show debugging - 用于顯示正在進(jìn)行的診斷過程清單 21) undebug all -
52、;用于停止所有診斷過程 2、VLAN、VTP測(cè)試、診斷命令 1) show interface vlan vlan-num - 用于顯示VLAN是否已激活、交換機(jī)MAC地址、接口參數(shù)等 2) show mac-address-table - 用于顯示CAM,即橋接表的內(nèi)容。該命令可列出學(xué)習(xí)到的主機(jī)MAC地址及其所屬VLAN、所處端口、條目類型(靜態(tài)static)、(動(dòng)態(tài) dynamic)等)以及滿足列表?xiàng)l件的MAC地址數(shù)目 3) sho
53、w vlan - 用于查看VLAN創(chuàng)建情況。該命令可以顯示系統(tǒng)所有的VLAN信息,包括VLAN編號(hào)、VLAN名稱、VLAN狀態(tài)、VLAN成員等信息4) show vtp status - 用于檢查VTP配置情況 3、生成樹測(cè)試、診斷命令 1) show spanning-tree - 用于顯示生成樹協(xié)議中交換機(jī)及其端口的情況 2) show spanning-tree blockedports - 用于顯示處于阻塞狀態(tài)的端口 3) show spanning-tree detail - 用于顯示生成樹詳細(xì)信息 4) show spanning-tree interface - 用于顯示生成樹中某端口相關(guān)狀態(tài)
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請(qǐng)下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請(qǐng)聯(lián)系上傳者。文件的所有權(quán)益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內(nèi)容里面會(huì)有圖紙預(yù)覽,若沒有圖紙預(yù)覽就沒有圖紙。
- 4. 未經(jīng)權(quán)益所有人同意不得將文件中的內(nèi)容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(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ì)自己和他人造成任何形式的傷害或損失。
最新文檔
- 2025年供氣合同樣本模板
- 2025深圳短期工勞動(dòng)合同
- 保險(xiǎn)業(yè)務(wù)員2025年上半年工作總結(jié)模版
- 人教版分?jǐn)?shù)的大小比較
- 《青少年心理健康指導(dǎo)》課件
- 生殖醫(yī)學(xué)護(hù)理專題培訓(xùn)
- 《暖氣管網(wǎng)模擬系統(tǒng)教學(xué)課件》
- 2025超市員工簡易勞動(dòng)合同范本
- 金融科技行業(yè)區(qū)塊鏈技術(shù)與數(shù)字貨幣應(yīng)用方案
- 傳統(tǒng)會(huì)計(jì)與現(xiàn)代會(huì)計(jì)的對(duì)比研究試題及答案
- 發(fā)電廠電氣部分智慧樹知到期末考試答案章節(jié)答案2024年東北電力大學(xué)
- 2024年株洲國創(chuàng)軌道科技有限公司招聘筆試沖刺題(帶答案解析)
- AI+蛋白質(zhì)行業(yè)研究報(bào)告 2024
- 利昕報(bào)廢汽車回收拆解有限公司報(bào)廢汽車回收拆解建設(shè)項(xiàng)目環(huán)評(píng)可研資料環(huán)境影響
- 公共政策導(dǎo)論全套教學(xué)課件
- 農(nóng)產(chǎn)品加工企業(yè)管理培訓(xùn)
- 校車駕駛員交通安全培訓(xùn)
- 飛機(jī)維修員入門教程
- 超聲引導(dǎo)下神經(jīng)阻滯下肢篇
- 2024屆高三英語二輪專題復(fù)習(xí):關(guān)于水中或雨中脫困脫險(xiǎn)的讀后續(xù)寫練習(xí)寫作素材
- 《如何處理人際關(guān)系》課件
評(píng)論
0/150
提交評(píng)論