第一部分:使用历史记录和编辑功能

  Router#show version
  Router#show interface e0
  Router#show arp
  Router#show flash
  Router#ping 192.168.1.2
  Router#ping 172.16.1.1
  Router#show history //显示以前所输入的命令
  show version
  show interface e0
  show arp
  show falsh
  ping 192.168.1.2
  ping 172.161.1.1
  show history
  Router#terminal history size ? //更改历史缓冲区数值,默认为10条
  <0-256> Size of history buffer
  Router#terminal history size 30

 

常用的编辑键如下:

上箭头或Ctrl+p——显示缓冲区中上一条命令;
  下箭头或Ctrl+n——显示缓冲区中下一条命令;
  左箭头或Ctrl+b——光标左移一个字符;
  左箭头或Ctrl+f——光标右移一个字符;
  Esc+b——光标左移一个单词;
  Esc+f——光标左移一个单词;
  Ctrl+a——光标移到当前行的行首;
  Ctrl+e——使光标移到当前行的行末;
  Backspace——删除光标左边的一个字符;
  Ctrl+d——删除光标所在位置的字符;
  Ctrl+w——删除光标左边的一个单词;
  Esc+d——删除光标右边的一个单词;
  Ctrl+F——在新的一行上重复从上一次回车键开始输入的所有字符,最为适合由于系统或Debug消息显示而打断的命令输入。


第二部分:治理和使用系统日志

R1#sh logging //显示缓冲区日志
Syslog logging: enabled (9 messages dropped, 1 messages rate-limited, 0 flushes, 0 overruns, xml disabled)
Console logging: disabled
Monitor logging: disabled
Buffer logging: level debugging, 35 messages logged, xml disabled
Logging Exception size (8192 bytes)
Count and timestamp logging messages: disabled
Trap logging: disabled

Log Buffer (8192 bytes):

*Mar 16 19:31:08.539: %LINEPROTO-5-UPDOWN: Line protocol on Interface LI-Null0, changed state to up
*Mar 16 19:31:08.543: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up
*Mar 16 19:31:08.547: %LINK-3-UPDOWN: Interface Serial1/0, changed state to up
*Mar 16 19:31:08.547: %LINK-3-UPDOWN: Interface Serial1/1, changed state to up
*Mar 16 19:31:08.551: %LINK-3-UPDOWN: Interface Serial1/2, changed state to up
*Mar 16 19:31:08.555: %LINK-3-UPDOWN: Interface Serial1/3, changed state to up


R1#conf t
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#logging buffered ?
<0-7> Logging severity level
<4096-2147483647> Logging buffer size
alerts Immediate action needed (severity=1)
critical Critical conditions (severity=2)
debugging Debugging messages (severity=7)
emergencies System is unusable (severity=0)
errors Error conditions (severity=3)
informational Informational messages (severity=6)
notifications Normal but significant conditions (severity=5)
warnings Warning conditions (severity=4)
xml Enable logging in XML to XML logging buffer
<cr>

R1(config)#logging buffer //开启缓冲区日志
R1(config)#no logging console //关闭控制台日志信息显示

 

第三部分:DEBUG的使用

R1#debug ?
aaa AAA Authentication, Authorization and Accounting
aal2_xgcpspi AAL2_XGCP Service Provider Interface.
hpi HPI (54x) DSP messages
http HTTP Debugging
interface interface
ip IP information
ipc Interprocess communications debugging
ipv6 IPv6 information
ipx Novell/IPX information
isis IS-IS Information
kerberos KERBEROS authentication and authorization

.............................................................

vv-err Debug ATM Video voice signalling errors
vv-sig Debug ATM Video voice signalling
x25 X.25, CMNS and XOT information
x28 X28 mode
xcctsp External Call Control TSP information
xconnect Xconnect debugs
xsm ××× Device Manager

 

R1#debug ip ?
address IP address activity
bgp BGP information
..................................

dvmrp DVMRP protocol activity
eigrp IP-EIGRP information
error IP error debugging
flow IP Flow switching operations
ftp FTP dialogue
html HTML connections
http HTTP connections
icmp ICMP transactions
............................................................

pim PIM protocol activity
policy Policy routing
rgmp RGMP protocol activity
rip RIP protocol transactions
routing Routing table events
rsvp RSVP protocol activity
rtp RTP information
........................................

udp UDP based transactions
urd URL RenDezvous (URD)
wccp WCCP information