Here, we are helping you with the basic commands for router configuration. In this blog, you will find different commands for the different modes which will help you in practising your lab. For those who are preparing for Cisco Routing and Switching global certification, this post can be a game changer for you.

Let’s get started with the User Mode and its list of commands:    

1. USER MODE, denoted by ( Router> )

  • List of User mode commands

Router >enable (to go to privilege mode)

Router >show clock (to check current date and time)

Router >show flash: (to check contents of Flash)

Router >show hardware (to check hardware and software details)

Router >show history (to check previous commands)

Router >show inventory (to check hardware and software details)

Router >show privilege (to check current privelege level)

Router >show version (to check hardware and software specifications)

Router >show ip interface FastEthernet 0/0 (for a particular interface)

Router >show ip interface brief (brief information of all interfaces)

2. PRIVILEGE MODE, denoted by ( Router# )

  • List of Privilege mode commands

Router #configure terminal (to go to global configuration mode)

Router #show clock (to check current date and time)

Router #show flash: (to check contents of Flash)

Router #show hardware (to check hardware and software details)

Router #show history (to check previous commands)

Router #show inventory (to check hardware and software details)

Router #show privilege (to check current privelege level)

Router #show version (to check hardware and software specifications)

Router #show ip interface fastEthernet 0/0 (for a particular interface)

Router #show ip interface brief (brief information of all interfaces)

Router #show running-config (to check RAM configurations)

Router #show startup-config (to check NVRAM contents)

Router #write memory (save configurations from RAM to NVRAM)

Router#copy running-config startup-config (copy contents of RAM into NVRAM)

Router#copy startup-config running-config (copy contents of NVRAM into RAM)

Router #erase startup-config (to delete contents of NVRAM)

Router#delete flash:filename (to delete a file from flash)

Router #reload (to power cycle/reload/restart device)

Router #show users (to check for users currently accessing the router.)

3. GLOBAL CONFIGURATION MODE, denoted by  Router(config)#

  • List of basic Global mode commands

Router(config)#hostname I-Medita (to assign a name/hostname to the router)

I-Medita(config)#banner motd *message* (to assign a message of the day banner)

I-Medita(config)#banner login *message* (to assign a login banner)

  • Configure CONSOLE password

Router(config)#line console 0

Router(config-line)#password cisco

Router(config-line)#login

  • Configure AUXILIARY (AUX) password

Router(config)#line aux 0

Router(config-line)#password cisco

Router(config-line)#login

  • Configure VTY password (for a single user)

Router(config)#line vty 0

Router(config-line)#password cisco

Router(config-line)#login

  • Configure VTY password (for multiple users, say 4)

Router(config)#line vty 0 3

Router(config-line)#password cisco

Router(config-line)#login

  • Configure ENABLE MODE password

Router(config)#enable password cisco

  • Configure ENABLE MODE (SECRET) password

Router(config)#enable secret ccna

NOTE: YOU CAN’T USE the SAME PASSWORD FOR ENABLE PASSWORD AND ENABLE SECRET.

  • To encrypt all password

Router(config)#service password-encryption

  • Remove CONSOLE password

Router(config)#line console 0

Router(config-line)#no password

Router(config-line)#no login

  • Remove AUXILIARY password

Router(config)#line aux 0

Router(config-line)#no password

Router(config-line)#no login

  • Remove VTY password (for single user)

Router(config)#line vty 0

Router(config-line)#no password

Router(config-line)#no login

  • Remove VTY password (for multiple users, say 4)

Router(config)#line vty 0 3

Router(config-line)#no password

Router(config-line)#no login

  • Remove ENABLE MODE password

Router(config)#no enable password

  • Remove ENABLE MODE (SECRET) password

Router(config)#no enable secret

  • To skip DNS server lookup

Router(config)#no ip domain lookup

  • To synchronize log messages

Router(config)#line con 0

Router(config-line)#logging synchronous

  • To disable log messages

Router(config)# no logging console

  • To assign IP address on an interface

I-Medita(config)#interface fastEthernet 0/0

I-Medita(config-if)#ip address 1.0.0.1 255.0.0.0

I-Medita(config-if)#no shutdown

4. To remote access (TELNET) a router

  • Give IP on the router interface.

Router(config)#interface fastEthernet 0/0

Router(config-if)#ip address 1.0.0.1 255.0.0.0

Router(config-if)#no shutdown

  • Give enable mode password or enable secret

Router(config)#enable password/secret  “ccna”

  • Give line vty mode password

Router(config)#line vty 0

Router(config-line)#password ccna

Router(config-line)#login

  • Assign same range IP on the device from where you want to remote access router.
  • Go to command prompt and enter telnet command:

PC>telnet 1.0.0.1

5. How to assign privilege levels?

  • Privilege level range is from 0-15
  • 0 means conditional access, 15 means full access.
  • 1-14 means no privilege mode access

6. To remote access a router via SSH

  • Give IP on router interface.

Router(config)#interface fastEthernet 0/0

Router(config-if)#ip address 1.0.0.1 255.0.0.0

Router(config-if)#no shutdown

  • Give enable mode password or enable secret

Router(config)#enable password/secret  “ccna”

  • Create a username and assign a password

Router(config)#username ccna password ccna

  • Assign a hostname of router other than Router

Router(config)#hostname “I-Medita”

  • Create a domain name

Router(config)#ip domain name “ccna”

  • Generate a crypto key

Router(config)#crypto key generate rsa

Enter any number between 360-2048 (most preferred value is >768)

  • Go to line vty mode and give following commands:

Router(config)#line vty 0

Router(config-line)#password ccna

Router(config-line)#login local

  • Router(config)#ip ssh version 2
  • Assign same range IP on a device from where you want to remote access router.

7. Steps for password recovery on a router

  • Power on/off the router.
  • Press Ctrl+Pause/Break.
  • Router will go into rommon mode (rommon>)
  • At rommon mode, give following commands:

rommon>confreg 0x2142

rommon>reset/boot/i

  • Now when router will reboot, it will not demand any type of password.
  • Do the desired configurations. Write the configurations.
  • At global mode, give following commands:

Router(config)#config-register 0x2102 and reload the router

8. IOS Backup

  • Assign an IP address on a router interface. Connect router with the device where you want to take backup of IOS.
  • Assign the same range IP address on device. The device can be a dedicated TFTP server or a device acting as a server.
  • Ensure the reachability.
  • Give the following commands:

Router#copy flash: tftp:

Source filename: Give the filename to be copied.

Address or name of remote host: Enter the IP address of a remote host or the device where you want to take backup.

9. IOS RECOVERY / DISASTER RECOVERY COMMANDS

  • At rommon mode, give following commands:
  • rommon>tftpdnld
  • rommon>IP_ADDRESS=
  • rommon>IP_SUBNET_MASK=
  • rommon>DEFAULT_GATEWAY=
  • rommon>TFTP_SERVER=
  • rommon>TFTP_FILE=
  • rommon>FE_PORT= (optional field)
  • rommon>tftpdnld
  • Enter Yes in dialogue box.

Recommended Reads: