Ⅰ cisco常用命令
cisco常用命令大全
為幫助大家更好通過思科認證。我為大家分想的是思科認證基本命令,歡迎參考閱讀!
路由器的幾個基本命令:
Router>enable 進入特權模式
Router#disable 從特權模式返回到用戶模式
Router#configure terminal 進入到全局配置模式
Router(config)#interface ethernet 1 進入到路由器編號為1的乙太網口
exit 返回上層模式
end 直接返回到特權模式
========================================================
注意:
1、CISCO CATALYST(交換機),如果在初始化時沒有發現“用戶配置”文件,就會自動載入Default Settings(默認配置)文件,進行交換機初始化,以確保交換機正常工作。
2、CISCO Router(路由器)在初始化時,如果沒有發現“用戶配置”文件,系統會自動進入到“初始化配置模式”(系統配置對話模式,SETUP模式, STEP BY STEP CONFIG模式),不能正常工作!
========================================================
1、CONSOLE PORT(管理控制台介面):距離上限制,獨占的方式。剛開始配置的時候一般使用這個。
2、AUX port(輔助管理介面):可以掛接MODEM實現遠程管理,獨占的方式。
3、Telnet:多人遠程管理(決定於性能,VTY線路數量)不安全。後期維護,遠程管理登陸。
========================================================
注意:
交換機、路由器配置命令都是回車後立即執行,立即生效的。在運行中的機器上修改命令的時候要特別注意。
========================================================
Router(config)#hostname ?
WORD This system's network name
在配置模式下修改當前主機的本地標識,例:
------------------
Router(config)#hostname r11
r11(config)#
------------------
r11(config-if)#ip address ?
A.B.C.D IP address
為當前埠設置IP地址,使用前先進入需要配置的埠,例:
------------------
r11(config)#interface ethernet 1
r11(config-if)#ip address 172.16.1.1 255.255.255.0
------------------
r11>show version
r11#show version 觀察IOS版本,設備工作時間,相關介面列表
r11#show running-config 查看當前生效的配置,此配置文件存儲在RAM
r11#show interfaces ethernet 1 查看乙太網介面的狀態,工作狀態等等等...
========================================================
r11#reload 重新載入Router(重啟)
r11#setup 手工進入setup配置模式
r11#show history 查看歷史命令(最近剛用過的命令)
r11#terminal history size <0-256> 設置命令緩沖區大小,0 : 代表不緩存
r11# running-config startup-config 保存當前配置
注意概念:
nvram:非易失性內存,斷電信息不會丟失 <-- 用戶配置 <-- 保存著startup-config
ram:隨機存儲器,斷電信息全部丟失 <-- 當前生效配置 <-- 保存著running-config
startup-config:在每次路由器或是交換機啟動時候,會主動載入(默認情況)
========================================================
設置說明和密碼的幾個命令:
r11(config)#banner motd [char c] 同時要以[char c]另起一行結束,描述機器登陸時的說明
r11(config-if)#description 描述介面注釋,需要在埠配置模式下
配置console口密碼:
------------------
r11(config)#line console 0 進入到consolo 0
r11(config-line)#password eliuzd 設置一個密碼為“eliuzd”
r11(config-line)#login 設置login(登陸)時使用密碼
------------------
配置enable密碼:
------------------
r11(config)#enable password cisco 設置明文的enable密碼
r11(config)#enable secret eliuzd 設置暗文的enable密碼(優先於明文被使用)
r11(config)#service password-encryption 加密系統所有明文密碼(功能較弱)
------------------
配置Telnet密碼:
------------------
r11(config)#line vty 0
r11(config-line)#password cisco
r11(config-line)#login
------------------
========================================================
配置虛擬回環介面:(回環介面默認為UP狀態)
(config)# 下,虛擬一個埠
------------------
r11(config)#interface loopback 0 創建一個回環介面loopback 0
r11(config-if)#ip address 192.168.1.1 255.255.255.0 配置它的IP地址
no * 做配置的反向操作(刪除配置)
------------------
=========================================================
路由器 DCE/DTE 僅存在廣域網中r11#show controllers serial 0 用於查看DCE與DTE的屬性,serial 0路由器廣域網埠
DCE的Router需要配置時鍾頻率
r11(config-if)#clock rate ? 配置DCE介面的時鍾頻率(系統指定頻率)
一般實際情況下,這個不需要自己配置,因為DCE設備都在運營商那。
=========================================================
r11#show interfaces serial 1
查看埠狀態,第一行提示說明
Serial1 is administratively down, Line protocol is down
沒有使用no shutdown命令激活埠
Serial1 is down, Line protocol is down
1、對方沒有no shutdown激活埠
2、線路損壞,介面沒有任何連接線纜
Serial1 is up, line protocol is down
1、對方沒有配置相同的二層協議,Serial介面default encapsulation: HDLC
2、可能沒有配置時鍾頻率
3、可能沒有正確的配置三層地址(可能)
Serial1 is up,line protocol is up
介面工作正常
========================================================
查看CDP信息的幾個命令:
r11#show cdp neighbors 查看CDP的鄰居(不含IP)
r11#show cdp neighbors detail 查看CDP的鄰居(包含三層的IP地址)
r11#show cdp entry * 查看CDP的鄰居(包含三層的IP地址)老命令
r1(config)#no cdp run 在全局配置模式關閉CDP協議(影響所有的介面)
r1(config-if)#no cdp enable 在介面下關閉CDP協議(僅僅影響指定的介面)
r11#clear cdp table 清除CDP鄰居表
r11#show cdp interface serial 1 查看介面的CDP信息
注意兩個提示:
Sending CDP packets every 60 seconds(每60秒發送cdp數據包)
HoldTime 180 seconds(每個cdp數據包保持180秒)
========================================================
r11(config)#ip host 設置靜態的主機名映射
r11#show sessions 查看設置過的映射主機名
========================================================
Telnet *.*.*.* 被telnet的設備,需要設置line vty的密碼,如果需要進入特權模式需要配置enable密碼
例:
------------------
Router#telnet 192.168.1.1
------------------
Router#show users 查看登錄到本地的用戶
Router#show sessions 查看從本地telnet外出的會話
Router#clear line * 強制中斷“telnet到本地”的會話
Router#disconnect * 強制中斷“telnet外出”的會話
========================================================
以下只是在實驗時連接交換機上切換登陸路由器的命令,可以跳過。
>show hosts 顯示當前的主機名配置
>show sessions 顯示當前的外出TELNET會話
>clear line XXX 清除線路
+ 直接返回到特權模式
++<6> + x
========================================================
Access-enable允許路由器在動態訪問列表中創建臨時訪問列表入口
Access-group把訪問控制列表(ACL)應用到介面上
Access-list定義一個標準的IP ACL
Access-template在連接的路由器上手動替換臨時訪問列表入口
Appn向APPN子系統發送命令
Atmsig 執行ATM信令命令
B 手動引導操作系統
Bandwidth 設置介面的帶寬
Banner motd 指定日期信息標語
Bfe 設置突發事件手冊模式
Boot system 指定路由器啟動時載入的系統映像
Calendar 設置硬體日歷
Cd 更改路徑
Cdp enable 允許介面運行CDP協議
Clear 復位功能
Clear counters 清除介面計數器
Clear interface 重新啟動介面上的件邏輯
Clockrate 設置串口硬體連接的時鍾速率,如網路介面模塊和介面處理器能接受的速率
Cmt 開啟/關閉FDDI連接管理功能
Config-register 修改配置寄存器設置
Configure 允許進入存在的配置模式,在中心站點上維護並保存配置信息
Configure memory 從NVRAM載入配置信息
Configure terminal 從終端進行手動配置
Connect 打開一個終端連接
Copy 復制配置或映像數據
Copy flash tftp 備份系統映像文件到TFTP伺服器
Copy running-config startup-config 將RAM中的當前配置存儲到NVRAM
Copy running-config tftp 將RAM中的當前配置存儲到網路TFTP伺服器上
Copy tftp flash 從TFTP伺服器上下載新映像到Flash
Copy tftp running-config 從TFTP伺服器上下載配置文件
Debug 使用調試功能
Debug dialer 顯示介面在撥什麼號及諸如此類的信息
Debug ip rip 顯示RIP路由選擇更新數據
Debug ipx routing activity 顯示關於路由選擇協議(RIP)更新數據包的信息
Debug ipx sap 顯示關於SAP(業務通告協議)更新數據包信息
Debug isdn q921 顯示在路由器D通道ISDN介面上發生的數據鏈路層(第2層)的訪問過程
Debug ppp 顯示在實施PPP中發生的業務和交換信息
Delete 刪除文件
Deny 為一個已命名的IP ACL設置條件
Dialer idle-timeout 規定線路斷開前的空閑時間的長度
Ⅱ 知道思科路由器上保存命令的幫下忙
1、首先交換機連接電源線。
Ⅲ cisco路由器中保存路由器ram配置文件到nvram中的命令是什麼
run start 意思是把當前正在運行的配置保存為開機配置至NVram 。。一般是配置改動以後將改動保存 以免路由器關機以後新配置消失 因為RAM 斷電就掉數據。
當然要做備份的話 可以保存至 run tftp 或者 start tftp (如果這兩個一樣的話)保存至tftp伺服器
當然破解密碼也要用上。。
Ⅳ cisco packet tracer 怎麼在斷電後保存配置的命令
關掉時,pt會詢問是否保存,選是就可以了,連路由器里沒保存的都保存了。
你說的保存不是指路由器里保存配置吧?
running-config startup-config或者write,最省事就是wr。
Ⅳ 思科交換機保存命令的幾個版本
3個。
給交換機配置使能密碼,進入特權模式時需要輸入密碼才能進入,避免設備可以被其他人員使用。
交換機配置VLAN,並給將埠加入到該VLAN。最後使用show:查看命令,交換機的所有配置和其它相關信息都需要通過show命令查看。
Ⅵ 思科交換機的配置保存命令
1、首先打開思科交換CLI,從特權模式進入全局配置模式,如下圖所示。
Ⅶ CISCO的交換機,進行配置後如何保存
1、首先打開思科交換CLI,從特權模式進入全局配置模式,如下圖所示。
Ⅷ Cisco常用的路由器交換機配置命令
cisco製造的路由器設備、交換機和其他設備承載了全世界80%的互聯網通信,成為矽谷中新經濟的傳奇,那麼你了解Cisco常用的路由器交換機配置命令嗎?下面是我整理的一些關於Cisco常用的路由器交換機配置命令的相關資料,供你參考。
Cisco常用的路由器支持的命令:
路由器顯示命令:
router#show run ;顯示配置信息
router#show interface ;顯示介面信息
router#show ip route ;顯示路由信息
router#show cdp nei ;顯示鄰居信息
router#reload ;重新起動
路由器口令設置:
router>enable ;進入特權模式
router#config terminal ;進入全局配置模式
router(config)#hostname ;設置交換機的主機名
router(config)#enable secret xxx ;設置特權加密口令
router(config)#enable password xxb ;設置特權非密口令
router(config)#line console 0 ;進入控制台口
router(config-line)#line vty 0 4 ;進入虛擬終端
router(config-line)#login ;要求口令驗證
router(config-line)#password xx ;設置登錄口令xx
router(config)#(Ctrl+z) ; 返回特權模式
router#exit ;返回命令
路由器配置:
router(config)#int s0/0 ;進入Serail介面
router(config-if)#no shutdown ;激活當前介面
router(config-if)#clock rate 64000 ;設置同步時鍾
router(config-if)#ip address ;設置IP地址
router(config-if)#ip address second ;設置第二個IP
router(config-if)#int f0/0.1 ;進入子介面
router(config-subif.1)#ip address ;設置子介面IP
router(config-subif.1)#encapsulation dot1q ;綁定vlan中繼協議
router(config)#config-register 0x2142 ;跳過配置文件
router(config)#config-register 0x2102 ;正常使用配置文件
router#reload ;重新引導
路由器文件操作:
router# running-config startup-config ;保存配置
router# running-config tftp ;保存配置到tftp
router# startup-config tftp ;開機配置存到tftp
router# tftp flash: ;下傳文件到flash
router# tftp startup-config ;下載配置文件
ROM狀態:
Ctrl+Break ;進入ROM監控狀態
rommon>confreg 0x2142 ;跳過配置文件
rommon>confreg 0x2102 ;恢復配置文件
rommon>reset ;重新引導
rommon> xmodem: flash: ;從console傳輸文件
rommon>IP_ADDRESS=10.65.1.2 ;設置路由器IP
rommon>IP_SUBNET_MASK=255.255.0.0 ;設置路由器掩碼
rommon>TFTP_SERVER=10.65.1.1 ;指定TFTP伺服器IP
rommon>TFTP_FILE=c2600.bin ;指定下載的文件
rommon>tftpdnld ;從tftp下載
rommon>dir flash: ;查看快閃記憶體內容
rommon>boot ;引導IOS
靜態路由:
ip route ;命令格式
router(config)#ip route 2.0.0.0 255.0.0.0 1.1.1.2 ;靜態路由舉例
router(config)#ip route 0.0.0.0 0.0.0.0 1.1.1.2 ;默認路由舉例
動態路由:
router(config)#ip routing ;啟動路由轉發
router(config)#router rip ;啟動RIP路由協議。
router(config-router)#network ;設置發布路由
router(config-router)#negihbor ;點對點幀中繼用。
幀中繼命令:
router(config)#frame-relay switching ;使能幀中繼交換
router(config-s0)#encapsulation frame-relay ;使能幀中繼
router(config-s0)#fram-relay lmi-type cisco ;設置管理類型
router(config-s0)#frame-relay intf-type DCE ;設置為DCE
router(config-s0)#frame-relay dlci 16 ;
router(config-s0)#frame-relay local-dlci 20 ;設置虛電路號
router(config-s0)#frame-relay interface-dlci 16 ;
router(config)#log-adjacency-changes ;記錄鄰接變化
router(config)#int s0/0.1 point-to-point ;設置子介面點對點
router#show frame pvc ;顯示永久虛電路
router#show frame map ;顯示映射
基本訪問控制列表:
router(config)#access-list permit|deny
router(config)#interface ;default:deny any
router(config-if)#ip access-group in|out ;defaultut
例1:
router(config)#access-list 4 permit 10.8.1.1
router(config)#access-list 4 deny 10.8.1.0 0.0.0.255
router(config)#access-list 4 permit 10.8.0.0 0.0.255.255
router(config)#access-list 4 deny 10.0.0.0 0.255.255.255
router(config)#access-list 4 permit any
router(config)#int f0/0
router(config-if)#ip access-group 4 in
擴展訪問控制列表:
access-list permit|deny icmp [type]
access-list permit|deny tcp [port]
例3:
router(config)#access-list 101 deny icmp any 10.64.0.2 0.0.0.0 echo
router(config)#access-list 101 permit ip any any
router(config)#int s0/0
router(config-if)#ip access-group 101 in
例3:
router(config)#access-list 102 deny tcp any 10.65.0.2 0.0.0.0 eq 80
router(config)#access-list 102 permit ip any any
router(config)#interface s0/1
router(config-if)#ip 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 ;當前介面指定為內部介面
Router(config-if)#ip nat outside ;當前介面指定為外部介面
Router(config)#ip nat inside source static [p] [port]
Router(config)#ip nat inside source static 10.65.1.2 60.1.1.1
Router(config)#ip nat inside source static tcp 10.65.1.3 80 60.1.1.1 80
Router(config)#ip nat pool p1 60.1.1.1 60.1.1.20 255.255.255.0
Router(config)#ip nat inside source list 1 pool p1
Router(config)#ip nat inside destination list 2 pool p2
Router(config)#ip nat inside source list 2 interface s0/0 overload
Router(config)#ip nat pool p2 10.65.1.2 10.65.1.4 255.255.255.0 type rotary
Router#show ip nat translation
rotary 參數是輪流的意思,地址池中的IP輪流與NAT分配的地址匹配。
overload參數用於PAT 將內部IP映射到一個公網IP不同的埠上。
外部網關協議配置
routerA(config)#router bgp 100
routerA(config-router)#network 19.0.0.0
routerA(config-router)#neighbor 8.1.1.2 remote-as 200
配置PPP驗證:
RouterA(config)#username password
RouterA(config)#int s0
RouterA(config-if)#ppp authentication {chap|pap}
3.PIX防火牆命令
Pix525(config)#nameif ethernet0 outside security0 ;命名介面和級別
Pix525(config)#interface ethernet0 auto ;設置介面方式
Pix525(config)#interface ethernet1 100full ;設置介面方式
Pix525(config)#interface ethernet1 100full shutdown
Pix525(config)#ip address inside 192.168.0.1 255.255.255.0
Pix525(config)#ip address outside 133.0.0.1 255.255.255.252
Pix525(config)#global (if_name) natid ip-ip ;定義公網IP區間
Pix525(config)#global (outside) 1 7.0.0.1-7.0.0.15 ;例句
Pix525(config)#global (outside) 1 133.0.0.1 ;例句
Pix525(config)#no global (outside) 1 133.0.0.1 ;去掉設置
Pix525(config)#nat (if_name) nat_id local_ip [netmark]
Pix525(config)#nat (inside) 1 0 0
內網所有主機(0代表0.0.0.0)可以訪問global 1指定的外網。
Pix525(config)#nat (inside) 1 172.16.5.0 255.255.0.0
內網172.16.5.0/16網段的主機可以訪問global 1指定的外網。
Pix525(config)#route if_name 0 0 gateway_ip [metric] ;命令格式
Pix525(config)#route outside 0 0 133.0.0.1 1 ;例句
Pix525(config)#route inside 10.1.0.0 255.255.0.0 10.8.0.1 1 ;例句
Pix525(config)#static (inside, outside) 133.0.0.1 192.168.0.8
表示內部ip地址192.168.0.8,訪問外部時被翻譯成133.0.0.1全局地址。
Pix525(config)#static (dmz, outside) 133.0.0.1 172.16.0.8
中間區域ip地址172.16.0.8,訪問外部時被翻譯成133.0.0.1全局地址。
Cisco常用的交換機支持的命令:
交換機基本狀態:
switch: ;ROM狀態, 路由器是rommon>
hostname> ;用戶模式
hostname# ;特權模式
hostname(config)# ;全局配置模式
hostname(config-if)# ;介面狀態
交換機口令設置:
switch>enable ;進入特權模式
switch#config terminal ;進入全局配置模式
switch(config)#hostname ;設置交換機的主機名
switch(config)#enable secret xxx ;設置特權加密口令
switch(config)#enable password xxa ;設置特權非密口令
switch(config)#line console 0 ;進入控制台口
switch(config-line)#line vty 0 4 ;進入虛擬終端
switch(config-line)#login ;允許登錄
switch(config-line)#password xx ;設置登錄口令xx
switch#exit ;返回命令
交換機VLAN設置:
switch#vlan database ;進入VLAN設置
switch(vlan)#vlan 2 ;建VLAN 2
switch(vlan)#no vlan 2 ;刪vlan 2
switch(config)#int f0/1 ;進入埠1
switch(config-if)#switchport access vlan 2 ;當前埠加入vlan 2
switch(config-if)#switchport mode trunk ;設置為干線
switch(config-if)#switchport trunk allowed vlan 1,2 ;設置允許的vlan
switch(config-if)#switchport trunk encap dot1q ;設置vlan 中繼
switch(config)#vtp domain ;設置發vtp域名
switch(config)#vtp password ;設置發vtp密碼
switch(config)#vtp mode server ;設置發vtp模式
switch(config)#vtp mode client ;設置發vtp模式
交換機設置IP地址:
switch(config)#interface vlan 1 ;進入vlan 1
switch(config-if)#ip address ;設置IP地址
switch(config)#ip default-gateway ;設置默認網關
switch#dir flash: ;查看快閃記憶體
交換機顯示命令:
switch#write ;保存配置信息
switch#show vtp ;查看vtp配置信息
switch#show run ;查看當前配置信息
switch#show vlan ;查看vlan配置信息
switch#show interface ;查看埠信息
switch#show int f0/0 ;查看指定埠信息
Ⅸ 思科交換機保存設置的命令
(1) Switch# running-config startup-config 這個命令的意思是把當前設備的運行配置保存到flash中去,以便下一次重啟後系統能夠還原到當前配置。
(2) switch#write 保存配置信息。
Ⅹ cisco交換機3550,2950配置好vlan後的保存命令是什麼
在介面配置模式下使用 do wr 或者是 do running-config startup-config
在全局配置模式下使用不帶do的命令(以上兩個).