Posted on

Basic Cisco Router Configurations

This demonstration covers the basic Cisco router configuration steps, with demonstrations on how to configure host names; set the enable, console, and vty passwords; configure a message of the day banner; and configure each router for Telnet access. You will learn how to enable and disable DNS resolution, ensure that your console connection does not time out, and configure the console port so that console messages do not append to the command line. Finally, you will create a host file on each router to facilitate Telnet/SSH access.

The following are the key topics we are going to cover:

  • Configuring a host name
  • Configuring enable, console, and vty passwords
  • Configuring a message of the day (MOTD) banner
  • Enabling and disabling DNS lookup
  • Configuring a console port
  • Creating a host table for Telnet access
  • Writing a basic configuration script in Notepad

Following are the configuration we will apply to the router.

  1. Host name R1
  2. Enable password of cisco
  3. Enable console login with password cisco
  4. Telnet access (vty 0 4) with password cisco
  5. No DNS resolution
  6. Configure router so that the console port will not time out
  7. Configure router so that messages from the router to the console screen do not append to the command line
  8. Configure router to show the banner “This is R1”, when someone logs into the console port

Configuring a Host Name

A router prompt of Router> tells us we are at the user EXEC mode. Host names are useful in distinguishing network devices.

Router>
Router>enable
!---Enter Priviledged EXEC Mode---!
Router#configure terminal
!---Enter the Global Configuration Mode---!
Enter configuration commands, one per line.  End with CNTL/Z.
Router(config)#hostname R1
!---Assign the host name R1---!
R1(config)#exit
!---Return to the Priviledged EXEC Mode---!
R1#copy running-config startup-config
!---Save the running configuration to the startup configuration---!
Destination filename [startup-config]? 
!---Confirm---!

Building configuration...
[OK]

Setting the Enable, Console, and vty Passwords

In order to set a local password to control access to various privilege levels, use the enable password command in global configuration mode. To remove the password requirement, use the no form of this command.
Let’s, configure the enable, console, and vty passwords for Cisco router R1. To set the enable password, enter global configuration mode and enter the following:

R1#configure terminal
!---Enter the Global Configuration Mode---!
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#enable password cisco
!---Configure the enable password of cisco---!
R1(config)#line con 0
!---Enter the Line Configuration Mode---!
R1(config-line)#password cisco
!---Configure the enable password of cisco---!
R1(config-line)#exit
!---Return to the Global Configuration Mode---!
R1(config)#line vty 0 4
!---Enter the Line Configuration Mode for VTY 0 4---!
R1(config-line)#password cisco
!---Configure the enable password of cisco---!
R1(config-line)#^Z
R1#
*Mar  1 00:03:41.443: %SYS-5-CONFIG_I: Configured from console by console
R1#copy running-config startup-config
Destination filename [startup-config]? 
Building configuration...
[OK]

Note: In a production environment, it is a good practice to set the enable, console, and vty passwords to be different so that access to the router is controlled in a secure manner. Also, it is highly recommended that in production environments, you use the enable secret password, which is encrypted with MD5, instead of the enable password.

Configuring a Message of the Day (MOTD) Banner

To configure the message-of-the-day (MOTD) banner that displays when the user logs in to a Cisco device, use the banner motd command.

R1#
*Mar  1 00:05:42.063: %SYS-5-CONFIG_I: Configured from console by console
R1#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#banner ?
  LINE            c banner-text c, where 'c' is a delimiting character
  exec            Set EXEC process creation banner
  incoming        Set incoming terminal line banner
  login           Set login banner
  motd            Set Message of the Day banner
  prompt-timeout  Set Message for login authentication timeout
  slip-ppp        Set Message for SLIP/PPP

R1(config)#banner motd ?
  LINE  c banner-text c, where 'c' is a delimiting character

R1(config)#banner motd #
Enter TEXT message.  End with the character '#'.
This is R1
#
!---Use the banner motd command to set the motd to "This is R1" and use the "#" as the symbol that signals the beginning and end of the motd
R1(config)#exit
R1#copy running-config startup-config
Destination filename [startup-config]? 
Building configuration...
[OK]
R1#exit

Enabling and Disabling DNS Lookup

R1#
R1#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#ip domain-lookup
!---Enable ip domain lookup. By default this is enabled. ---!
R1(config)#exit
R1#ccna
!---Let's examine what happens when it tries to resolve the name ccna---!
Translating "ccna"...domain server (255.255.255.255)
 (255.255.255.255)
Translating "ccna"...domain server (255.255.255.255)

% Unknown command or computer name, or unable to find computer address

R1#
R1#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#no ip domain-lookup
!---IP domain name lookups are enabled by default. To disable DNS resolution, use the above command---!
R1(config)#exit
R1#ccna
!---Let's examine what happens when it tries to resolve the name ccna when DNS lookup is diabled---!
Translating "ccna"

Translating "ccna"

% Unknown command or computer name, or unable to find computer address
R1#

Console Port Configuration

The following shows how we can avoid our connection to the console port from timing out.

R1#
R1#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#line con 0
R1(config-line)#exec-timeout ?
    Timeout in minutes

R1(config-line)#exec-timeout 0 0
!---The command exec-timeout 0 0 is the same as no exec-timeout---!   
R1(config-line)#exit
R1(config)#exit
R1#

In addition, the following command helps avoid Console Message Interrupts When Typing the configure terminal Command

R1(config)#exit
R1#c
*Mar  1 00:01:34.631: %SYS-5-CONFIG_I: Configured from console by consoleopy running-config
!--- Here is the Problem---!
R1#

R1#
R1#configure terminal
Enter configuration commands, one per line. End with CNTL/Z.
R1(config)#line con 0
R1(config-line)#logging synchronous
!---The Solution---!
R1(config-line)#exit
R1(config)#exit
R1#wr
*Mar 1 00:15:12.527: %SYS-5-CONFIG_I: Configured from console by console
R1#wr
Building configuration...
[OK]
R1#

Creating a Host Table for Telnet Access

This is a static name-to-address mapping on the router. This can be used in place of typing an IP Address when you want to telnet or ssh from the router.

R1#
R1#configure terminal
Enter configuration commands, one per line.  End with CNTL/Z.
R1(config)#ip host R2 192.168.1.22
R1(config)#ip host R3 192.168.1.33
R1(config)#ip host R4 192.168.1.44
R1(config)#exit
R1#

Leave a Reply