line

To identify a specific line for configuration and begin the command in line configuration mode collection mode, use the line command in global configuration mode.

line [aux | console | tty | vty] line-number [ending-line-number]
Syntax Description

aux

(Optional) Auxiliary EIA/TIA-232 DTE port. Must be addressed as relative line 0. The auxiliary port can be used for modem support and asynchronous connections.

console

(Optional) Console terminal line. The console port is DCE.

tty

(Optional) Standard asynchronous line.

vty

(Optional) Virtual terminal for remote console access.

line-number

The relative number of the terminal line (or the first line in a contiguous group) that you want to configure when the line type is specified. Numbering begins with zero.

ending-line-number

(Optional) The relative number of the last line in a contiguous group that you want to configure. If you omit the keyword, then line-number and ending-line-number are absolute rather than relative line numbers.

Defaults

There is no default line.

Command Modes

Global configuration

Command History
Release Modification

10.0

This command was introduced.

Usage Guidelines

You can address a single line or a consecutive range of lines with the line command. A line number is necessary, though, and you will receive an error message if you forget to include it.

Entering the line command with the optional line type (aux, console, tty, or vty) designates the line number as a relative line number. For example, to configure line parameters for line 7 (a TTY line), you could enter the following:

line tty 7

You also can use the line command without specifying a line type. In this case, the line number is treated as an absolute line number. For example, to configure line parameters for line 5, which can be of any type, you could enter the following:

line 5

Absolute line numbers increment consecutively and can be difficult to manage on large systems. Relative line numbers are a shorthand notation used in configuration. Internally, the Cisco IOS software uses absolute line numbers. You cannot use relative line numbers everywhere, but you can use absolute line numbers everywhere.

The absolute line number of the auxiliary port is 1. The relative line number of the auxiliary port is 0. See the modem line configuration command to set up modem support on the auxiliary port.

The software keeps a table of absolute and relative line numbers that you can display with the EXEC command show users all. A sample display follows:

Router> show users all
  Line      User     Host(s)               Idle   Location
0 con 0 chaff console
1 tty 1 Engineering printer
2 tty 2
3 tty 3 DREGGS 1:07 Katy x1111
4 tty 4 Console E3-D
5 tty 5 Mkt. demo area
6 tty 6
7 tty 7 DREGGS 14 Marie x1112
10 tty 10 . . . 135 tty 135
136 tty 136
137 tty 137 rp4-printer
140 tty 140 Braille printer
141 aux 0
142 vty 0 Denise idle DENISE-MAC.CISCO.COM
143 vty 1 Michael idle 0 DREGGS.CISCO.COM
144 vty 2
145 vty 3
146 vty 4
147 vty 5

The absolute line numbers are listed at the far left, followed by the line type, and then the relative line number. Relative line numbers always begin numbering at zero and define the type of line. Addressing the second virtual terminal line as line VTY 1, for example, is easier than remembering it as line 143---its absolute line number.

The line types are ranked as follows in the line table:

  1. Console 0 (con 0)
  2. Standard asynchronous line (TTY)
  3. Auxiliary port (aux)
  4. Virtual terminal line (VTY)
  5. Printer

The terminal from which you locally configure the router is attached to the console port. To configure line parameters for the console port, enter the following:

line con 0

The console relative line number must be 0.

Virtual terminal lines are used to allow remote access to the router. A virtual terminal line is not associated with either the auxiliary or console port. The router has five virtual terminal lines by default. However, you can create additional virtual terminal lines as described in the chapter "Configuring Protocol Translation and Virtual Asynchronous Devices" in the Cisco IOS Dial Services Configuration Guide: Terminal Services.

Configuring the console port or virtual terminal lines allows you to perform such tasks as setting communication parameters, specifying autobaud connections, and configuring terminal operating parameters for the terminal you are using.

Examples

The following example starts configuration for virtual terminal lines 0 to 4:

line vty 0 4

In the following example, the user creates and configures the maximum 100 virtual terminal lines with the no login command:

line vty 0 99
 no login

n the following example, the user eliminates virtual terminal line number 5 and all higher-numbered virtual terminal lines. Only virtual terminal lines 0 to 4 will remain.

no line vty 5

In the following example, the user configures console line 0, auxiliary line 0, and virtual terminal lines 0 to 4:

line vty 0 4
 login
line con 0
 password baskerville
line aux 0
 password Mypassword
 no exec
 access-class 1 in
 speed 19200
line vty 0
 exec-timeout 0 0
 password Mypassword
line vty 1
 exec-timeout 0 0
 password Mypassword
line vty 2
 exec-timeout 0 0
 password Mypassword
line vty 3
 password Mypassword
line vty 4
 password Mypassword