思科配置命令詳解_第1頁
思科配置命令詳解_第2頁
思科配置命令詳解_第3頁
思科配置命令詳解_第4頁
思科配置命令詳解_第5頁
已閱讀5頁,還剩6頁未讀 繼續(xù)免費閱讀

下載本文檔

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

文檔簡介

1、思科交換機配置命令大全2011-04-03 10:54思科交換機配置命令大全switch用戶模式1:進入特權模式enableswitch enableswitch#2:進入全局配置模式configure terminalswitch enableswitch# c onfigure terminalswitch(conf)#3:交換機命名 hostname aptech2950 以 aptech2950 為例switch enableswitch# c onfigure terminalswitch(conf)#hostname aptch-2950aptech2950(conf)#4:配置使

2、能口令 enable password cisco 以 cisco 為例switch enableswitch# c onfigure terminalswitch(conf)#hostname aptch2950aptech2950(conf)# enable password cisco5:配置使能密碼 enable secret ciscolab 以 cicsolab 為例 switch enableswitch#c onfigure terminalswitch(conf)#hostname aptch2950aptech2950(conf)# enable secret ciscol

3、ab6:設置虛擬局域網(wǎng)vlan 1 interface vlan 1 switch enableswitch#c onfigure terminalswitch(conf)#hostname aptch2950aptech2950(conf)# interface vlan 1aptech2950(conf-if)#ip address 配置交換機端 口 ip和子網(wǎng)掩碼aptech2950(conf-if)#no shut 是配置處于運行中aptech2950(conf-if)#exitaptech2950(conf)#ip default-gateway 192.168.254 設置網(wǎng)關地址

4、7:進入交換機某一端口 interface fastehernet 0/17以17端口為例 switch enableswitch#c onfigure terminalswitch(conf)#hostname aptch2950aptech2950(conf)# interface fastehernet 0/17aptech2950(conf-if)#8:查看命令showswitch enableswitch# show version察看系統(tǒng)中的所有版本信息show interface vlan 1查看交換機有關ip協(xié)議的配置信息show running-configure查看交換機當

5、前起作用的配置信息show interface fastethernet 0/1察看交換機1接口具體配置和統(tǒng)計信息show mac-address-table 查看 mac 地址表show mac-address-table aging-time 查看 mac 地址表 自動老化時間9:交換機恢復出廠默認恢復命令switch enableswitch# erase startup-configureswitch# reload10:雙工模式設置switch enableswitch# c onfigure terminalswitch2950(conf)#hostname aptch-2950a

6、ptech2950(conf)# interface fastehernet 0/17 以 17 端口為例aptech2950(conf-if)#duplex full/half/auto 有 full , half, auto 三個可 選項11: cdp相關命令switch enableswitch# show cdp查看設備的cdp全局配置信息show cdp interface fastethernet 0/17 查看 17 端口的 cdp 配置信息show cdp traffic查看有關cdp包的統(tǒng)計信息show cdp nerghbors列出與設備相連的cisco設備12: csic

7、o2950的密碼恢復拔下交換機電源線。用于按著交換機的MODE鍵,插上電源線在 switch:后執(zhí)彳亍 flash_ini 命令:switch: flash_ini查看 flash 中的文件:switch: dir flash:把 “config.text文件改名為config.old”: switch: rename flash: config.text flash: config.old執(zhí)彳亍 boot: switch: boot交換機進入是否進入配置的對話,執(zhí)行no :進入特權模式察看flash里的文件:show flash :把config.old 文件改名為config.text:

8、switch: rename flash: config.old flash: config.text把“ config.text 拷入系統(tǒng)的“ running-configure : copy flash: config.text system : running-configure把配置模式重新設置密碼存盤,密碼恢復成功。13:交換機telnet遠程登錄設置:switchenswitch# c onfigure terminalswitch(conf)#hostname aptech-2950aptech2950(conf)#enable password cisco 以 cisco 為特

