Blog Details

Basic Router & Switch Command

PurposeCommand
To See running config fileShow   running-config  

or

sh  run  

Displays configuration saved in NVRAMShow  startup-config
To see IP info of interfacesShow  ip interface brief    
To see statistics of all interfacesShow  interfaces
To see specific item from  running configuration                     Show interface f0/0  

[Only see the info of the specific interface f0/0 ]

sh  run  | section  line 

[Only see the info of all line sections]


* If you want to see only DHCP section, nothing else
sh  run  | section  dhcp


show run | begin ip

[If you want to see from that line where ‘ip’ word is present to last line]

show run | exclude ip

[If you want to see all lines but not to expect ip word related lines]

show run | include ip

[If you want to see all lines only included ip word related lines, not others]


Displays the system clockShow  clock
Displays all users connected to the routerShow  users
To Disconnect specific remote users

 or

 

To Disconnect specific  remote users

Clear   line   2

[2 means line number]

 

Clear line vty 0

To set idle time of remote sessionExec-timeout  1
Displays history of Cisco IOSShow history
Displays info about Flash memoryShow  flash
Displays info about loaded Cisco IOS softwareShow  version
Displays the ARP table of the routerShow  arp
Displays the IPv4 routing table of the routerShow  ip route
Displays the configured hostnames and their

corresponding IP addresses of the router

Show  host
Displays status of configured Layer 3 protocolsShow  protocols
Display the CPU utilization for a Cisco device at five minute intervals.Show  process  cpu
Display the total, used and available memory on a Cisco device.Show  memory
Verify the operational status of fans, temperature and power supplies. In addition list the percentage of power supply utilization and what amount is availableshow environment  all
Verify that CDP is enabled, update timer, hold timer and CDP version.Show  cdp
To show remote usersShow  users
To show ssh informationShow  ssh
To change hostname(itbd) of a routerHostname  itbd
How to assign a Local Name(remote) to an IP address(10.1.1.1)   [we can use the configured hostname for telnet or ping.like→ telnet  remote]Ip  host  remote  10.1.1.1

 

Configure a MOTD Banner for Routerbanner motd  #Welcome to IT-Bangladesh#
To enable DNS lookupip  name-server 192.168.100.10
To turn off the automatic name resolutionno ip domain-lookup
To get IP info automaticallyIp  add  dhcp
To resolve domain nameIp  domain-lookup
To set DNS Server IPIp name-server  8.8.8.8
To set enable password(cisco)Enable password cisco
To set secret passwordEnable  secret cisco
To encrypt all passwordService password-encryption
To get IP info automatically into VPCSIp    dhcp
To set IP address(10.1.1.2/8) & Gateway(10.1.1.1) into VPCSIp  10.1.1.2/8   10.1.1.1
Delete all routesRouter#clear ip route *
To see all IP information of VPCSShow  ip
To remove all the configuration commands you entered and initialize your Cisco device’s configurationRouter#erase startup-config

Router#reload

To view the logs of the Cisco devices to which you have logged in via Telnet/SSH (Execute this command from remote machine)# terminal monitor
To set Message of the day (MOTD) BannerBanner  motd ~ MOTD Banner ~
To set Login BannerBanner  login ~ Login Banner ~
To set exec BannerBanner exec ~You are authorized person ~
To set timeout session for remote clientsIp ssh time-out  5
To set authentication retriesIp ssh authentication-retries  3

Leave A Comment