Cisco Support Community
cancel
Showing results for 
Search instead for 
Did you mean: 

How to copy images and files to and from the Cisco IOS routers with SNMP

Resolution

This procedure is based on CISCO-FLASH-MIB,    generally available from Cisco IOS  releases 12.0.

Management Information Base (MIB) MIB objects used for the config transfer are present under the ciscoFlashCopyTable of the MIB.

MIB Object Name
Object Identifier
Values used in the example
ciscoFlashCopyCommand.1.3.6.1.4.1.9.9.10.1.2.1.1.2copyToFlashWithErase(1)
      copyToFlashWithoutErase(2)
      copyFromFlash(3)
ciscoFlashCopyEntryStatus.1.3.6.1.4.1.9.9.10.1.2.1.1.11

active (1)
        createAndGo(4)
        createAndWait(5)
        destroy(6)

ciscoFlashCopyProtocol.1.3.6.1.4.1.9.9.10.1.2.1.1.3

tftp(1)
        rcp(2)

ciscoFlashCopyServerAddress.1.3.6.1.4.1.9.9.10.1.2.1.1.4
ciscoFlashCopySourceName.1.3.6.1.4.1.9.9.10.1.2.1.1.5If from Flash, the file name must be of the form
      [device>:][:]
ciscoFlashCopyDestinationName.1.3.6.1.4.1.9.9.10.1.2.1.1.6If to flash, the file name must be of the form
      [device>:][:]
ciscoFlashCopyStatus.1.3.6.1.4.1.9.9.10.1.2.1.1.8copyInProgress(1)
copyOperationSuccess(2)
     copyInvalidProtocol(4)
     copyDeviceFull(12)
     copyFileOpenError(13)
     copyFileTransferError(14)
     copyFileChecksumError(15)
     copyNoMemory(16)     

Perform these steps to use the CISCO-FLASH-MIB to copy a configuration file    located on a TFTP server to Flash on your router.

  1. Create a row in the ciscoFlashCopy Table, set the necessary values of the      attributes, and start the transfer, as shown:
    snmpset -v 2c -c   .1.3.6.1.4.1.9.9.10.1.2.1.1.2. i 2
    .1.3.6.1.4.1.9.9.10.1.2.1.1.3. i 1
    .1.3.6.1.4.1.9.9.10.1.2.1.1.4. a ""
    .1.3.6.1.4.1.9.9.10.1.2.1.1.5. s ""
    .1.3.6.1.4.1.9.9.10.1.2.1.1.6. s "flash:/"
    .1.3.6.1.4.1.9.9.10.1.2.1.1.11. i 4
  2. Check for the completion of transfer process, as shown: 
    snmpwalk -v 2c -c   .1.3.6.1.4.1.9.9.10.1.2.1.1.8.

    Repeat the command until the state is copyOperationSuccessful.

  3. Destroy the row created, as shown:
    snmpset -v 2c -c   .1.3.6.1.4.1.9.9.10.1.2.1.1.11. i 6
     

This is an example:

Cisco IOS Router Name/IP Address: 10.0.0.1
Server IP Address: 10.0.0.2
File Name: IOS.img
SNMP Read Write Community String: private
Random Row number: 50
  • Creating a row in the ciscoFlashCopy Table, setting values and starting      transfer.

    snmpset -v 2c -c private 10.0.0.1 .1.3.6.1.4.1.9.9.10.1.2.1.1.2.50 i 2

    .1.3.6.1.4.1.9.9.10.1.2.1.1.3.50 i 1

    .1.3.6.1.4.1.9.9.10.1.2.1.1.4.50 a "10.0.0.2"

    .1.3.6.1.4.1.9.9.10.1.2.1.1.5.50 s "IOS.img"

    .1.3.6.1.4.1.9.9.10.1.2.1.1.6.50 s "flash:/IOS.img"

    .1.3.6.1.4.1.9.9.10.1.2.1.1.11.50 i 4

  • Checking the transfer status. Repeat checking until the status is successful.

    snmpwalk -v 2c -c private 10.0.0.1 .1.3.6.1.4.1.9.9.10.1.2.1.1.8.50

  • Destroying the row.

    snmpset -v 2c -c private 10.0.0.1 .1.3.6.1.4.1.9.9.10.1.2.1.1.11.50 i 6

2637
Views
5
Helpful
0
Comments