9、權模式密碼 aptech2950(conf)#interface fastethernet 0/1 以 17 端口為 telnet 遠程登 錄端口aptech2950(conf-if)#ip address aptech2950(conf-if)#no shutaptech2950(conf-if)#exitaptech2950(conf)line vty 0 4 設置 0-4 個用戶可以 telnet 遠程登陸 aptech2950(conf-line)#loginaptech2950(conf-line)#password edge 以 edge 為遠程登錄的用戶密碼 主機設置:ip 主機

10、的ip必須和交換機端口的地址在同一網(wǎng)絡 段netmask gate-way 網(wǎng)關地址是交換機端口地址運行:telnet 進入telnet遠程登錄界面password : edgeaptech2950enpassword: ciscoaptech#14:交換機配置的重新載入和保存設置完成交換機的配置后: aptech2950(conf)#reload 是否保存(y/n)y:保存設置信息山不保存設置信息在基于IOS的交換機上設置主機名/系統(tǒng)名: switch(config)# hostname hostname在基于CLI的交換機上設置主機名/系統(tǒng)名: switch(enable) set sys

11、tem name name-string在基于IOS的交換機上設置登錄口令: switch(config)# enable password level 1 password 在基于CLI的交換機上設置登錄口令: switch(enable) set passwordswitch(enable) set enalbepass在基于IOS的交換機上設置遠程訪問: switch(config)# interface vlan 1 switch(config-if)# ip address ip-address netmask switch(config-if)# ip default-gatewa

12、y ip-address 在基于CLI的交換機上設置遠程訪問:switch(enable) set interface sc0 ip-address netmask broadcast-address switch(enable) set interface sc0 vlanswitch(enable) set ip route default gateway在基于IOS的交換機上啟用和瀏覽CDP信息:switch(config-if)# cdp enable switch(config-if)# no cdp enable 為了查看Cisco鄰接設備的CDP通告信息: switch# sho

13、w cdp interface type modle/port switch# show cdp neighbors type module/port detail 在基于CLI的交換機上啟用和瀏覽CDP信息:switch(enable) set cdp enable|disable module/port 為了查看Cisco鄰接設備的CDP通告信息:switch(enable) show cdp neighborsmodule/port vlan|duplex|capabilities|detail基于IOS的交換機的端口描述: switch(config-if)# description

14、description-string 基于CLI的交換機的端口描述:switch(enable)set port name module/number description-string在基于IOS的交換機上設置端口速度: switch(config-if)# speed(10|100|auto 在基于CLI的交換機上設置端口速度:switch(enable) set port speed moudle/number (10|100|auto switch(enable) set port speed moudle/number (4|16|auto在基于IOS的交換機上設置以太網(wǎng)的鏈路模式

15、: switch(config-if)# duplex (auto|full|half在基于CLI的交換機上設置以太網(wǎng)的鏈路模式: switch(enable) set port duplex module/number (full|half在基于IOS的交換機上配置靜態(tài)VLAN:switch# vlan databaseswitch(vlan)# vlan vlan-num name vla switch(vlan)# exitswitch# configure teriminalswitch(config)# interface interface module/number switch

16、(config-if)# switchport mode accessswitch(config-if)# switchport access vlan vlan-num switch(config-if)# end在基于CLI的交換機上配置靜態(tài)VLAN:switch(enable) set vlan vlan-num name name switch(enable) set vlan vlan-num mod-num/port-list在基于IOS的交換機上配置VLAN中繼線: switch(config)# interface interface mod/port switch(confi

17、g-if)# switchport mode trunkswitch(config-if)# switchport trunk encapsulation isl|dotlq switch(config-if)# switchport trunk allowed vlan remove vlan-list switch(config-if)# switchport trunk allowed vlan add vlan-list 在基于CLI的交換機上配置VLAN中繼線: switch(enable) set trunk module/port on|off|desirable|auto|no

18、negotiateVlan-range isl|dotlq|dotl0|lane|negotiate在基于IOS的交換機上配置VTP管理域: switch# vlan databaseswitch(vlan)# vtp domain domain-name在基于CLI的交換機上配置VTP管理域: switch(enable) set vtp domain domain-name在基于IOS的交換機上配置VTP模式: switch# vlan database switch(vlan)# vtp domain domain-nameswitch(vlan)# vtp sever|cilent|t

