Using a Cisco terminal server

Image © Stanley Skarshaug

Image © Stanley Skarshaug

Config and use of one console cable to connect to serveral equipment
Updated 3. August 2021

Having a terminal server is handy if you have several switches, routers, firewalls, etc in your rack and you want to jump between configuring them without having to swap the terminal cable around. Having a terminal server is especially nice for remote management.

In this guide, I will take you through the steps necessary to connect to a Cisco catalyst 2960 switch, through a Cisco 2511 router as a terminal server. I will connect to the 2511 router by a console cable connected to a Linux box.

Overview

To use the terminal server you first have to set up a loopback device. Then you must add a host that is bound to an interface on the terminal server for each connected device. Lastly, the line interfaces that are used for the console connections must be correctly configured.

Loopback

To quickly jump from one device to another we must add hostnames to a list of hosts on the terminal server. This list of hosts works similar to a hosts file in Linux and Windows.

To be able to add an entry to this list we need three ingredients. An IP address, a port number, and a hostname.

In order to have an IP address, we make use of a loopback interface. For simplicity's sake, we make use of loopback device 1 and assign it an IP address and a subnet mask.

configure terminal
interface Loopback 1
ip address 10.0.0.1 255.255.255.255

It's important to make use of an IP address that is not in use on the network because it can cause issues related to multiple devices sharing the same IP address.

Ports

The asynchronous lines (aka terminal connectors) that are used to connect to the other devices are connected through ports 2001 to 2016 on the Cisco 2511 router. The first connection has port 2001, the second 2002 and so on.

In this guide, we will connect the first two connections to two catalyst switches.

Host table

How that we have an IP address and a port number to assign hostnames to, we can start to add hosts to the host table on the terminal server.

I will name the first host s1 - for switch 1, and s2 - for switch 2.

configure terminal
ip host s2 2002 10.0.0.1
ip host s1 2001 10.0.0.1

Now your host table is completed! As you can see both the interfaces can share the same IP address but will be separated by the port number.

Line configuration

The communication to the console ports is done using telnet. To make a successful connection to the console ports on the connected Cisco switches these lines must be configured.

line 1 16
session-timeout 15 !<--- "Exit after 15 minutes of inactivity"
exec-timeout 0 0 !<--- "Disable exec timeout"
no exec !<--- "Unwanted signals from the attached device will not launch"
transport input telnet !<--- "Force telnet connection"

Starting a session

After you have gone through all the trouble of setting up a host table and configured the lines, you can connect to a device by simply typing in the hostname you defined.

s2
Trying s2 (10.0.0.1, 2002)... Open

Switch>

Exit from a session

Non-English keyboards will have trouble!

To exit from a console session you must use the key combination Ctrl+Shift+6, X. In other words, you must press the keys Ctrl, Shift and the number 6 at the same time, release them, and then press the X key. This will take you back to the 2511 router. From here you can choose to disconnect from the terminal session or jump to another session.

Note: If you are using a non-English keyboard you probably will fail to send the key combination. The reason is that the key combination actually sends an ASCI "break" A workaround is to temporarily switch to a US keyboard layout on the computer you have physically connected your keyboard to.

Using a Norwegian keyboard layout on result in this output when I press Ctrl+Shift+6:

;6v

Switching to a US keyboard layout fixed the issue for me.

Manage sessions

When you return to your terminal server, you can either connect to another device on another terminal connection or you can close the one you disconnected from.

No matter what you want to do it's best to start by getting an overview of the current connections:

show sessions
Conn Host                Address             Byte  Idle Conn Name
   1 s2                  10.0.0.1               0     0 s2
*  2 s1                  10.0.0.1               0     0 s1

The terminal dump above lists two connection sessions that are established. The current session is marked by an asterisk at the beginning of the line. To reconnect to the current session press enter on your keyboard. If you want to switch to another session type in the session number on your keyboard to reconnect to connection number 1.

2
[Resuming connection 2 to s1 ... ]

You will then be taken back to the connection to switch 1. If you have more than one connection you do a similar thing, but instead, choose the correct connection for the session you want to reconnect to.

To disconnect and end a terminal session, you use the disconnect command followed by the connection number you want to disconnect from.

disconnect 2
Closing connection to s1 [confirm]