Managing Connections, Menus, and System Banners

Last Revised: December 3, 2010

Management of connections to other hosts, banner messages for router users, and creation of menus for specific user tasks consists of many optional features that provide better support for users on your network.

Finding Feature Information

Your software release may not support all the features documented in this module. For the latest feature information and caveats, see the release notes for your platform and software release.

Use Cisco Feature Navigator to find information about platform support and Cisco software image support. To access Cisco Feature Navigator, go to http://www.cisco.com/go/cfn.An account on Cisco.com is not required.

Information About Managing Connections, Menus, and System Banners

Escape fromTerminal Sessions and Switch to Other Connections

After you have started a connection, you can escape out of the current terminal session by using the escape key sequence (Ctrl-Shift-6 then X by default). You can type the command character as you hold down the Ctrl key or with the Ctrl key released; you can type either uppercase or lowercase letters.

Note In screen output examples that show two caret (^^) symbols together, the first caret represents the Control key (Ctrl) and the second caret represents the key sequence Shift-6. The double-caret combination (^^) means hold down the Ctrl key while you press the Shift and the 6 key.

By default, the escape key sequence is Ctrl-Shift-6, X. However, the escape key sequence can be changed using the escape-character line configuration command. To determine the current setting for the escape character, use the show terminal privileged or user EXEC command.

You can have several concurrent sessions open and switch back and forth between them.

The number of sessions that can be open at one time is defined by the session-limit VDPN configuration mode command.

Banner Tokens

Banners can be customized with the use of banner tokens. Tokens are keywords in the form $(token) that, when used in a banner message, display the currently configured value of the token argument (for example, the router hostname, domain name, or IP address). Using these tokens, you can design your own banners that will display current Cisco IOS configuration variables. Only Cisco IOS supported tokens may be used. There is no facility for you to define your own tokens.

Exit a Session Started from a Router

The protocol used to initiate a session determines how you exit that session.To exit from SLIP and PPP connections, you must hang up the dial-in connection, usually with a command that your dial-in software supports.

To exit a local area transport (LAT), Telnet, rlogin, TN3270, or X.3 packet assembler/disassembler (PAD) session begun from the router to a remote device, press the escape key sequence (Ctrl-Shift-6 then X [Ctrl^X] by default for some systems, Ctrl-Z by default for other systems) and enter the disconnect command at the EXEC prompt. You can also log out of the remote system.

You can use either the exit or logout command in EXEC mode to terminate an active terminal session.

Log Out of a Router

The method you use to logout from or disconnect from a router depends on where you are located in relation to the router, and the port on the router to which you log in.

If your terminal or computer running a terminal-emulation application is remotely connected to the console port of the router, you disconnect by issuing the command or key sequence used by your terminal-emulation package. For example, if you are on a Macintosh computer running the application TCP/Connect from InterCon Corporation, you would press Ctrl-] at the user or privileged EXEC prompt to disconnect.

If you are on a remote terminal and connect to a vty through a synchronous interface on the router, you can issue one of the following commands in user EXEC or privileged EXEC mode to log out:

•exit

•logout

Create Menus

A menu is a displayed list of actions from which a user can select without needing to know anything about the underlying command-level details. A menu system (also known as a user menu) effectively controls the functions a user can access. Figure 6 illustrates the parts that make up a typical menu.

Figure 6 Typical Menu Example

Any user that can enter configuration mode can create menus. Remember the following guidelines when you create menus:

•Each menu item represents a single user command.

•The menu system default is a standard "dumb" terminal that displays text only in a 24-line-by-80-column format.

•A menu can have no more than 18 menu items. Menus containing more than 9 menu items are automatically configured as single-spaced menus; menus containing 9 or fewer menu items are automatically configured as double-spaced menus, but can be configured as single-spaced menus using the menu single-space global configuration command. (For more information about menu display configuration options, see the section "Specifying Menu Display Configuration Options" later in this chapter.)

•Item keys can be numbers, letters, or strings. If you use strings, you must configure the menu line-mode global configuration command.

•When you construct a menu, always specify how a user exits a menu and where the user goes. If you do not provide an exit from a menu—such as with the menu-exit command (described in the section "Specifying the Underlying Command for the Menu Item" later in this chapter), the user will be trapped.

The exec-timeout line configuration command can be used to close and clean up an idle menu; the session-timeout command can be used to clean up a menu with an open connection.

Enable or Disable the Display of Banners

You can control display of the MOTD and line-activation (EXEC) banners. By default, these banners are displayed on all lines. To enable or disable the display of such banners, use the following commands in line configuration mode, as needed:

•no exec-banner—Suppresses the display of MOTD and EXEC banners.

•exec-banner—Reinstates the display of the EXEC or MOTD banners.

•no motd-banner—Suppresses the display of MOTD banners.

•motd-banner—Reinstates the display of the MOTD banners.

These commands determine whether the router will display the EXEC banner and the MOTD banner when an EXEC session is created. These banners are defined with the banner motd and banner exec global configuration commands. By default, the MOTD banner and the EXEC banner are enabled on all lines.

Disable the EXEC and MOTD banners using the no exec-banner command.

