Thursday, March 24, 2016

Cisco IOS Command Tips and Tricks - Part 2

Cisco IOS command list is getting longer , and it has been split into two posts:

20. Upgrade Cisco Device IOS 



Switch# delete /f /r flash1:c3750-ipbase-mz.122.35-35.SE5.bin

Switch#copy tftp: flash:ios.tar

Switch#verify /md5 flash:ios.tar
.........................Done!
verify /md5 (flash:ios.tar) = bb86b1de4eb8e37fd0710c40d891445c

Switch#archive tar /xtract ios.tar flash:


Switch(config)#boot system flash:/ios/ios.bin

Switch#wr
Switch#show boot
BOOT path-list      : flash:/ios/ios.bin
Config file         : flash:/config.text
Private Config file : flash:/private-config.text
.....


Switch#reload



21. Auto secure

Cisco also provides a One-step lockdown-like feature at the command line! This feature is called AutoSecure. It uses the command shown below:

auto secure [management | forwarding] [no-interact | full] [ntp | login | ssh | firewall | tcp-intercept]



22. Change Site-to-Site VPN Idle time out to 5 minutes

For IOS Router


R1(config)#crypto ipsec security-association idle-time 300



For ASA


ASA1(config)#group-policy GP_1.1.1.2 attributes
ASA1(config-group-policy)#vpn-idle-timeout 300

ASA1(config-group-policy)#vpn-session-timeout none


23. Find Cisco Devices Serial Number

Usually we could use 'show version' command to find out SN , but for Nexus you will have to use 'show inventory' to get Chassis SN

Nexus1# show inventory
NAME: "Chassis", DESCR: "Nexus5548 Chassis"
PID: N5K-C5548UP       , VID: V01 , SN: SSI163604J

NAME: "Module 1", DESCR: "O2 32X10GE/Modular Universal Platform Supervisor"
PID: N5K-C5548UP       , VID: V01 , SN: FOC1645D5F

NAME: "Fan 1", DESCR: "Chassis fan module"
PID: N5548P-FAN        , VID: N/A , SN: N/A

NAME: "Fan 2", DESCR: "Chassis fan module"
PID: N5548P-FAN        , VID: N/A , SN: N/A

NAME: "Power supply 1", DESCR: "AC power supply"
PID: N55-PAC-750W      , VID: V02 , SN: ART16310D6

NAME: "Power supply 2", DESCR: "AC power supply"
PID: N55-PAC-750W      , VID: V02 , SN: ART16310SQ

NAME: "Module 3", DESCR: "O2 Daughter Card with L3 ASIC"
PID: N55-D160L3-V2     , VID: V01 , SN: FOC1637NT8

NAME: "FEX 101 CHASSIS", DESCR: "N2K-C2248TP-1GE  CHASSIS"
PID: N2K-C2248TP-1GE   , VID: V03 , SN: SSI1637FHK

NAME: "FEX 101 Module 1", DESCR: "Fabric Extender Module: 48x1GE, 4x10GE Supervi
sor"
PID: N2K-C2248TP-1GE   , VID: V03 , SN: FOC1645WH9

NAME: "FEX 101 Fan 1", DESCR: "Fabric Extender Fan module"
PID: N2K-C2248-FAN     , VID: N/A , SN: N/A

NAME: "FEX 101 Power Supply 1", DESCR: "Fabric Extender AC power supply"
PID: N2200-PAC-400W    , VID: V04 , SN: LIT16390H9

NAME: "FEX 101 Power Supply 2", DESCR: "Fabric Extender AC power supply"
PID: N2200-PAC-400W    , VID: V04 , SN: LIT16390HH

NAME: "FEX 102 CHASSIS", DESCR: "N2K-C2248TP-1GE  CHASSIS"
PID: N2K-C2248TP-1GE   , VID: V03 , SN: SSI16390DJ

24. Show Commands Information

Flash: IOS  
RAM: All tables and configuration when router is running. Info will  be lost when power off.
ROM: POST, Bootstrap, Mini-IOS
NVRAM:Startup-config

25. SYSLOG Writing to Local Disk or Flash Card


Router(config)# logging persistent url disk0:/syslog size 134217728 filesize 16384        
%Warning: the ratio between logging persistent size and logging persistent filesize is 134217728/16384, suggested ratio is less than 196 in order to achieve good system performace

Router(config)# logging persistent url disk0:/syslog size 134217728 filesize 1342177  

Router#sh log 
Syslog logging: enabled (0 messages dropped, 9 messages rate-limited, 0 flushes, 0 overruns, xml disabled, filtering disabled)

No Active Message Discriminator.



No Inactive Message Discriminator.


    Console logging: disabled
    Monitor logging: level debugging, 0 messages logged, xml disabled,
                     filtering disabled
    Buffer logging:  level debugging, 8665 messages logged, xml disabled,
                    filtering disabled
    Exception Logging: size (4096 bytes)
    Count and timestamp logging messages: disabled
    Persistent logging: enabled, url disk0:/syslog, disk space 134217728 bytes, file size 1342177 bytes, batch size 4096 bytes

No active filter modules.

    Trap logging: level debugging, 8669 message lines logged
        Logging to 10.2.2.3  (udp port 514, audit disabled,
              link up),
              8668 message lines logged, 
              0 message lines rate-limited, 
              0 message lines dropped-by-MD, 
              xml disabled, sequence number disabled
              filtering disabled
        Logging Source-Interface:       VRF Name:
        Loopback0                       

Log Buffer (8192 bytes):

12 EST: %C7600_PLATFORM-SP-3-LOW_BATT: Low Voltage detected for NVRAM Battery
........[Omitted]

Router# copy disk0:/syslog ftp://myuser:mypass@192.168.1.129/syslog



26. Check Routers Power Supply Status


Router#show environment 
SYSTEM POWER SUPPLY STATUS
==========================
 Internal Power Supply 1 Type: AC
 Internal Power Supply 1 12V Output Status: Normal

 Internal Power Supply 2 Type: AC
 Internal Power Supply 2 12V Output Status: Fail

SYSTEM FAN STATUS
=================
 Fan 1 OK, Low speed setting
 Fan 2 OK, Low speed setting
 Fan 3 OK, Low speed setting
 Fan 4 OK, Low speed setting
 Fan 5 OK, Low speed setting

SYSTEM TEMPERATURE STATUS
=========================
 Intake Left temperature: 25 Celsius, Normal
 Intake Right temperature: 22 Celsius, Normal
 Exhaust Right temperature: 29 Celsius, Normal
 Exhaust Left temperature: 31 Celsius, Normal
 CPU temperature: 24 Celsius, Normal
 Power Supply Unit 1 temperature: 24 Celsius, Normal
          
REAL TIME CLOCK BATTERY STATUS
==============================
 Battery OK (checked at power up)

CPU CORE TEMPERATURE STATUS
===========================
  CPU Core current reading, target = 24, reading = 62 : Normal
  CPU Core out of target history in past 1045868.0 mins:
     Consecutive out-of-range mins high water mark: 0.0
     Total minutes out-of-range: 0.0
     Last 5 minutes out-of-range: 0.0
     Last 5 minutes consecutive out-of-range: 0.0
     Last 5 minutes read failure count: 0


SYSTEM WATTAGE
===============
 Motherboard, EHWIC, PVDM, Power Supply and Fan Power consumption = 123.1 W
 Total System Power consumption is: 123.1 W

 Environmental information last updated 00:00:11 ago







No comments:

Post a Comment