h1

Cisco Terminal Server with ‘Menu’ command

September 30, 2008

To setup  a Cisco Terminal Server for your CCIE Lab you would require the following:
– Either a Cisco 2509/11 access router or 1841 with a HWIC-8A (8ports) or 28xx with a HWIC-16A (16ports) expansion card.
–  1 or 2 Octal Cables(CAB-HD8-ASYNC) to connect the Access Router(above) to every other router in your LAB, via their console ports.

To configure your Terminal Server you can setup just reverse telnet sessions with the ‘host’ command, but I prefer using the ‘Menu’ command, it looks a lot better and is more convenient to use.

This current lab setup is according to Internetwork Expert R&S Lab Workbook V4, so the menu config will be based on that. This is what is looks like:

The configuration is as follow:

Create a reverse telnet session to each router, using a loopback or any other active interface. Configure your reverse telnet ports starting at port 2002. This because the first two are already used, ie the console and aux ports. Then point 0/0 on your octal cable would use port 2002, 0/1 would use 2003,  0/2 would use 2004 etc.

interface Loopback0
ip address 172.21.1.1 255.255.255.255
!
ip host R1 2002 172.21.1.1
ip host R2 2003 172.21.1.1
ip host R3 2004 172.21.1.1
ip host R4 2005 172.21.1.1
ip host R5 2006 172.21.1.1
ip host R6 2007 172.21.1.1
ip host SW1 2008 172.21.1.1
ip host SW2 2009 172.21.1.1
ip host SW3 2010 172.21.1.1
ip host SW4 2011 172.21.1.1
ip host BB1 2012 172.21.1.1
ip host BB2 2013 172.21.1.1
ip host BB3 2014 172.21.1.1
ip host FRS 2015 172.21.1.1

Then configure the Heading, Prompt and Text for the menu:

menu TS title ^
**********************************************************
CCIE Lab Terminal Server
To exit from a device, use CTRL+SHIFT+6 then press x
**********************************************************
^
menu TS prompt ^ Your selection : ^
!
menu TS text 1 Connect to Rack1R1 - 2801
menu TS text 2 Connect to Rack1R2 - 2811
menu TS text 3 Connect to Rack1R3 - 2811
menu TS text 4 Connect to Rack1R4 - 3640
menu TS text 5 Connect to Rack1R5 - 3640
menu TS text 6 Connect to Rack1R6 - 2621xm
menu TS text 7 Connect to Rack1SW1 - 3560
menu TS text 8 Connect to Rack1SW2 - 3560
menu TS text 9 Connect to Rack1SW3 - 3560
menu TS text 10 Connect to Rack1SW4 - 3560
menu TS text 11 Connect to Rack1BB1 - 2620
menu TS text 12 Connect to Rack1BB2 - 2620
menu TS text 13 Connect to Rack1BB3 - 2620
menu TS text 14 Connect to Rack1FRS - 3640
menu TS text s show all established sessions
menu TS text c<no> clear the session by number ie: c5
menu TS text e menu-exit
menu TS text q Quit terminal server session

Then configure the commands the prompt should respond to.

The first part will open a connection or resume a existing connection based on the host configured above. The last part will close a session based on the connections host name.

menu TS command 1 resume R1 /connect telnet R1
menu TS command 2 resume R2 /connect telnet R2
menu TS command 3 resume R3 /connect telnet R3
menu TS command 4 resume R4 /connect telnet R4
menu TS command 5 resume R5 /connect telnet R5
menu TS command 6 resume R6 /connect telnet R6
menu TS command 7 resume SW1 /connect telnet SW1
menu TS command 8 resume SW2 /connect telnet SW2
menu TS command 9 resume SW3 /connect telnet SW3
menu TS command 10 resume SW4 /connect telnet SW4
menu TS command 11 resume BB1 /connect telnet BB1
menu TS command 12 resume BB2 /connect telnet BB2
menu TS command 13 resume BB3 /connect telnet BB3
menu TS command 14 resume FRS /connect telnet FRS
!
menu TS command s show sessions
menu TS options s pause
menu TS command e menu-exit
menu TS command q exit
menu TS clear-screen
menu TS line-mode
!
menu TS command c1 c1
menu TS command c2 c2
menu TS command c3 c3
menu TS command c4 c4
menu TS command c5 c5
menu TS command c6 c6
menu TS command c7 c7
menu TS command c8 c8
menu TS command c9 c9
menu TS command c10 c10
menu TS command c11 c11
menu TS command c12 c12
menu TS command c13 c13
menu TS command c14 c14

This configures the alias’s referenced by the last part above.