The MOTD banners can also be disabled by the no motd-banner line configuration command, which disables MOTD banners on a line. If the no exec-banner command is configured on a line, the MOTD banner will be disabled regardless of whether the motd-banner command is enabled or disabled. Table 9 summarizes the effects of the combination of the exec-banner command and the motd-banner command.

For reverse Telnet connections, the EXEC banner is never displayed. Instead, the incoming banner is displayed. The MOTD banner is displayed by default, but it is disabled if either the no exec-banner command or no motd-banner command is configured. Table 10 summarizes the effects of the combination of the exec-banner command and the motd-banner command for reverse Telnet connections.

Escaping Terminal Sessions and Switching to Other Connections

To switch between sessions by escaping one session and resuming a previously opened session, perform the following steps:

Step 1 Escape out of the current session by pressing the escape key sequence (Ctrl-Shift-6 then X [Ctrl^, X] by default) and return to the EXEC prompt.

Step 2 Enter the where privileged EXEC command to list the open sessions. All open sessions associated with the current terminal line are displayed.

Step 3 Enter the resume privileged EXEC command and the session number to make the connection.

You also can resume the previous session by pressing the Return key.

The Ctrl^, X key combination and the where and resume privileged EXEC commands are available with all supported connection protocols (for example, Telnet).

Assigning a Logical Name to a Connection

To assign a logical name to a connection, complete the task in this section:

SUMMARY STEPS

1. enable

2. name-connection

DETAILED STEPS

Command

Purpose

Step 1

enable

Example:

Router> enable

Enables privileged EXEC mode.

•Enter your password if prompted.

Step 2

name-connection

Example:

Router# name-connection

Assigns a logical name to a connection:

•The logical name can be useful for keeping track of multiple connections.

•You are prompted for the connection number and name to assign. The where privilegedEXEC command displays a list of the assigned logical connection names.

Changing a Login Username

You can change your login username if you must match outgoing access list requirements or other login prompt requirements. A login server must be running and available to use this command. To change a login username, complete the task in this section:

SUMMARY STEPS

1. login

DETAILED STEPS

Command

Purpose

Step 1

login

Example:

Router# login

Allows you to log in to the system a second time for the purposes of changing your login name.

•When you enter this command, the system prompts you for a username and password. Enter the new username and the original password. If the username does not match, but the password does, the Cisco IOS software updates the session with the new username used by the login command attempt.

Examples

In this example, assume that a user logged in as user1 needs to change the login name to user2:

Router> login

Username: user2

Password: <letmein>

Router>

In this example, the password letmein is the same password used at the initial login. (The angle brackets in the example indicate that the password is not displayed on the screen when entered.) At the second Router> prompt, the user is now logged in as user2.

Troubleshooting Tips

If no username and password prompts appear, the network administrator did not specify that a username and password be required at login time. If both the username and password are entered correctly, the session becomes associated with the specified username.

Accessing a System with TACACS Security

To access a system with TACACS security, enter your login name or specify a TACACS server by using the user@tacacs-server syntax when the "Username:" prompt appears, complete the tasks in this section:

SUMMARY STEPS

1. login

2. Username: user@tacacs-server

3. Password:<password>

Command

Purpose

Step 1

login

Example:

Router> login

Allows you to log in to the system a second time for the purposes of changing your login name.

Step 2

Username: user@tacacs-server

Example:

Username: myname@company1

Specifies the new username and authenticates the name with the server specified with the tacacs-server argument.

Step 3

Password: password

Example:

Password: guessme

Specifies the TACACS password for the username specified in Step 2.

DETAILED STEPS

Examples

In the following example, user2 specifies the TACACS host host1 to authenticate the password:

Router> login

Username: user2@host1

Translating "HOST1"...domain server (131.108.1.111) [OK]

Password: <letmein2>

Troubleshooting Tips

Only the specified host (tacacs-server) is accessed for user authentication information.

If you do not specify a host, the router tries each of the TACACS servers in the list until it receives a response. If you specify a host that does not respond, no other TACACS server will be queried. The router either will deny access or it will function, according to the action specified by the tacacs-server last-resort global configuration command, if it is configured. If you specified a TACACS server host with the user@tacacs-server argument, the TACACS server specified is used for all subsequent authentication or notification queries, with the possible exception of Serial Line Internet Protocol (SLIP) address queries.

For more information on configuring TACACS, refer to the tacacs-server host global configuration command in the "TACACS, Extended TACACS, and TACACS+ Commands" chapter of the Cisco IOS Security Command Reference.

•line line-number —Terminates the TCP connection on the specified tty line. All TCP sessions initiated from that tty line are also terminated.

•local host-name port remote host-name port—Terminates the specific TCP connection identified by the hostname/port pair of the local and remote router.

DETAILED STEPS

Disconnecting a Line

To disconnect a line, complete the task in this section:

SUMMARY STEPS

1. enable

2. disconnect [connection]

Command or Action

Purpose

Step 1

enable

Example:

Router> enable

Enables privileged EXEC mode.

•Enter your password if prompted.

Step 2

disconnect [connection]

Example:

Router# disconnect

Disconnects a line.

