Wednesday 1 April 2020

USEFUL CISCO COMMANDS

In this post we will discuss some of  "Tricky " useful CISCO IOS Commands .

Would recommend you all to go through the post and checkout below commands

Hopefully you all will find those commands useful !!!

CISCO USEFUL COMMANDS


Let's start

1)  show archive config differences

This commands shows the difference in configuration between the running-configuration and start-up configuration.

R1#show archive config differences
Contextual Config Diffs:
-ip access-list extended TECHSTUFF
 -permit ip any host 12.1.1.1
 -permit ip host 12.1.1.1 any

!!!!! Once we give save running configuration . The running-configuration and start-up configuration becomes same .Hence no difference is observed .

R1#write memory
Building configuration...
[OK]

R1#show archive config differences
Contextual Config Diffs:
!No changes were found

2)  ip access-list resequence <ACL NAME > <Starting Seq.No.> <Increment in Seq.No.>

R1#sh ip access-lists TECHSTUFF
Extended IP access list TECHSTUFF
    5 permit tcp any 10.0.0.0 0.0.0.255
    10 permit ip any host 12.1.1.1
    20 permit ip host 12.1.1.1 any
    21 permit ip 20.0.0.0 0.0.0.255 any
    30 permit ip host 100.0.0.5 any
    40 deny ip any any

In this above acl you can see because ACE sequence no. 5 &21 there is no uniformity between the ACE's present in ACL .
Lets make it by giving first entry as sequence no. 10 and difference between the sequence no. as 10 as well .

R1(config)#ip access-list resequence TECHSTUFF ?
  <1-2147483647>  Starting Sequence Number

R1(config)#ip access-list resequence TECHSTUFF 10 ?
  <1-2147483647>  Step to increment the sequence number

R1(config)#ip access-list resequence TECHSTUFF 10 10
R1(config)#^Z

Jun 26 08:45:28.271: %SYS-5-CONFIG_I: Configured from console by console

Extended IP access list TECHSTUFF
    10 permit tcp any 10.0.0.0 0.0.0.255
    20 permit ip any host 12.1.1.1
    30 permit ip host 12.1.1.1 any
    40 permit ip 20.0.0.0 0.0.0.255 any
    50 permit ip host 100.0.0.5 any
    60 deny ip any any


3) reload in & reload at

The below commands shows how can we automatically schedule the reload 

Here in the example reload is scheduled after 5hrs 30Mins and the reason for reload is TESTING.

R1#reload in 005:30 TESTING

System configuration has been modified. Save? [yes/no]: YES
Building configuration...
[OK]
Reload scheduled for 14:22:42 UTC Wed Jun 26 2019 (in 5 hours and 30 minutes) by console
Reload reason: TESTING
Proceed with reload? [confirm]
R1#
Jun 26 08:52:44.999: %SYS-5-SCHEDULED_RELOAD: Reload requested for 14:22:29 UTC Wed Jun 26 2019 at 08:52:29 UTC Wed Jun 26 2019 by console. Reload Reason: TESTING.

R1#sh reload
Reload scheduled for 14:22:44 UTC Wed Jun 26 2019 (in 5 hours and 29 minutes) by console
Reload reason: TESTING
R1#

!! We can even cancel the scheduled reload by giving below command

R1#reload cancel
R1#


***
*** --- SHUTDOWN ABORTED ---
***

R1#
Jun 26 08:53:15.687: %SYS-5-SCHEDULED_RELOAD_CANCELLED: Scheduled reload cancelled at 08:53:15 UTC Wed Jun 26 2019
R1#sh reload
No reload is scheduled.

We can scheduled reload by defining at particular time by using command -"reload at"

R1#reload at 09:00 26 June TESTING
Reload scheduled for 09:00:00 UTC Wed Jun 26 2019 (in 1 minute and 36 seconds) by console
Reload reason: TESTING
Proceed with reload? [confirm]
R1#
Jun 26 08:58:25.979: %SYS-5-SCHEDULED_RELOAD: Reload requested for 09:00:00 UTC Wed Jun 26 2019 at 08:58:24 UTC Wed Jun 26 2019 by console. Reload Reason: TESTING.
R1#sh reload
Reload scheduled for 09:00:00 UTC Wed Jun 26 2019 (in 1 minute and 15 seconds) by console
Reload reason: TESTING

4) alias command

This is very useful commands which saves lot of time !!!!
Below you can see how to create a alias.
For command "sh ip int brief" and alias is created as "s"

R1(config)#alias exec s sh ip int brief
R1(config)#^Z
R1#
R1#s
Jun 26 09:06:38.831: %SYS-5-CONFIG_I: Configured from console by console
R1#s
Interface                  IP-Address         OK? Method Status                         Protocol
FastEthernet0              13.1.1.1         YES NVRAM  up                               down
Loopback0                  1.1.1.1           YES NVRAM  up                                   up
Loopback100           100.100.100.1   YES NVRAM  up                                  up
Serial0                        12.1.1.1          YES NVRAM  up                                   up
Serial1                    unassigned         YES NVRAM  administratively down down
Serial2                    unassigned         YES NVRAM  administratively down down

5)show processes cpu sorted | exclude 0.00

The below command shows you what processes are currently running and using what percentage.
and exclude 0.00 will exclude output with value 0.00

R1#show processes cpu sorted | exclude 0.00
CPU utilization for five seconds: 0%/0%; one minute: 0%; five minutes: 0%
 PID Runtime(ms)   Invoked      uSecs   5Sec   1Min   5Min TTY Process
  38        3900       617       6320  0.16%  0.12%  0.13%   0 Compute load avg
  50       31360      2293      13676  0.16%  0.38%  0.16%   0 Exec
  17        2052       924       2220  0.08%  0.08%  0.08%   0 HC Counter Timer

6)write network

"write network" command is used take backup of running-configuration of the device on tftp server.

R1#write network
This command has been replaced by the command:
         'copy system:/running-config <url>'
Address or name of remote host []? 10.1.1.100
Destination filename [r1-confg]?
Write file tftp://10.1.1.100/r1-confg? [confirm]
!! [OK]


.......to be contd......

Hope you all are finding the commands useful !!!!!!!!!!!!!

No comments:

Post a Comment