19、ransparent switch(vlan)# vtp password password在基于CLI的交換機上配置VTP模式:switch(enable) set vtp domain domain-name mode( sever|cilent|transparent password password在基于IOS的交換機上配置VTP版本: switch# vlan database switch(vlan)# vtp v2-mode在基于CLI的交換機上配置VTP版本: switch(enable) set vtp v2 enable在基于IOS的交換機上啟動VTP剪裁: switch

20、# vlan database switch(vlan)# vtp pruning在基于CL I的交換機上啟動VTP剪裁: switch(enable) set vtp pruning enable在基于IOS的交換機上配置以太信道: switch(config-if)# port group group-number distribution (source|destination在基于CLI的交換機上配置以太信道:switch(enable) set port channel moudle/port-range mode(on|off|desirable|auto在基于IOS的交換機上調整

21、根路徑成本: switch(config-if)# spanning-tree vlan vlan-list cost cost在基于CLI的交換機上調整根路徑成本:switch(enable) set spantree portcost moudle/port cost switch(enable) set spantree portvlancost moudle/port cost costvlan-list在基于IOS的交換機上調整端口 ID:switch(config-if)# spanning-treevlan vlan-listport-priority port-priority

22、在基于CLI的交換機上調整端口 ID:switch(enable) set spantree portpri (mldule/portpriority switch(enable) set spantree portvlanpri (module/portpriority vlans在基于IOS的交換機上修改STP時鐘:switch(config)# spanning-tree vlan vlan-list hello-time seconds switch(config)# spanning-tree vlan vlan-list forward-time secondsswitch(con

23、fig)# spanning-tree vlan vlan-list max-age seconds 在基于CLI的交換機上修改STP時鐘:switch(enable) set spantree hello intervalvlanswitch(enable) set spantree fwddelay delay vlanswitch(enable) set spantree maxage agingtiamevlan在基于IOS的交換機端口上啟用或禁用Port Fast特征: switch(config-if)#spanning-tree portfast在基于CLI的交換機端口上啟用或禁

24、用Port Fast特征:switch(enable) set spantree portfast module/portenable|disable在基于IOS的交換機端口上啟用或禁用UplinkFast特征: switch(config)# spanning-tree uplinkfast max-update-rate pkts-per-second在基于CLI的交換機端口上啟用或禁用UplinkFast特征:switch(enable) set spantree uplinkfast (enable|disablerate update-rate all-protocols off|o

25、n為了將交換機配置成一個集群的命令交換機,首先要給管理接口分配一個 IP地址,然后使用下列命令:switch(config)# cluster enable cluster-name為了從一條中繼鏈路上刪除VLAN,可使用下列命令: switch(enable) clear trunk module/port vlan-range用show vtp domain顯示管理域的VTP參數(shù).用show vtp statistics顯示管理域的VTP參數(shù).在Catalyst交換機上定義TrBRF的命令如下:switch(enable) set vlan vlan-name name name type

26、 trbrf bridge bridge-numstp (ieee|ibm在Catalyst交換機上定義TrCRF的命令如下:switch (enable) set vlan vlan-num name name type trcrf(ring hex-ring-num|decring decimal-ring-num parent vlan-num在創(chuàng)建好TrBRF VLAN之后,就可以給它分配交換機端口.對于以太網(wǎng)交換, 可以采用如下命令給VLAN分配端口 :switch(enable) set vlan vlan-num mod-num/port-num命令show spantree顯示

27、一個交換機端口的STP狀態(tài).配置一個ELAN的LES和BUS,可以使用下列命令:ATM (config)# interface atm number.subint multioint ATM(config-subif)# lane serber-bus ethernet elan-name配置 LECS:ATM(config)# lane database database-nameATM(lane-config-databade)# name elanl-name server-atm-address les1-nsap-addressATM(lane-config-databade)# n

28、ame elan2-name server-atm-address les2-nsap-addressATM(lane-config-databade)# name 創(chuàng)建完數(shù)據(jù)庫后,必須在主接口上啟動LECS.命令如下:ATM(config)# interface atm numberATM(config-if)# lane config database database-nameATM(config-if)# lane config auto-config-atm-address將每個LEC配置到一個不同的ATM子接口上.命令如下:ATM(config)# interface atm nu

29、mber.subint multipointATM(config)# lane client ethernet vlan-num elan-num用 show lane server 顯示 LES 的狀態(tài).用show lane bus顯示bus的狀態(tài).用show lane database顯示LECS數(shù)據(jù)庫可內(nèi)容.用 show lane client 顯示 LEC 的狀態(tài).用show module顯示已安裝的模塊列表.用物理接口建立與VLAN的連接:router# configure terminalrouter(config)# interface media module/portrout

30、er(config-if)# description description-stringrouter(config-if)# ip address ip-addr subnet-maskrouter(config-if)# no shutdown用中繼鏈路來建立與VLAN的連接:router(config)# interface module/port.subinterfacerouter(config-ig)# encapsulationisl|dotlq vlan-numberrouter(config-if)# ip address ip-address subnet-mask用LAN

31、E來建立與VLAN的連接:router(config)# interface atm module/portrouter(config-if)# no ip addressrouter(config-if)# atm pvc 1 0 5 qsaalrouter(config-if)# atm pvc 2 0 16 ilnirouter(config-if)# interface atm module/port.subinterface multipointrouter(config-if)# ip address ip-address subnet-maskrouter(config-if)#

32、 lane client ethernet elan-numrouter(config-if)# interface atm module/port.subinterface multipointrouter(config-if)# ip address ip-address subnet-namerouter(config-if)# lane client ethernet elan-namerouter(config-if)# 為了在路由處理器上進行動態(tài)路由配置,可以用下列IOS命令來進行:router(config)# ip routingrouter(config)# router i

33、p-routing-protocolrouter(config-router)# network ip-network-numberrouter(config-router)# network ip-network-number配置默認路由:switch(enable) set ip route default gateway為一個路由處理器分配VLANID,可在接口模式下使用下列命令:router(config)# interface interface numberrouter(config-if)# mls rp vlan-id vlan-id-num在路由處理器啟用MLSP:route

34、r(config)# mls rp ip為了把一個外置的路由處理器接口和交換機安置在同一個VTP域中:router(config)# interface interface numberrouter(config-if)# mls rp vtp-domain domain-name查看指定的VTP域的信息:router# show mls rp vtp-domain vtp domain name要確定RSM或路由器上的管理接口,可以在接口模式下輸入下列命令:router(config-if)#mls rp management-interface要檢驗MLS-RP的配置情況:router#

35、show mls rp檢驗特定接口上的MLS配置:router# show mls rp interface interface number為了在MLS-SE上設置流掩碼而又不想在任一個路由處理器接口上設置訪問列表:set mls flow destination|destination-source|full為使MLS和輸入訪問列表可以兼容,可以在全局模式下使用下列命令: router(config)# mls rp ip input-acl當某個交換機的第3層交換失效時,可在交換機的特權模式下輸入下列命令:switch(enable) set mls enable若想改變老化時間的值,可

36、在特權模式下輸入以下命令:switch(enable) set mls agingtime agingtime設置快速老化:switch(enable) set mls agingtime fast fastagingtime pkt_threshold確定那些MLS-RP和MLS-SE參與了 MLS,可先顯示交換機引用列表中的內(nèi) 容再確定:switch(enable) show mls include顯示MLS高速緩存記錄:switch(enable) show mls entry用命令show in arp顯示ARP高速緩存區(qū)的內(nèi)容。要把路由器配置為HSRP備份組的成員,可以在接口配置模式

37、下使用下面的 命令:router(config-if)# standby group-number ip ip-address為了使一個路由器重新恢復轉發(fā)路由器的角色,在接口配置模式下:router(config-if)# standy group-number preempt訪問時間和保持時間參數(shù)是可配置的:router(config-if)# standy group-number timers hellotime holdtime配置HSRP跟蹤:router(config-if)# standy group-number track type-numberinterface-prior

38、ity要顯示HSRP路由器的狀態(tài):router# show standby type-number group brief用命令show ip igmp確定當選的查詢器。啟動IP組播路由選擇:router(config)# ip muticast-routing啟動接口上的PIM:dalllasr1(config-if)# ip pimdense-mode|sparse-mode|sparse-dense-mode啟動稀疏-稠密模式下的PIM:router# ip multicast-routingrouter# interface type numberrouter# ip pim spar

39、se-dense-mode核實PIM的配置:dallasr1# show ip pim interfacetype number count顯示PIM鄰居:dallasr1# show ip neighbor type number為了配置RP的地址,命令如下:dallasr1# ip pim rp-address ip-addressgroup-access-list-numberoverride選擇一個默認的RP:dallasr1# ip pim rp-address通告RP和它所服務的組范圍:dallasr1# ip pim send-rp-announce type number sc

40、ope ttl group-list access-list-number為管理范圍組通告RP的地址:dallasr1# ip pim send-rp-announce ethernet0 scope 16 group-list1dallasr1# access-list 1 permit 2 55設定一個RP映像代理:dallasr1# ip pim send-rp-discovery scope ttl核實組到RP的映像:dallasr1# show ip pim rp mappingdallasr1# show ip pim rp group-name|group-address map

41、ping在路由器接口上用命令 ip multicast ttl-threshold ttl-value 設定 TTL 閥值:dallasr1(config-if)# ip multicast ttl-threshold ttl-value用 show ip pim neighbor 顯示 PIM 鄰居表。顯示組播通信路由表中的各條記錄:dallasr1show ip mroutegroup-name|group-addressscouresummarycountactive kbps要記錄一個路由器接受和發(fā)送的全部IP組播包:dallasr1 #debug ip mpacket detail

42、access-listgroup要在CISCO路由器上配置CGMP:dallasr1(config-if)# ip cgmp配置一個組播路由器,使之加入某一個特定的組播組:dallasr1(config-if)# ip igmp join-group group-address關閉 CGMP:dallasr1(config-if)# no ip cgmp啟動交換機上的CGMP:dallasr1(enable) set cgmp enable核實Catalyst交換機上CGMP的配置情況:catalystla1(enable) show configset prompt catalystla1s

43、et interface sc0 set cgmp enableCGMP離開的設置:Dallas_SW(enable) set cgmp leave在Cisco設備上修改控制端口密碼:R1(config)# line console 0R1(config-line)# loginR1(config-line)# password LisbonR1(config)# enable password LilbaoR1(config)# login localR1(config)# username student password cisco在Cisco設備上設置控制臺及vty端口的會話超時:R1

44、(config)# line console 0R1(config-line)# exec-timeout 5 10R1(config)# line vty 0 4R1(config-line)# exec-timeout 5 282.在Cisco設備上設定特權級:R1(config)# privilege configure level 3 usernameR1(config)# privilege configure level 3 copy run startR1(config)# privilege configure level 3 pingR1(config)# privilege

45、 configure level 3 show runR1(config)# enable secret level 3 cisco使用命令privilege可定義在該特權級下使用的命令:router(config)# privilege mode level level command設定用戶特權級:router(config)# enable secret level 3 dallasrouter(config)# enable secret san-franrouter(config)# username student password cisco標志設置與顯示:R1(config)#

46、 banner motd unauthorized access will be prosecuted!設置vty訪問:R1(config)# access-list 1 permit R1(config)# line vty 0 4R1(config)# access-class 1 in配置HTTP訪問:Router3(config)# access-list 1 permit Router3(config)# ip http severRouter3(config)# ip http access-class 1Router3(config)# ip http authentication localRouter3(config)# u

溫馨提示

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

評論

0/150

提交評論