1、show命令:
1) 全局命令:
show version ;顯示系統硬件和軟件版本、DRAM、Flash
show startup-config ;顯示寫入NVRAM中的配置內容
show running-config ;顯示當前運行的配置內容
show buffers ;詳細輸出buffer的名稱和尺寸
show stacks ;提供
路由器進程和處理器利用率信息, 用stack decode
show tech-support ;顯示幾個show命令的輸出
show access-lists ;查看訪問列表配置
2) 接口相關命令
show queueing [fair|priority|custom]
show queue e0/1 ;查看接口上隊列的設置和操作
show interface e0/1 ;
Cisco缺省的Ethernet封裝方法是ARPA
show ip interface e0/1 ;顯示指定接口的TCP/IP配置信息
3) 進程相關命令
show processes cpu ;顯示路由器CPU的使用率和當前的進程
show processes memory ;顯示路由器當前進程的內存使用情況
Show ip access-list ;顯示IP訪問列表(1-199)
Show ip arp ;顯示路由器的ARP緩存(IP、MAC、封裝類型、接口)
Show ip protocols ;顯示運行在路由器上的IP路由
協議的信息
Show ip route ;顯示IP路由表中的信息
Show ip traffic ;顯示IP流量統計信息
2、debug命令
DEBUG不應在CPU使用率超過50%的路由器上運行。
1) 限制debug輸出
在使用DEBUG獲得所需數據後,要關閉Debug
使路由器對所有消息都配置使用時間戳:
Router#service timestamps debug datetime msec localtime
Router#service timestamp log datetime msec localtime
缺省,error和debug信息僅發送到console,telnet到路由器上看不到debug和log的信息。想在telnet中看到debug和log信息:
Router#terminal monitor
Router#terminal monitor ;關閉信息輸出
Router#undebug all ;關閉debug進程及所有相關信息的輸出 |
可以應用ACL到debug以限定僅輸出要求的debug信息。
如僅查看從10.0.1.1到10.1.1.1的ICMP包:
Router(config)#access-list 101 permit icmp host 10.0.1.1 host 10.1.1.1
Router#debug ip packet detail 101 |
2) 全局debug命令:
3) 接口debug
5) IP debug
debug ip packets
3、logging命令
輸出error和其它信息到console、terminal、路由器內部buffer或一臺syslog
服務器:
Router>show logging
Cisco路由器有8種可能的logging級:0-7
Logging級別 名稱 描述
1 Emergencies 系統不能用的信息
2 Alerts 直接行動
3 Critical 緊急情形
4 Errors 錯誤信息
5 Warnings 警告信息
6 Notifications 正常但重要的情形
7 Informational 信息
8 Debugging 調試
缺省地,console、monitor、buffer的logging被設置爲debugging級,而trap(syslog)
服務器的logging被設置爲informational.
4、執行路由核心複製
core dump包含一份當前系統內存中信息的精確拷貝。捕捉包含在內存中信息的方法有:
1) 配置路由器在崩潰時執行Core Dump,
存儲到TFTP、FTP、RCP服務器:
對TFTP協議,只需指定TFTP服務器IP,不需要任何附加的配置:
Router(config)#exception dump 192.168.1.1 ;TFTP服務器的IP地址
對FTP協議的配置:
Router(config)#exception dump 192.168.1.1 ;FTP服務器的IP地址
Router(config)#ip ftp username Kevin
Router(config)#ip ftp password aloha
Router(config)#ip ftp source-interface e0
Router(config)#exception protocol ftp |
對RCP協議的配置:
Router(config)#exception protocol rcp
Router(config)#exception dump 192.168.1.1 ;RCP服務器的IP地址
Router(config)#ip rcmd remote-username Kevin
Router(config)#ip rcmd rcp-enable
Router(config)#ip rcmd rsh-enable
Router(config)#ip rcmd remote-host Kevin 192.168.1.1 kevin ; |
2) 在系統沒有崩潰的情況下,執行Core Dump命令。
Router#write core
Core Dump僅在Cisco工程師
測試和解決路由器問題時有用。
5、ping命令
ping用於測試整個網絡可達性和連通性。可在用戶EXEC模式和特權EXEC模式下使用。
IP的ping使用ICMP協議提供連通性和可能性信息,缺省只發送5個echo信息。
擴展Ping的選項有:源IP地址;服務類型;數據;包頭選項。
Ping的響應字符集
! Received an echo-reply message Q Source quench
. Timeout M Unable to fragment
U/H Destination unreachable A Administratively denied
N Network unreachable ? Unknown packet-type
P Protocol unreachable |
6、traceroute命令
traceroute用於顯示到達目標的包路徑。可在用戶模式和特權模式下使用。
Traceroute的響應:
Xx msec The RTT for each packet * Timeout
H Host unreachable U Port unreachable
N Network unreachable P Protocol unreachable
A Administratively denied Q Source quench
? Unknown packet type |