Configuring the Console port on a Cisco Device

Configuring the Console port on a Cisco Device

The console port on a Cisco device is primarily used for out-of-band management. This is usually the primary method of configuring a device for the first time. All Cisco routers and switches have a console port. Let me show you how to configure the console port on a Cisco device.

In this example I'll be using a Cisco 2811 router.

First, I need to get into global configuration mode:

Router> enable
Router# configure terminal

Next, I need to enter the console line configuration mode. I do this with the line console 0 command:

Router(config)# line console 0

I'm now in console line configuration mode. From here I can configure various console port settings.

To set a password on the console port, I use the password command:

Router(config-line)# password cisco

To enable password checking, I need to use the login command:

Router(config-line)# login

I can also set the console session timeout. This determines how long a console session can remain idle before being automatically disconnected. The timeout is configured using the exec-timeout command:

Router(config-line)# exec-timeout 5 0

The first number is minutes, the second is seconds. So in this example, the console session will timeout after 5 minutes of inactivity.

To set the console session to never timeout, I can use:

Router(config-line)# exec-timeout 0 0

I can also control logging messages that appear on the console. By default, all logging messages are sent to the console. To prevent logging messages from interrupting my console session, I can use the logging synchronous command:

Router(config-line)# logging synchronous

This ensures that logging messages don't interrupt my typing and that my command line is redisplayed after any logging output.

Here's a summary of the complete console port configuration:

Router> enable
Router# configure terminal
Router(config)# line console 0
Router(config-line)# password cisco
Router(config-line)# login
Router(config-line)# exec-timeout 5 0
Router(config-line)# logging synchronous
Router(config-line)# exit
Router(config)# exit
Router#

To save the configuration, don't forget to copy the running configuration to the startup configuration:

Router# copy running-config startup-config

That's how you configure the console port on a Cisco device. These settings help secure the console access and improve the user experience when managing the device through the console connection.