Configuring Hostname, Passwords, and Banners in GNS3

Objective:

  • Configure the hostname of network devices.

  • Set up passwords for different levels of access.

  • Configure a message banner for security purposes.

Topology:

  • Two routers are connected by a serial link.

  • One PC to simulate an end device.

Topology

Step-by-Step Configuration:

Step 1: Create the GNS3 Topology

  1. Open GNS3.

  2. Drag and drop two Cisco routers (e.g., Cisco 7200 or 2800 series) onto the workspace.

  3. Create a serial connection between the two routers using the "Add a Link" tool. You can use the Serial0/0 interfaces for both routers.

  4. Add a PC to represent an end device and connect it to one of the router's Ethernet interfaces (e.g., FastEthernet 0/0).

Step 2: Basic Router Configuration

  1. Start both routers by right-clicking and selecting "Start."

  2. Access the routers via the console by right-clicking the router and selecting "Console."

Step 3: Configure Hostname

  • Enter Global Configuration mode on both routers.

Router> enable
Router# configure terminal
  • Set the hostname for both routers.

On Router1:

Router1(config)# hostname Router1

On Router2:

Router2(config)# hostname Router2
  • Verify hostname changes:

Router1# show running-config | include hostname
Router2# show running-config | include hostname

Step 4: Configure Passwords

  • Configure console password on both routers to secure local access.

On Router1:

Router1(config)# line con 0
Router1(config-line)# password cisco
Router1(config-line)# login
Router1(config-line)# exit

On Router2:

Router2(config)# line con 0
Router2(config-line)# password cisco
Router2(config-line)# login
Router2(config-line)# exit
  • Configure enable password (privileged mode) on both routers.

On Router1:

Router1(config)# enable password cisco

On Router2:

Router2(config)# enable password cisco
  • Configure enable secret (for encrypted privileged mode password) on both routers.

On Router1:

Router1(config)# enable secret cisco123

On Router2:

Router2(config)# enable secret cisco123
  • Configure vty password (for remote access):

On Router1:

Router1(config)# line vty 0 4
Router1(config-line)# password vtypassword
Router1(config-line)# login
Router1(config-line)# exit
  • On Router2:

Router2(config)# line vty 0 4
Router2(config-line)# password vtypassword
Router2(config-line)# login
Router2(config-line)# exit

Step 5: Configure Login Banner

  • Create a login banner on both routers to display a security warning message.

On Router1:

Router1(config)# banner motd #Unauthorized access is prohibited!#

On Router2:

Router2(config)# banner motd #Unauthorized access is prohibited!#
  • Verify banner configuration by checking the startup configuration.

Router1# show running-config | include banner
Router2# show running-config | include banner

Step 6: Save Configuration

  • Save the configurations to avoid losing them after a reboot.

On Router1:

Router1# copy running-config startup-config

On Router2:

Router2# copy running-config startup-config

Step 7: Verify Configuration

  • Test local console login by exiting to the user mode and then trying to enter privileged mode.

Router1> enable
Password: cisco123
Router1#

Test the same on Router2.

  • Test remote login (via VTY) using a terminal program (e.g., PuTTY or Tera Term).

Router1> telnet [Router2 IP]
Username: (Enter username if configured)
Password: vtypassword

Step 8: Final Verification

  • Verify hostname:

Router1# show running-config | include hostname
Router2# show running-config | include hostname
  • Verify password settings:

Router1# show running-config | include password
Router2# show running-config | include password
  • Verify banner:

Router1# show running-config | include banner
Router2# show running-config | include banner

Keywords

Hostname Configuration, Router Configuration, Console Password, Enable Password, Enable Secret, VTY Password, Login Banner, Message of the Day (MOTD), Global Configuration Mode, GNS3 Simulation, Cisco Routers, Access Control, Privileged Mode, Security Configuration, Router Authentication, Router Passwords, Line Configuration, Router Setup, Telnet Access, Configuration Save, سیسکو , آموزش سیسکو

Last updated