Menu

Cisco Line Menu

Hi all,

Here is a nice feature you can use on a Cisco device to make the usage easier in case of a console server or just for limiting access for an experienced user - We can create a menu with pre-configured commands \ actions.

Here is an example for I used for a terminal access server
  • Configure aliases for the host which we'll connect to 
ip host <Device-Name> <Connection-Port> <Device-IP>
ip host R2 23 1.1.1.2
ip host R3 23 1.1.1.3
  • Create a banner for the menu 
menu Menu-1 title ^
**********************************************************
    You have reached NetworkLabs-R1
Please use the menu bellow
**********************************************************
^
  • And now we create the menu 
menu Menu-1 prompt ^C Your selection : ^C
menu Menu-1 text 1 Connect to R2 - 23
menu Menu-1 text s show active sessions
menu Menu-1 text e exit the menu
menu Menu-1 text q close the connection
menu Menu-1 command 1 resume R2 /connect telnet R2
menu Menu-1 command s show sessions
menu Menu-1 command e menu-exit
menu Menu-1 command q exit
First we configured the prompt for the command selection, then the text for "1,s,e,q' then the commands that will be issued according to the selection.
  • Suggest to add the following for the menu to clear the screen and allow only and loop back to the prompt after each selection
menu Menu-1 clear-screen
menu Menu-1 line-mode
At this point the menu can be activated by running "menu Menu-1" from the command line.
you may want to add the menu to be activated automatically on VTY login by adding 
line vty 0 4
 autocommand  menu Menu-1
Hope this post was helpful, If it was please consider a donation:
BTC Address: 1CnyMpjd1RntRDxSus2hu2aDMyzL4Kj29N
LTC Address: LUqrKbzGihTU2GEnL3EwsuuLHCsxCJMdtR

0 Comments:

Post a Comment