How to set history size on routers or switches

I wanted to see more than 10 lines in time so I needed a way to have that. History can be set up on console line and/or vty lines. Here is how you will do this on a switch:

SW1>ena
SW1#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
SW1(config)#line con 0
SW1(config-line)#his
SW1(config-line)#history ?
  size  Set history buffer size
  

SW1(config-line)#history si
SW1(config-line)#history size ?
  <0-256>  Size of history buffer

SW1(config-line)#history size 256
SW1(config-line)#line vty 0 15
SW1(config-line)#hi
SW1(config-line)#history size
SW1(config-line)#history size 256
SW1(config-line)#exit
SW1(config)#exit
SW1#wr m
05:13:04: %SYS-5-CONFIG_I: Configured from console by console
SW1#wr mem
Building configuration...
[OK]
SW1#

It is the same configuration as for the switch:


R2#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
R2(config)#line con 0
R2(config-line)#his
R2(config-line)#history size 256
R2(config-line)#exit
R2(config)#line vty 0 15
R2(config-line)#hi
R2(config-line)#history si
R2(config-line)#history size 256
R2(config-line)#exit
R2(config)#exit
R2#
Jun 12 17:34:34.055: %SYS-5-CONFIG_I: Configured from console by console
R2#

It is ok when you read the commands, but if you want to copy and paste them it is difficult. So here are the commands as a script:

ena
conf t
line con 0
history size 256
exit
line vty 0 15
history size 256
exit
exit
wr mem
 

(you need to copy all, so that write memory to be executed)

Leave a Reply

Your email address will not be published. Required fields are marked *


eight − 7 =