Building a customized menu
Recently i stumbled across a nice feature in Cisco IOS for building customized menus.
The “menu”-command is really old and was introduced in IOS 10.0
You can i.e. use it for building a menu for CLI-unexperienced staff to simplify troubleshooting.
First of all, you have to configure a little bit AAA as well as create a user with appropriate permissions and autocommand:
aaa new-model aaa authentication login default local aaa authentication enable default enable aaa authorization exec default localusername operator privilege 15 password 0 Oper username operator autocommand menu Operator
Simple menu
Now we configure a simple menu called “Operator”:
menu Operator title X Device Informations --------------------- Hostname: R1 Type: Router Model: 3725 Memory: 256MB IOS: 12.4(15)T6 Operator Menu --------------------- X menu Operator text 0.) exit menu Operator command 0.) exit menu Operator text 1.) show logging menu Operator command 1.) show logging menu Operator text 2.) show ip interface brief menu Operator command 2.) show ip interface brief menu Operator text 3.) show interface description menu Operator command 3.) show interface description menu Operator text 4.) show interfaces menu Operator command 4.) sh interfaces menu Operator text 5.) show interfaces errors menu Operator command 5.) sh interfaces | i protocol|Desc|CRC|late|lost|clearing menu Operator text 6.) show ip route menu Operator command 6.) show ip route menu Operator text 7.) show ip protocols menu Operator command 7.) show ip protocols menu Operator text 8.) show ip eigrp topology menu Operator command 8.) show ip eigrp topology menu Operator text 9.) show ip eigrp interfaces menu Operator command 9.) show ip eigrp interfaces menu Operator text 10.) show ip eigrp traffic menu Operator command 10.) show ip eigrp traffic menu Operator text 11.) show ip eigrp neighbors menu Operator command 11.) show ip eigrp neighbors menu Operator text 12.) show cdp neighbors menu Operator command 12.) show cdp neighbors menu Operator text 13.) show tech-support (password required) menu Operator command 13.) show tech-support menu Operator options 13.) login menu Operator prompt XYour choice: X menu Operator line-mode
The syntax is fairly self-explanatory. Try it out…
When you now telnet into your router with user “operator”, you will see the configured menu:
User Access Verification Username: operator Password: Device Informations --------------------- Hostname: R1 Type: Router Model: 3725 Memory: 256MB IOS: 12.4(15)T6 Operator Menu --------------------- 0.) exit 1.) show logging 2.) show ip interface brief 3.) show interface description 4.) show interfaces 5.) show interfaces errors 6.) show ip route 7.) show ip protocols 8.) show ip eigrp topology 9.) show ip eigrp interfaces 10.) show ip eigrp traffic 11.) show ip eigrp neighbors 12.) show cdp neighbors 13.) show tech-support (password required) Your choice:
More complex menu
If you like a more complex menu with submenu structure, try this out:
menu Operator title X Device Informations --------------------- Hostname: R1 Type: Router Model: 3725 Memory: 256MB IOS: 12.4(15)T6 Operator Menu --------------------- X menu Operator text 0.) Exit menu Operator command 0.) exit menu Operator text 1.) Interfaces menu Operator command 1.) menu Interfaces menu Operator text 2.) Routing menu Operator command 2.) menu Routing menu Operator text 3.) Support Infos menu Operator command 3.) menu Support menu Operator clear-screen menu Operator single-space menu Operator prompt XYour choice: X menu Operator line-mode menu Operator status-line menu Interfaces title X Interface Sub-Menu ---------------------- X menu Interfaces text 0.) Go back menu Interfaces command 0.) menu-exit menu Interfaces text 1.) Interface Summary menu Interfaces command 1.) show ip interface brief menu Interfaces text 2.) Interface Descriptions menu Interfaces command 2.) show interface description menu Interfaces text 3.) Interface Errors menu Interfaces command 3.) show interfaces | i protocol|Desc|CRC|late|lost|clearing menu Interfaces text 4.) Interface Traffic Rates menu Interfaces command 4.) show interfaces | i protocol|Desc|rate menu Interfaces text 5.) Interface Status (full) menu Interfaces command 5.) show interface menu Interfaces single-space menu Interfaces prompt XYour choice: X menu Interfaces line-mode menu Routing title X Routing Sub-Menu ---------------------- X menu Routing text 0.) Go back menu Routing command 0.) menu-exit menu Routing text 1.) Global menu Routing command 1.) menu Global menu Routing text 2.) EIGRP menu Routing command 2.) menu EIGRP menu Routing text 3.) OSPF menu Routing command 3.) menu ospf menu Routing single-space menu Routing prompt XYour choice: X menu Routing line-mode menu EIGRP title X Global Routing Sub-Menu ------------------------- X menu Global text 0.) Go back menu Global command 0.) menu-exit menu Global text 1.) Global Routing Table menu Global command 1.) show ip route menu Global text 2.) Static Routes menu Global command 2.) show ip route static menu Global text 3.) Directly connected Routes menu Global command 3.) show ip route connected menu Global text 4.) Summary menu Global command 4.) show ip route summary menu Global single-space menu Global prompt XYour choice: X menu Global line-mode menu Global title X EIGRP Sub-Menu ---------------------- X menu EIGRP text 0.) Go back menu EIGRP command 0.) menu-exit menu EIGRP text 1.) EIGRP Routing Table menu EIGRP command 1.) show ip route eigrp menu EIGRP text 2.) EIGRP Topology Table menu EIGRP command 2.) show ip eigrp topology menu EIGRP text 3.) EIGRP Interfaces menu EIGRP command 3.) show ip eigrp interfaces menu EIGRP text 4.) EIGRP Neighbors menu EIGRP command 4.) show ip eigrp neighbors menu EIGRP text 5.) EIGRP Traffic menu EIGRP command 5.) show ip eigrp traffic menu EIGRP single-space menu EIGRP prompt XYour choice: X menu EIGRP line-mode menu OSPF title X OSPF Sub-Menu ---------------------- X menu OSPF text 0.) Go back menu OSPF command 0.) menu-exit menu OSPF text 1.) OSPF Routing Table menu OSPF command 1.) show ip route ospf menu OSPF text 2.) OSPF Database menu OSPF command 2.) show ip ospf database menu OSPF text 3.) OSPF Interfaces menu OSPF command 3.) show ip ospf interfaces menu OSPF text 4.) OSPF Neighbors menu OSPF command 4.) show ip ospf neighbors menu OSPF text 5.) OSPF Traffic menu OSPF command 5.) show ip ospf traffic menu OSPF text 5.) OSPF Statistics menu OSPF command 5.) show ip ospf statistics menu OSPF single-space menu OSPF prompt XYour choice: X menu OSPF line-mode menu Support title X Support Sub-Menu ---------------------- X menu Support text 0.) Go back menu Support command 0.) menu-exit menu Support text 1.) Running Configuration menu Support command 1.) show run menu Support text 2.) CDP Neighbors menu Support command 2.) show cdp neighbor menu Support text 3.) CPU Usage menu Support command 3.) show processes cpu sorted | exclude 0.00%__0.00%__0.00% menu Support text 4.) Memory Usage menu Support command 4.) show processes memory sorted menu Support text 5.) Get Infos for Cisco Support menu Support command 5.) show tech-support menu Support single-space menu Support prompt XYour choice: X menu Support line-mode
cas

Super post, Need to mark it on Digg
GlenStef