alias exec c1 disconnect R1
alias exec c2 disconnect R2
alias exec c3 disconnect R3
alias exec c4 disconnect R4
alias exec c5 disconnect R5
alias exec c6 disconnect R6
alias exec c7 disconnect SW1
alias exec c8 disconnect SW2
alias exec c9 disconnect SW3
alias exec c10 disconnect SW4
alias exec c11 disconnect BB1
alias exec c12 disconnect BB2
alias exec c13 disconnect BB3
alias exec c14 disconnect FRS

Then to have the menu loaded upon connection via Telnet :

line vty 0 4
autocommand  menu TS

Alternatively to load the menu manually from privileged config mode:

menu TS

The other options I configured on the menu is ‘S’ to see the open sessions. (see 1st picture below)

I would recommend starting the sessions from top to bottom so that the session number ties up with the router number etc. That way the clearing of session makes a lot more sense, as shown below:

.

Take note of the extra configuration required when using a Cisco 1841 with a HWIC-8A (8ports) or 28xx with a HWIC-16A, else your reverse telnet session will say “connection refused”. (This is not required on a Cisco 2509 or 2511).

Here is the config for a HWIC-16A with its 16 ports:
line 0/0/0 0/0/15
exec-timeout 0 0
no exec
transport input telnet
transport output none
stopbits 1
flowcontrol hardware

Advertisements

17 comments

  1. Thanks for this post! It helped out a lot! Saved me a whole lot of time trying to figure it out without any instructions.


  2. Thanks for this post.

    I have the following situation:
    I have 2 users with different privileges and I have also defined two menus TS1 and TS2. How can I set menu TS1 for user1 and menu TS2 for user2

    line vty 0 4
    login local
    autocommand ????

    Thanks in advance


    • Use the following syntax:
      #username bob autocommand TS1
      #username bruce autocommand TS2

      HTH :)


      • Thanks Wiggwire for this quick reply. It’s working but after adding the menu after autocommand:

        #username bob autocommand menu TS1
        #username bruce autocommand menu TS2

        Another issue:

        When I switch from a router R1 with Ctrl+Shift+6 ++x to the access server (without logging out from R1) and disconnect the session for R1 . If I open a new session to R1 it doesn’t ask for username and password (even from another telnet to the AS)


      • Not 100% I understand you problem.
        The AS prompt users for authentication and assigns the menu individually.
        The reverse console to R1 should not have (easiest way) authentication. (it is a lab afterall)
        Then once there is an active session to the R1 console it should be locked to that one session from the AS, there by protecting R1 from being highjacked by another unknowing person.

        Perhaps using a hierarchy of menus migth solve your problem?
        hth :)


      • Wiggwire,

        Thanks for this quick reply. It’s working but after adding menu after autocommand
        #username bob autocommand menu TS1
        #username bruce autocommand menu TS2

        Now, I have the following the situation:
        1/ I login to router R1 and switch back to the AS by Ctrl+Shift+6++x (without logging out).
        2/ Then I disconnect the session to R1
        3/ If I create a new session to R1, I still can login without providing username and password
        (even from another telnet to the AS)

        How can I forbid to get access to the router R1 if its session is disconnected from the AS??

        Thanks again for your help


  3. can we make router work like both terminal server and router (configure interfaces,routing) at the same time..


    • Yes you can by controlling the VTY access with specific usernames.
      I.e., if user “ccielab” logs in he will always get the console menu, with no access to the router cli or or functions.
      Configured with “username ccielab autocommand menu TS”
      If any other use logs in they can be presented with normal CLI prompts. Routing carries on as usual.

      hth :)


  4. Thanks for the additional HWIC-8A configuration steps!


  5. This is fully applicable for IOS 15+ :-) The only thing that I noticed is that the hivens (-) have to be replaced.


  6. i am not able to create multiple telnet connection to tty line port only one user can access at a time to a port 2004 vi putty can u tell me how can we access multiple session for same port ..


    • you cant have multiple sesssions to the same port


  7. Hi, I’ve configured my 2511 exactly the same but got stock with “open”

    Make a selection: 1
    Trying SW3 (1.1.1.1, 2001)… Open

    I read in Cisco forum that got fixed with SecureCRT but I’m using TeraTerm. Any ideas?

    supportforums.cisco.com/thread/2108242


    • Hello,

      Did anyone get to the bottom of the above problem? I’m using PuTTY and also getting the problem where it gets stuck on “Open”

      Luke


  8. Did anyone manage to resolve John’s issue above?

    I’m hitting exactly the same thing with PuTTY. Everything looks good, but can’t connect to any console sessions. Just sits on:
    Trying R2 (10.10.10.100, 2004)… Open

    Any help appreciated!
    Luke


    • All you need to do is hit enter again. This has been around for ever and not a bug or issue, as far as I’ve been using TS “Cisco Routers/2511/2811 with nm-16a cards” I’ve always had to hit before it gets prompts form the router or connected device


  9. This post is better than ciscos own documentation. Thanks very much



Please leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s