Note Avoid disconnecting a line to end a session. Instead, log out of the host to allow the router to clear the connection. You should disconnect a line only if you cannot log out of an active session (for example, if the line is stuck or frozen).

If your terminal or computer running a terminal-emulation application is connected physically to the console port of the router, you can also disconnect from the router by physically disconnecting the cable from the console port of the router.

DETAILED STEPS

Configuring Terminal Messages

To configure messages that can be displayed to terminal users that connect to the system, perform any of the tasks found in the following sections. All tasks are optional.

Enabling an Idle Terminal Message

To enable the idle terminal message, complete the tasks in this section:

SUMMARY STEPS

1. enable

2. configure line

3. vacant-message [d message d]

Command or Action

Purpose

Step 1

enable

Example:

Router> enable

Enables privileged EXEC mode.

•Enter your password if prompted.

Step 2

configureline

Example:

Router# configure line

Enters line configuration mode.

Step 3

vacant-message [d message d]

Example:

Router(config-line)# vacant-message &tty# is now available

<blank line>

Press RETURN to get started.&

Configures the system to display an idle terminal message. The argument d indicates any delimiting character.

Note You can configure the system to display a message when a console or terminal is not in use. Also called a vacant message, this message is different from the banner message displayed when a user logs in to the system.

DETAILED STEPS

Troubleshooting Tips

