cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
3255
Views
0
Helpful
1
Replies

Does anyone know how to do an SNMP set for the CLI command "mac address-table static 00:00:36:ab:ac:ad vlan <x> drop"

ferginator1
Level 1
Level 1

Does anyone know how to do an SNMP set for the CLI command "mac address-table static <00:00:36:ab:ac:ad> vlan <x> drop"

I would likely perform on a 3750x, Nexus 9k, or Nexus 5k switch.

1 Reply 1

jossabor
Level 1
Level 1

Ferginator1

To add that line the only way would be with the CISCO-COPY-CONFIG-MIB. You can follow a list of sets to add a line to it. Please first create a TXT document with the list of lines you want to configure. For example:

mac address-table static <00:00:36:ab:ac:ad> vlan <x> drop

end

At the end of the document you need to add the end statement. Then you need to move that file to a FTP server. Then follow this list of snmp-set operations:

Step 1 (Creating the Row).
================================

Please look into MIB ccCopyEntryRowStatus

snmpset  -v  2c  -c  private  10.10.10.2  1.3.6.1.4.1.9.9.96.1.1.1.1.14.222  i  5

NOTE: var_type is "i" for Interger

Value is 5 for createAndWait

In the MIB the last .222 is the entry index in the table. If the row is occupied then please destroy it first and try to create it and wait again.


Step 2 (Setting the protocol).
================================

We are going to use TFTP to transfer the device configuration with the OID ccCopyProtocol.

Please look into MIB ccCopyProtocol

snmpset  -v  2c  -c  private  10.10.10.2 1.3.6.1.4.1.9.9.96.1.1.1.1.2.222  i  1

NOTE: Value is 1 for tftp


Step 3 (Specifying  the Source).
================================

We are going to specify that what we want to copy is the file in your PC.

Please look into MIB ccCopySourceFileType

snmpset  -v  2c  -c  private  10.10.10.2  1.3.6.1.4.1.9.9.96.1.1.1.1.3.222  i  1

NOTE: Value is 1 for networkFile


Step 4 (Specifying the Destination).
================================

Once we have specified the Source, we need to tell what would be the destination to where
we are copying the file.

Please look into MIB ccCopyDestFileType

snmpset  -v  2c  -c  private  10.10.10.2  1.3.6.1.4.1.9.9.96.1.1.1.1.4.222  i  4

NOTE: Value is 4 for runningConfig


Step 5 (TFTP Server's Address).
================================

Let's now setup the IP address of the server where the TFTP service is currently running and where the configuration is going to get copied.

Please look into MIB ccCopyServerAddress

snmpset  -v  2c  -c  private  10.10.10.2  1.3.6.1.4.1.9.9.96.1.1.1.1.5.222  a

NOTE: var_type is "a" for IP address

Value is the TFTP server's IP address


Step 6 (Specifying the File name in the TFTP Server).
================================

Now, we need to tell the name of the file where the data is going to be sent to or stored (the one you create with the 2 lines).

Please look into MIB ccCopyFileName

snmpset  -v  2c  -c  private  10.10.10.2  1.3.6.1.4.1.9.9.96.1.1.1.1.6.222  s

NOTE: var_type is "s" for Display String. Sometimes the name could need " "

Value is the file name in the TFTP boot previously created with full privileges


Step 7 (Deploy the settings and run it).
================================

Last thing is deploying the settings so the config archive takes place. Before activating the row 222,  we must double-check that the TFTP service is up and running.

Is the service running?

If yes, then activate the row with the following snmpset.

Please look into MIB ccCopyEntryRowStatus

snmpset  -v  2c  -c  private  10.10.10.2  1.3.6.1.4.1.9.9.96.1.1.1.1.14.222 i 1

NOTE: Value is 1 for active.


Step 8 (Check the results).
================================

Check if the transfer was successful.

do a snmpwalk to 1.3.6.1.4.1.9.9.96.1.1.1.1.10.222

Results:

1:waiting
2:running
3:successful
4:failed

All the details for every OID can be found in the following location:

http://snmp.cloudapps.cisco.com/Support/SNMP/do/BrowseOID.do?local=en

Review Cisco Networking for a $25 gift card