Friday, 16 August 2019

Basic Configuration of Cisco Router and Switch

Basic Configuration of Cisco Router and Switch

This is article is about the Basic Configuration of Cisco Router and Switch. You will learn step by step how to start configuring the Cisco Router and Switch. We will start to learn the basic configuration of Cisco devices. We will take as an example the configuration of a Switch, but the commands work the same way for a Router. Before going into configurations, you must aware with the basic mode of configuration on Cisco Router.

How to configure Hostname on Cisco Devices:

To name the device you must enter the hostname command and to remove the configured hostname and return to the default input request, use the global non-
hostname configuration command . This is how we configure it on the console:

Switch> Switch> enable 
Switch # 
configure terminal Enter configuration commands, one per line. End with CNTL / Z. 
Switch (config) #hostname Sw-Floor-1 
Sw-Floor-1 (config) # Sw-Piso-1 
(config) #no hostname 
Switch (config) #


For setting the hostname on cisco devices, you should consider the following:

  • It must start with a letter
  • It must not contain spaces
  • It ends with a letter or a digit
  • Only letter, digits and hyphens are used
  • Must be less than 64 characters in length

How to set the different passwords on Cisco Devices:

DEVICE ACCESS PROTECTION


  • Protect access to EXEC modes with privileges and user EXEC with a password.

Enable password on Cisco Router:
The enable secret command provides greater security because the password is encrypted. Let's see how to do it on the console:

Switch>Switch> enable
Switch # conf terminal
Enter configuration commands, one per line. End with CNTL / Z.
Switch (config) #enable secret cisco
Switch (config) #exit

My password is  cisco, and if I go out ( exit ) to return to privileged mode, it will ask me to enter the password.
Switch # exit
Switch> enable
Password:
  • Protect virtual terminal lines with a password
Console password on Cisco Router:

Security must be provided to the console port. This reduces the chances of unauthorized personnel physically connecting a cable to the device and accessing it. We configure it as follows with password ccna_cisco
Switch # conf t
Switch (config) #line console 0
Switch (config-line) #password ccna_cisco
Switch (config-line) #login
Switch (config-line) #exit
Telnet password on Cisco Router:

The vty lines allow access to a Cisco device through Telnet or SSH. The number of vty lines supported varies by device type and IOS version. Of course we must protect them with password and do as follows with password ccna_cisco
Switch # conf t
Switch (config) #line vty 0 15
Switch (config-line) #password ccna_cisco
Switch (config-line) #login

How to ENCRYPT Your password on Cisco?


  • Cisco IOS shows passwords in plain text by default.
  • Passwords must be encrypted.

The service password-encryption command prevents passwords from appearing as unencrypted text when the configuration is displayed. The purpose of this command is to prevent unauthorized people from seeing the passwords in the configuration file.

This is how passwords appear before executing the command:
Switch # show running-config 
Building configuration ...
....
line with 0
 password Cisco
 login
!
line vty 0 4
 password ccna_cisco
 login
line vty 5 15
 password ccna_cisco
 login
And this is how passwords appear after executing the command:
Switch # conf t
Switch (config) #service password-encryption
Switch # show running-config 
Building configuration ...
...
line with 0
 password 7 0822408008
 login
!
line vty 0 4
 password 7 08FF4140081C0004160F0F01FFFF
 login
line vty 5 15
 password 7 08FF1141181C0004160F0F01FFFF

 login

CISCO DEVICE CONFIGURATION: SAVE CONFIGURATION

Finally, once the basic configuration of the IOS devices is done, we will save the configuration. First let's look at the two system files that store the device configuration:
  • startup-config : the file stored in non-volatile random access memory (NVRAM) that contains all the commands that the device will use during startup or restart. NVRAMmemory does not lose its content when the device disconnects.
  • running-config : the file stored in random access memory (RAM) that reflects the current configuration. Modifying a running configuration affects the operation of a Cisco device immediately. RAM is volatile . It loses all content when the device shuts down or restarts.
Then, to save the configuration, we "copy" the "execution" file to the "initialization" file, as follows:
Switch # copy running-config startup-config
Final Considerations:
  • If the changes made to the running configuration do not have the desired effect and the running-config file has not yet been saved, you can restore the initial configuration with the reload command .
Switch # reload
Proceed with reload? [confirm]
  • Also, if you want to delete the startup configuration use the erase startup-config command
Switch # erase startup-config 
Erasing the nvram filesystem will remove all configuration files! Continue? [confirm]
[OKAY]
Erase of nvram: complete
% SYS-7-NV_BLOCK_INIT: Initialized the geometry of nvram
Switch #
  • Finally, on a switch the command delete vlan.dat must also be issued
Switch # delete vlan.dat
Delete filename [vlan.dat]?
Delete flash: /vlan.dat? [confirm]
% Error deleting flash: /vlan.dat (No such file or directory)

How to Configure IP address on Cisco Router:

Following command will the set the IP address 176.6.32.1 on interface f0/0.
 switch(config)#interface f0/0
Router(config)# ip address 176.6.32.1 255.255.255.0
Router(config-int)# no shutdown 

Shutdown command will change the status of interface fo/o to active.

No comments:

Post a Comment