Commands requiring a delimiting character (the d argument) are used throughout this chapter. Any character can be used as the delimiting character, but we recommend the use of the quote sign ("), because this character is unlikely to be needed within the message itself. Other commonly used delimiting characters include the percent sign (%) or the forward slash (/), but because these characters have meanings within certain Cisco IOS commands, they are not recommended. For example, to set the vacant message to This terminal is idle you would enter the command vacant-message " This terminal is idle ".

Configuring a "Line in Use" Message

To configure the system to display a "line in use" message when an incoming connection is attempted and all rotary group or other lines are in use, complete the task in this section:

SUMMARY STEPS

1. enable

2. configure line

3. refuse-message d message d

Command or Action

Purpose

Step 1

enable

Example:

Router> enable

Enables privileged EXEC mode.

•Enter your password if prompted.

Step 2

configureline

Example:

Router# configure line

Enters line configuration mode.

Step 3

refuse-message d message d

Example:

Router(config-line)# refuse-message & line in use &

Configures the system to display a "line in use" message. The argument d indicates any delimiting character.

Note If you do not define such a message, the user receives a system-generated error message when all lines are in use. You also can use this message to provide the user with further instructions.

DETAILED STEPS

Configuring a "Host Failed" Message

To configure the system to display a "host failed" message when a Telnet connection with a specific host fails, complete the task in this section:

SUMMARY STEPS

1. enable

2. configure line

3. busy-message d message d

Command or Action

Purpose

Step 1

enable

Example:

Router> enable

Enables privileged EXEC mode.

•Enter your password if prompted.

Step 2

configureline

Example:

Router# configure line

Enters line configuration mode.

Step 3

busy-message hostname d message d

Example:

Router(config-line)# busy-message network1 & host failed &

Configures the system to display a "host failed" message. The argument d indicates any delimiting character.

DETAILED STEPS

Enabling Terminal Banners

Banners are informational messages that can be displayed to users. To enable terminal banners, perform any of the tasks in the following sections. All tasks are optional.

Configuring a Message-of-the-Day Banner

You can configure a message-of-the-day (MOTD) banner to be displayed on all connected terminals. This banner is displayed at login and is useful for sending messages (such as impending system shutdowns) that affect all network users. To configure the MOTD banner, complete the tasks in this section:

SUMMARY STEPS

1. enable

2. configure terminal

3. banner motd d message d

Command or Action

Purpose

Step 1

enable

Example:

Router> enable

Enables privileged EXEC mode.

•Enter your password if prompted.

Step 2

configure terminal

Example:

Router# configure terminal

Enters global configuration mode.

Step 3

banner motd d message d

Example:

Router(config)# banner motd &system will be unavailable from 15:00 to 19:00 today&

Configures the system to display a message-of-the-day banner. The argument d indicates any delimiting character.

DETAILED STEPS

Configuring a Login Banner

You can configure a login banner to be displayed on all connected terminals after the MOTD banner appears and before the login prompts. To configure a login banner, complete the tasks in this section:

Configures the system to display a banner before the username and password login prompts. The argument d indicates any delimiting character.

Note The login banner cannot be disabled on a per-line basis. To globally disable the login banner, you must delete the login banner with the no banner login command.

DETAILED STEPS

Configuring an EXEC Banner

You can configure a banner to be displayed whenever an EXEC process is initiated. For example, this banner will be displayed to a user using Telnet to access the system after entering a username and password, but before the user EXEC mode prompt is displayed. To configure an EXEC banner, complete the tasks in this section:

Configures the system to display a banner when there is an incoming connection to a terminal line from a host on the network. The argument d indicates any delimiting character.

Note You can include tokens in the form $(token) in the message text. Tokens will be replaced with the corresponding configuration variable.

Note You can configure a banner to be displayed on terminals connected to reverse Telnet lines to provide instructions to users of these types of connections. Reverse Telnet connections are described in more detail in the "Configuring and Managing External Modems" chapter of the Release 12.4 Cisco IOS Dial Technologies Configuration Guide.

DETAILED STEPS

Configuring a SLIP-PPP Banner Message

To configure a SLIP-PPP banner message, complete the tasks in this section:

Configures a SLIP-PPP banner to display a customized message. The argument d indicates any delimiting character.

Note Default banner messages have been known to cause connectivity problems in some non-Cisco SLIP and PPP dialup software. You can customize the SLIP-PPP banner message to make Cisco SLIP and PPP compatible with non-Cisco dialup software.

Note You can include tokens in the form $(token) in the message text. Tokens will be replaced with the corresponding configuration variable.

DETAILED STEPS

Creating a Menu Task List

To create menus, perform the tasks described in the following sections:

Specifies the title for the menu. The argument d indicates any delimiting character.

DETAILED STEPS

Examples

The following example specifies the title that is displayed when the OnRamp menu is selected. The following four main elements create the title:

•The menu title command

•Delimiter characters that open and close the title text

•Escape characters to clear the screen (optional)

•Title text

The following example shows the command used to create the title for the menu shown in Figure 6:

Router(config)# menu OnRamp title %^[[H^[[J

Enter TEXT message. End with the character '%'.

Welcome to OnRamp Internet Services

Type a number to select an option;

Type 9 to exit the menu.

%

Router(config)#

You can position the title of the menu horizontally by preceding the title text with blank characters. You can also add lines of space above and below the title by pressing Enter.

In this example, the title text consists of the following elements:

•One-line title

•Space

•Two-line menu instruction banner

Title text must be enclosed within text delimiter characters—the percent sign character (%) in this example. Title text delimiters are characters that do not ordinarily appear within the text of a title, such as slash (/), double quote ("), or tilde (~). You can use any character that is not likely to be used within the text of the title as delimiter characters. Ctrl-C is reserved for special use and should not be used in the text of the title.

This title text example also includes an escape character sequence to clear the screen before displaying the menu. In this case the string ^[[H^[[J is an escape string used by many VT100-compatible terminals to clear the screen. To enter it, you must enter Ctrl-V before each escape character (^[).

Clearing the Screen

To clear the screen before displaying the menu, complete the tasks in this section:

SUMMARY STEPS

1. enable

2. configure terminal

3. menumenu-nameclear-screen

Command or Action

Purpose

Step 1

enable

Example:

Router> enable

Enables privileged EXEC mode.

•Enter your password if prompted.

Step 2

configure terminal

Example:

Router# configure terminal

Enters global configuration mode.

Step 3

menumenu-nameclear-screen

Example:

Router(config)# menu Access1 clear-screen

Specifies screen clearing before displaying menus and submenus.

Note This option uses a terminal-independent mechanism based on termcap entries defined in the router and the terminal type configured for the user terminal. The menu clear-screen command allows the same menu to be used on multiple types of terminals instead of terminal-specific strings being embedded within menu titles. If the termcap entry does not contain a clear string, the menu system inserts 24 new lines, causing all existing text to scroll off the top of the terminal screen.

DETAILED STEPS

Examples

The following example clears the screen before displacing the OnRamp menu or a submenu:

Router(config)# menu OnRamp clear-screen

Specifying the Menu Prompt

To specify a menu prompt, complete the tasks in this section:

SUMMARY STEPS

1. enable

2. configure terminal

3. menumenu-nameprompt d prompt d

Command or Action

Purpose

Step 1

enable

Example:

Router> enable

Enables privileged EXEC mode.

•Enter your password if prompted.

Step 2

configure terminal

Example:

Router# configure terminal

Enters global configuration mode.

Step 3

menumenu-nameprompt d promptd

Example:

Router(config)# menu Access1 prompt /

Enter TEXT message. End with the character '/'.

Select an item. /

Specifies the prompt for the menu. The argument d indicates any delimiting character.:

•A delimiting character that marks the beginning and end of a title. Text delimiters are characters that do not ordinarily appear within the text of a title, such as slash ( / ), double quote ("), and tilde (~). ^C is reserved for special use and should not be used in the text of the title.

DETAILED STEPS

Specifying the Menu Item Text

Each displayed menu entry consists of the selection key (number, letter, or string) and the text describing the action to be performed. You can specify descriptive text for a maximum number of 18 menu items. Because each menu entry represents a single user interface command, you must specify the menu item text one entry at a time. To specify the menu item text, complete the tasks in this section:

SUMMARY STEPS

1. enable

2. configure terminal

3. menumenu-name textmenu-item menu-text

Command or Action

Purpose

Step 1

enable

Example:

Router> enable

Enables privileged EXEC mode.

•Enter your password if prompted.

Step 2

configure terminal

Example:

Router# configure terminal

Enters global configuration mode.

Step 3

menumenu-nametext menu-item menu-text

Example:

Router(config)# menu Access1 text 1 Read email

Specifies the text for the menu item.

DETAILED STEPS

Examples

The following example specifies the text that is displayed for the three entries in the OnRamp menu:

Router(config)# menu OnRamp text 1 Read email

Router(config)# menu OnRamp text 2 UNIX Internet Access

Router(config)# menu OnRamp text 9 Exit menu system

You can provide access to context-sensitive help by creating a "help server" host and using a menu entry to make a connection to that host.

Troubleshooting Tips

Menu selection keys need not be contiguous. You can provide consistency across menus by assigning a particular number, letter, or string to a special function—such as Help or Exit—regardless of the number of menu entries in a given menu. For example, menu entry H could be reserved for help across all menus.

When more than nine menu items are defined in a menu, the menu line-mode and menu single-space global configuration commands are activated automatically. The commands can be configured explicitly for menus of nine items or fewer. For more information on these commands, see the section "Specifying Menu Display Configuration Options" later in this chapter.

Specifying the Underlying Command for the Menu Item

Each displayed menu entry issues a user interface command when the user enters its key. Each menu entry can have only a single command associated with it. To specify the underlying menu item command, complete the tasks in this section:

SUMMARY STEPS

1. enable

2. configure terminal

3. menumenu-name command menu-item command

Command or Action

Purpose

Step 1

enable

Example:

Router> enable

Enables privileged EXEC mode.

•Enter your password if prompted.

Step 2

configure terminal

Example:

Router# configure terminal

Enters global configuration mode.

Step 3

menumenu-namecommand menu-item command

Example:

Router(config)# menu OnRamp command 1 rlogin mailsys

Specifies the command to be performed when the menu item is selected.

DETAILED STEPS

Examples

The following example specifies the commands that are associated with the three entries in the OnRamp menu:

Router(config)# menu OnRamp command 1 rlogin mailsys

Router(config)# menu OnRamp command 2 rlogin unix.cisco.com

Router(config)# menu OnRamp command 9 menu-exit

Troubleshooting Tips

The menu-exit command is available only from within menus. This command provides a way to return to a higher-level menu or to exit the menu system.

When a menu item allows you to make a connection, the menu item should also contain entries that can be used to resume connections; otherwise, when you try to escape from a connection and return to the menu, there is no way to resume the session. It will sit idle until you log out.

You can build the resume connection user EXEC command into a menu entry so that the user can resume a connection, or you can configure the line using the escape-char none command to prevent users from escaping their sessions.

Specifying Connection Resumption

To specify connection resumption as part of the menu item command, complete the tasks in this section:

Specifies that the resume command will be performed when the menu item is selected:

•Embedding the resume command within the menu command permits a user to resume the named connection or make another connection using the specified name, if there is no active connection by that name. As an option, you can also supply the connect string needed to connect initially. When you do not supply this connect string, the command uses the specified connection name.

•You can use the resume command in the following menu entries:

–Embedded in a menu entry

–As a separate, specific menu entry

–As a "rotary" menu entry that steps through several connections

DETAILED STEPS

Examples

In the following example, the resume command is embedded in the menu command so that selecting the menu item either starts the specified connection session (if one is not already open) or resumes the session (if one is already open):

In the following example, the resume command is used in a separate menu entry (entry 3) to resume a specific connection:

Router(config)# menu newmenu text 3 Resume UNIX Internet Access

Router(config)# menu newmenu command 3 resume unix.cisco.com

Using the resume/next Command

You use the resume/next command to resume the next open connection in the user list of connections. This command allows you to create a single menu entry that advances through all of the user connections. To specify resume/next connection resumption as part of the menu item command, complete the tasks in this section:

SUMMARY STEPS

1. enable

2. configure terminal

3. menu menu-namecommandmenu-itemresume/next

Command or Action

Purpose

Step 1

enable

Example:

Router> enable

Enables privileged EXEC mode.

•Enter your password if prompted.

Step 2

configure terminal

Example:

Router# configure terminal

Enters global configuration mode.

Step 3

menumenu-namecommand menu-item resume/next

Example:

Router(config)# menu newmenu command 6 resume/next

Specifies resume/next connection resumption.

DETAILED STEPS

Examples

The following example shows a menu entry (entry 6) created to advance through all of the user connections:

Router(config)# menu newmenu text 6 Resume next connection

Router(config)# menu newmenu command 6 resume/next

Specifying the Default Command for the Menu

When a user presses Enter without specifying an item, the router performs the command for the default item. To specify the default item, complete the tasks in this section:

SUMMARY STEPS

1. enable

2. configure terminal

3. menu menu-namedefaultmenu-item

Command or Action

Purpose

Step 1

enable

Example:

Router> enable

Enables privileged EXEC mode.

•Enter your password if prompted.

Step 2

configure terminal

Example:

Router# configure terminal

Enters global configuration mode.

Step 3

menumenu-namedefault menu-item

Example:

Router(config)# menu Access1 9 text Exit the menu

menu Access1 9 command menu-exit

menu Access1 default 9

Specifies the command to be performed when the menu user does not select a menu item.

DETAILED STEPS

Creating a Submenu

To create submenus that are opened by selecting a higher-level menu entry, use the menu command to invoke a menu in a line menu entry. To specify a submenu item command, complete the tasks in this section:

SUMMARY STEPS

1. enable

2. configure terminal

3. menumenu-nametextmenu-item menu-text

4. menumenu-namecommandmenu-itemmenumenu-name2

5. menumenu-name titledelimiter menu-title delimiter

6. menumenu-nametextmenu-item menu-text

7. menumenu-namecommandmenu-item command

Command

Purpose

Step 1

enable

Example:

Router> enable

Enables privileged EXEC mode.

•Enter your password if prompted.

Step 2

configure terminal

Example:

Router# configure terminal

Enters global configuration mode.

Step 3

menumenu-nametext menu-item menu-text

Example:

Router(config)# menu Access1 text 1 IBM Information Systems

Specifies the menu item that invokes the submenu.

Step 4

menumenu-namecommand menu-item menu menu-name2

Example:

Router(config)# menu Access1 command 1 tn3270 vms.cisco.com

Specifies the command to be used when the menu item is selected.

Step 5

Router(config)# menumenu-nametitle delimiter menu-titledelimiter

Example:

Router(config)# menu Access1 title /^[[H^[[J

Enter TEXT message. End with the character '/'.

Welcome to Access1 Internet Services

Type a number to select an option;

Type 9 to exit the menu.

/

Specifies the title for the submenu.

Step 6

menumenu-nametext menu-item menu-text

Example:

Router(config)# menu Access1 text 2 UNIX Internet Access

Specifies the submenu item.

Step 7

menumenu-namecommand menu-item command

Example:

Router(config)# menu Access1 command 2 rlogin unix.cisco.com

Specifies the command to be used when the submenu item is selected. Repeat this command as needed.

DETAILED STEPS

Examples

The following example specifies that the menu item (entry 8) activates the submenu in the OnRamp menu:

Router(config)# menu OnRamp text 8 Set terminal type

The following example specifies the command that is performed when the menu item (entry 8) is selected in the OnRamp menu:

Router(config)# menu OnRamp command 8 menu Terminals

The following example specifies the title for the Terminals submenu:

Router(config)# menu Terminals title /

Supported Terminal Types

Type a number to select an option;

Type 9 to return to the previous menu.

The following example specifies the submenu items for the Terminals submenu:

Router(config)# menu Terminals text 1 DEC VT420 or similar

Router(config)# menu Terminals text 2 Heath H-19

Router(config)# menu Terminals text 3 IBM 3051 or equivalent

Router(config)# menu Terminals text 4 Macintosh with gterm emulator

Router(config)# menu Terminals text 9 Return to previous menu

The following example specifies the commands associated with the items in the Terminals submenu:

Router(config)# menu Terminals command 1 term terminal-type vt420

Router(config)# menu Terminals command 2 term terminal-type h19

Router(config)# menu Terminals command 3 term terminal-type ibm3051

Router(config)# menu Terminals command 4 term terminal-type gterm

Router(config)# menu Terminals command 9 menu-exit

When you select entry 8 on the main menu, the following Terminals submenu appears:

Supported Terminal Types

Type a number to select an option;

Type 9 to return to the previous menu.

1 DEC VT420 or similar

2 Heath H-19

3 IBM 3051 or equivalent

4 Macintosh with gterm emulator

9 Return to previous menu

Note If you nest too many levels of menus, the system displays an error message on the terminal and returns to the previous menu level.

Creating Hidden Menu Entries

A hidden menu entry is a menu item that contains a selection key but no associated text describing the action to be performed. Include this type of menu entry to aid system administrators that provide help to users. The normal procedure is to specify a menu command but omit specifying any text for the item. To create a hidden menu item, complete the tasks in this section:

To prevent the information from being lost if the menu display clears the screen, this
command always displays a --More-- prompt before returning.

Specifying Menu Display Configuration Options

In addition to the menu clear-screen global configuration command (described in the "Specifying the Menu Title" section), the following three menu commands define menu functions:

•menu line-mode

•menu single-space

•menu status-line

Configuring the Menu to Operate in Line Mode

To configure the menu to operate in line mode, complete the task in this section:

SUMMARY STEPS

1. enable

2. configure terminal

3. menumenu-nameline-mode

DETAILED STEPS

Command or Action

Purpose

Step 1

enable

Example:

Router> enable

Enables privileged EXEC mode.

•Enter your password if prompted.

Step 2

configureterminal

Example:

Router# configure terminal

Enters global configuration mode.

Step 3

menumenu-nameline-mode

Example:

Router(config)# menu OnRamp line-mode

Configures the menu to use line mode for entering menu items:

•The line-mode option is invoked automatically when more than nine menu items are defined, but it can also be configured explicitly for menus of nine items or fewer.

•In a menu of nine or fewer items, you ordinarily select a menu item by entering the item number or a letter. In line mode, you select a menu entry by entering the item key and pressing Enter. The line mode allows you to backspace over the selection and enter another before pressing Enter to issue the command. This function allows you to change the selection before you invoke the command.

•In order to use strings as selection keys, you must enable the menu line-mode command.

Displaying Single-Spaced Menus

To use the single-space option to display single-spaced menus, complete the task in this section:

SUMMARY STEPS

1. enable

2. configure terminal

3. menumenu-namesingle-space

DETAILED STEPS

Command or Action

Purpose

Step 1

enable

Example:

Router> enable

Enables privileged EXEC mode.

•Enter your password if prompted.

Step 2

configureterminal

Example:

Router# configure terminal

Enters global configuration mode.

Step 3

menumenu-namesingle-space

Example:

Router(config)# menu Access1 single-space

Configures the specified menu to display single-spaced:

•If there are nine or fewer menu items, the Cisco IOS software ordinarily displays the menu items double-spaced. In a menu of more than nine items, the single-space option is activated automatically to fit the menu into a normal 24-line terminal screen. However, the single-space option also can be configured explicitly for menus of nine or fewer items.

Displaying an Informational Status Line

To display the informational status line, complete the task in this section:

SUMMARY STEPS

1. enable

2. configure terminal

3. menumenu-namestatus-line

DETAILED STEPS

Command or Action

Purpose

Step 1

enable

Example:

Router> enable

Enables privileged EXEC mode.

•Enter your password if prompted.

Step 2

configureterminal

Example:

Router# configure terminal

Enters global configuration mode.

Step 3

menumenu-namestatus-line

Example:

Router(config)# menu OnRamp status-line

Configures the specified menu to display a status line:

•The status-line keyword displays a line of status information about the current user at the top of the terminal screen before the menu title is displayed. This status line includes the router host name, the user line number, and the current terminal type and keymap type (if any).

Specifying per-Item Menu Options

To configure per-item menu options, complete the tasks in this section:

SUMMARY STEPS

1. enable

2. configure terminal

3. menu menu-nameoptionsmenu-itempause

4. menumenu-nameoptionsmenu-itemlogin

DETAILED STEPS

Command or Action

Purpose

Step 1

enable

Example:

Router> enable

Enables privileged EXEC mode.

•Enter your password if prompted.

Step 2

configureterminal

Example:

Router# configure terminal

Enters global configuration mode.

Step 3

menu menu-nameoptionsmenu-itempause

Example:

Router(config)# menu Access1 options 3 pause

Configures the system to pause after the specified menu item is selected by the user. Enter this command once for each menu item that pauses.

Step 4

menumenu-nameoptionsmenu-itemlogin

Example:

Router(config)# menu Access1 options 3 login

Configures the specified menu item to require a login before executing the command. Enter this command once for each menu item that requires a login.

Invoking the Menu

To invoke (access) a menu, use the following command in user EXEC or privileged EXEC mode:

SUMMARY STEPS

1. enable

2. menumenu-name

Command or Action

Purpose

Step 1

enable

Example:

Router> enable

Enables privileged EXEC mode.

•Enter your password if prompted.

Step 2

menumenu-name

Example:

Router# menu OnRamp

Invokes a preconfigured user menu:

•You can define menus containing privileged EXEC commands, but users must have privileged access when they start up the menu.

•To ensure that a menu is automatically invoked on a line, make sure the menu does not have any exit paths that leave users in an interface they cannot operate, then configure that line with the autocommand menu menu-name line configuration command. (The autocommand menu menu-name command configures the line to automatically execute the menumenu-name command when a user initiates a connection over that line.)

•Menus also can be invoked on a per-user basis by defining an autocommand command for that local username.

DETAILED STEPS

Examples

In the following example, the OnRamp menu is invoked:

Router# menu OnRamp

Welcome to OnRamp Internet Services

Type a number to select an option;

Type 9 to exit the menu.

1 Read email

2 UNIX Internet access

3 Resume UNIX connection

6 Resume next connection

9 Exit menu system

Deleting the Menu from the Configuration

To delete the menu from the configuration, complete the tasks in this section:

SUMMARY STEPS

1. enable

2. configure terminal

3. no menumenu-name

DETAILED STEPS

Command or Action

Purpose

Step 1

enable

Example:

Router> enable

Enables privileged EXEC mode.

•Enter your password if prompted.

Step 2

configureterminal

Example:

Router# configure terminal

Enters global configuration mode.

Step 3

no menumenu-name

Example:

Router(config)# no menu OnRamp

Deletes the menu by specifying the menu name.

Note In order to use the menu again, you must reconfigure the entire menu.

Examples

The following example deletes the OnRamp menu from the configuration:

Router(config)#no menu OnRamp

Configuration Examples for Connection Management, System Banners, and User Menus

Example: Changing a Login Username and Password

The following example shows how login usernames and passwords can be changed. In this example, a user currently logged in under the username user1 attempts to change that login name to user2. After entering the login command, the user enters the new username, but enters an incorrect password. Because the password does not match the original password, the system rejects the attempt to change the username.

Router> login

Username: user2

Password:

% Access denied

Still logged in as "user1"

Next, the user attempts the login change again, with the username user2, but enters the correct (original) password. This time the password matches the current login information, the login username is changed to user2, and the user is allowed access to the user login information.

Router> login

Username: user2

Password:

Router>

Example: Sending Messages to Other Terminals

The following example shows the process of sending a message to all terminal connections on the router:

Router# send *

Enter message, end with CTRL/Z; abort with CTRL/C:

this is a message^Z

Send message? [confirm]

Router#

***

***

*** Message from tty50 to all terminals:

***

this is a message

Router#

Example: Clearing a TCP/IP Connection

The following example clears a TCP connection using its tty line number. The show tcp EXEC command displays the line number (tty2) that is used in the clear tcp privileged EXEC command mode.

Router# show tcp

tty2, virtual tty from host router20.cisco.com

Connection state is ESTAB, I/O status: 1, unread input bytes: 0

Local host: 171.69.233.7, Local port: 23

Foreign host: 171.69.61.75, Foreign port: 1058

Enqueued packets for retransmit: 0, input: 0, saved: 0

Event Timers (current time is 0x36144):

Timer Starts Wakeups Next

Retrans 4 0 0x0

TimeWait 0 0 0x0

AckHold 7 4 0x0

SendWnd 0 0 0x0

KeepAlive 0 0 0x0

GiveUp 0 0 0x0

PmtuAger 0 0 0x0

iss: 4151109680 snduna: 4151109752 sndnxt: 4151109752 sndwnd: 24576

irs: 1249472001 rcvnxt: 1249472032 rcvwnd: 4258 delrcvwnd: 30

SRTT: 710 ms, RTTO: 4442 ms, RTV: 1511 ms, KRTT: 0 ms

minRTT: 0 ms, maxRTT: 300 ms, ACK hold: 300 ms

Router# clear tcp line 2

[confirm]

[OK]

The following example clears a TCP connection by specifying its local router hostname and port and its remote router hostname and port. The show tcp brief privileged EXEC command displays the local (Local Address) and remote (Foreign Address) hostnames and ports to use in the clear tcp privilegedEXEC command.

Router# show tcp brief

TCB Local Address Foreign Address (state)

60A34E9C router1.cisco.com.23 router20.cisco.1055 ESTAB

Router# clear tcp local router1 23 remote router20 1055

[confirm]

[OK]

The following example clears a TCP connection using its TCB address. The show tcp brief EXEC command displays the TCB address to use in the clear tcp EXEC command.

Router# show tcp brief

TCB Local Address Foreign Address (state)

60B75E48 router1.cisco.com.23 router20.cisco.1054 ESTAB

Router# clear tcp tcb 60B75E48

[confirm]

[OK]

Example: Configuring Banners

The following example shows how to use the banner global configuration commands to notify your users that the server will be reloaded with new software. The no exec-banner line configuration command is used to disable EXEC banners and message-of-the-day banners on the vty lines.

!

line vty 0 4

no exec-banner

!

banner exec /

This is Cisco Systems training group router.

Unauthorized access prohibited.

/

!

banner incoming /

You are connected to a Hayes-compatible modem.

Enter the appropriate AT commands.

Remember to reset anything you have changed before disconnecting.

/

!

banner motd /

The router will go down at 6pm today for a software upgrade

/

When someone connects to the router, the MOTD banner appears before the login prompt. After the user logs in to the router, the router will display the EXEC banner or incoming banner, depending on the type of connection. For a reverse Telnet login, the router will display the incoming banner. For all other connections, the router will display the EXEC banner.

Example: Configuring a SLIP-PPP Banner with Banner Tokens

The following example configures the SLIP-PPP banner using several tokens and the percent sign (%) as the delimiting character:

Router(config)# banner slip-ppp %

Enter TEXT message. End with the character '%'.
Starting $(encap) connection from $(gate-ip) to $(peer-ip) using a maximum packet size of
$(mtu) bytes... %

When a user enters the slip command, that user will see the following banner. Notice that the $(token) syntax is replaced by the corresponding configuration variable.

Starting SLIP connection from 192.168.69.96 to 172.16.80.8 using a maximum packet size of
1500 bytes...

Example: Configuring a Menu

The following example allows menu users to use Telnet to access one of three different machines. The user also can display the output of the show user EXEC command and exit the menu. One hidden menu item (configured as menu new command here show version) allows system administrators to display the current software version.

menu new title ^C

Telnet Menu

^C

menu new prompt ^C

Please enter your selection: ^C

menu new text 1 telnet system1

menu new command 1 telnet system1

menu new options 1 pause

menu new text 2 telnet system2

menu new command 2 telnet system2

menu new options 2 pause

menu new text b telnet system3

menu new command b telnet system3

menu new options b pause

menu new text me show user

menu new command me show user

menu new options me pause

menu new command here show version

menu new text Exit Exit

menu new command Exit menu-exit

menu new clear-screen

menu new status-line

menu new default me

menu new line-mode

!

Cisco and the Cisco Logo are trademarks of Cisco Systems, Inc. and/or its affiliates in the U.S. and other countries. A listing of Cisco's trademarks can be found at www.cisco.com/go/trademarks. Third party trademarks mentioned are the property of their respective owners. The use of the word partner does not imply a partnership relationship between Cisco and any other company. (1005R)

Any Internet Protocol (IP) addresses and phone numbers used in this document are not intended to be actual addresses and phone numbers. Any examples, command display output, network topology diagrams, and other figures included in the document are shown for illustrative purposes only. Any use of actual IP addresses or phone numbers in illustrative content is unintentional and coincidental.