# The Line Commands

Most network equipment has some sort of **line** command, where line refers to an asynchronous communications line (many years ago, a phone line or serial line) used to connect to a terminal. Each type of line refers to a physical or virtual terminal. Try the command **show line** to see what lines are configured on your device.

<figure><img src="https://3809111052-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxRpMyC8oFVYcAd6lVljo%2Fuploads%2FYqrLeHjk2ghUYHQz4ord%2Fimage.png?alt=media&#x26;token=8c19a950-94b3-4e7d-bc5d-1409404af420" alt=""><figcaption></figcaption></figure>

If you do a **show run**, you can see the generic configuration.

<figure><img src="https://3809111052-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxRpMyC8oFVYcAd6lVljo%2Fuploads%2FCsjrO8kPpUmtrpIEKhJa%2Fimage.png?alt=media&#x26;token=6a7aa7e0-1a83-442e-89b4-1860bbccbf2d" alt=""><figcaption></figcaption></figure>

The console port is used to configure a brand-new router when it is taken out of the box. On Cisco equipment, this requires a non-standard cable (DB9 to RJ45), always bright blue in colour. There is only a single console line, line 0. This port must be secured to prevent someone with physical access from accessing the equipment.&#x20;

Configure console access as shown. Look up and understand all the commands I have used.

<figure><img src="https://3809111052-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FxRpMyC8oFVYcAd6lVljo%2Fuploads%2FulF1eNd99zNUV8KTRciT%2Fimage.png?alt=media&#x26;token=88f0d93b-271b-4b21-b9b5-1f497b441fda" alt=""><figcaption></figcaption></figure>

Notice the shortcut? I use **conf t** instead of **configure terminal**. From now on, you will be asked for the password each time you login! 

For ease, I will provide all the commands.

```
line con 0
 password MyConsole
 logging synchronous
 login 
 history size 10
 exec-timeout 6 50
exit
```

On a live system, console messages may show up while you are typing commands. This is a distraction and may lead to you entering incorrect commands. When you set the option logging synchronous, console messages only appear after you press **return**.&#x20;

Some equipment may have *TTY lines* (teletype), you will also come across these in Linux. These are intended for serial devices such as printers, modems, dumb terminals etc. VTY ports are virtual TTY ports which are used to telnet or SSH into a device over the network.&#x20;

Configure VTY as shown. Depending on the device, we may have five or sixteen VTY lines. The example below sets from VTY line 0-15.

```
line vty 0 15
 exec-timeout 5 30
 password MyTelnet
 logging synchronous
 login
 history size 10
exit
```

An auxiliary port is like a second or backup console port. We will set a simple example for AUX. Devices may not have an AUX port, check before configuring.

```
line aux 0
 password MyAux
end
```

Do a **show run** to validate your work. What do you notice about the passwords you have typed in? Are they secure? Is this good?&#x20;

We could create a password preventing a user from entering exec mode by typing **enable password MySecret** but this will also be in plain text, not secure. 


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://johnoraw.gitbook.io/lnp/3.cli/the-line-commands.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
