SNMP OID for setting port speed and duplex mode

Unanswered Question
Jan 22nd, 2009

Hi,

I'm looking for the correct SNMP OID (MIB) to set a port's speed and duplex mode remotely. So far I only found things like "mediaIndependentOutputSpeed", but it says that it's "Read Only" so I can't set it using SNMP.

Is there such a writable OID? Do I need to use SNMPv3 for this to work (using v1 currently).

I'm using a Cisco 3560 with IOS 12.2(25)

Thank you very much in advance

Kurt

I have this problem too.
0 votes
  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
Loading.
Yudong Wu Thu, 01/22/2009 - 22:18

you can try MAU-MIB.

Here is an example.

[email protected]-server2[118]:/home/mnie{17:25:35}% snmpwalk -c public 172.21.50.250

ifMauDefaultType.5.1

MAU-MIB::ifMauDefaultType.5.1 = OID: SNMPv2-SMI::zeroDotZero

Now set it to dot3MauType100BaseTXHD

********

[email protected]-server2[120]:/home/mnie{17:27:14}% snmpset -c private 172.21.50.250

ifMauDefaultType.5.1 o

dot3MauType100BaseTXHD

MAU-MIB::ifMauDefaultType.5.1 = OID: MAU-MIB::dot3MauType100BaseTXHD

[email protected]-server2[121]:/home/mnie{17:27:32}% snmpwalk -c private 172.21.50.250

ifMauDefaultType.5.1

MAU-MIB::ifMauDefaultType.5.1 = OID: MAU-MIB::dot3MauType100BaseTXHD

It also works with the object id. Make sure you put the dot at front.

********

[email protected]-server2[125]:/home/mnie{17:34:43}% snmpset -c private 172.21.50.250

ifMauDefaultType.5.1 o .1.3.6.1.2.1.26.4.16

MAU-MIB::ifMauDefaultType.5.1 = OID: MAU-MIB::dot3MauType100BaseTXFD

kurttheman Sun, 01/25/2009 - 02:01

Hi,

thank you very much for this hint!

when I do a complete snmpwalk, I do not get any MAU-MIB related information. So I downloaded the MAU-MIB.mib file, placed onto my server in my mib directory. Still no changes. Even if I use the following command, I do not get anything MAU-MIB related:

snmpwalk -v1 -c public -m /path/to/MAU-MIB.mib 192.168.30.1

I also tried to set the value using the OID number (you last example), but I do get the following error:

Erro in packet.

Reason: (noSuchName) There is no such variable name in this MIB.

Failed object: MAU-MIB::ifMauDefaultType.5.1

I do understand that snmpset doesn't know what ifMauDefaultType.5.1 is, since the MIB doesn't seem to be recognized -- any ideas?

what exactly does ifMauDefaultType.5.1 mean? Can I use this to set the speed to a specific port and not only globally for the whole switch? I'm currently only using SNMPv1 - is that sufficient to set these values?

Sorry, I'm pretty new to SNMP and MIB's as you can tell.

Thanks again for your help

Kurt

kurttheman Mon, 01/26/2009 - 13:12

Hi,

since I didn't get any further with the MAU-MIB example from above (probably my Cisco doesn't have the MAU-MIB installed...) I tried to take smaller steps:

I used a visual MIB browser to find the OID where the interface speed can be retrieved (but not set to a specific value, only get): 1.3.6.1.2.1.2.2.1.5

and then found out that by adding 1003 to this OID I would get the interface speed of port FastEthernet 0/3: 1.3.6.1.2.1.2.2.1.5.10003

So I thought if I apply the same logic to the ifMauDefaultType I'd get and be able to set the default interface speed using the following OID for example for port 0/3: 1.3.6.1.2.1.26.2.1.1.11.1003

but...it didn't work...

I can't even read that value (not to think about writing...). when I do an

snmpget -c public -v1 192.168.30.1 .1.3.6.1.2.1.26.2.1.1.11

I get:

Error in packet

Reason: (noSuchName) There is no such variable name in this MIB.

Failed object: SNMPv2-SMI::mib-2.26.2.1.1.11

So, once again, is there any way (with MAU-MIB or any other MIB) to set the speed for a specific interface on a cisco switch using snmp?

Thank you very much again,

Kurt

Yudong Wu Mon, 01/26/2009 - 21:09

If "CISCO-STACK-MIB" is supported, you can try the following two objects, both of them are "read-write".

portAdminSpeed and portDuplex

kurttheman Wed, 01/28/2009 - 01:12

Hi kwu2,

thanks for not giving up on me :)

I used the online tool to get the MIB's supported on my image "c3560-ipbase-mz.122-25.SEE2.bin". I could not find MAU-MIB, but DOT3-MAU-MIB and also the CISCO-STACK-MIB.

In my visual SNMP management software, I can browse to a leave called "snmpDot3MauMgt" which I hope is based on the DOT3-MAU-MIB?! And under there is the dot3IfMauBasicGroup-->ifMauTable-->ifMauEntry-->ifMauDefaultType with an OID of 1.3.6.1.2.1.26.2.1.1.11. But if I do a SNMP Get request on this leave (for example 1.3.6.1.2.1.26.2.1.1.11.1001, which should be interface 0/1), I only get NULL values. If I do a GetNext it automatically jumps to the leave 1.3.6.1.2.31.1.1.1.1.1 which represents the ifMIB and not the MAU-MIB anymore...

hhmmm...

Yudong Wu Wed, 01/28/2009 - 07:54

DOT3-MAU-MIB is the same as MAU-MIB. You can set speed/duplex by using ifMauDefaultType. Based on the following info, you need to disable autonegociation in order to make change on speed and duplex.

http://tools.cisco.com/Support/SNMP/do/BrowseOID.do?local=en&translate=Translate&objectInput=ifMauDefaultType

Therefore, after setting ifMauDefaultType, you need set ifMauAutoNegAdminStatus to "disable".

kurttheman Thu, 01/29/2009 - 11:14

Thanks for the info - I'll try that tomorrow. Another idea which I had is to install a evaluation version of Cisco Works and do the port speed configuration via Cisco Works. If Cisco Works is able to configure the port speed via SNMP, then I should be able to sniffer those SNMP packets and "learn" how Cisco Works is doing it - this way I can copy the correct OID's... Problem here is just that I have no clue how to configure the port speed using Cisco Works via SNMP - any idea?

Thanks again

Kurt

Yudong Wu Thu, 01/29/2009 - 11:39

I am not sure about Cisco work.

But I will find a 3560 switch in lab to try it. Will let you know what I find later.

Yudong Wu Mon, 02/02/2009 - 08:14

You can use Cisco-stack-mib to set speed and duplex. I tested it in the lab.

Use portDuplex and portAdminSpeed object.

http://tools.cisco.com/Support/SNMP/do/BrowseOID.do?local=en&translate=Translate&objectInput=portDuplex

http://tools.cisco.com/Support/SNMP/do/BrowseOID.do?local=en&translate=Translate&objectInput=portAdminSpeed

Here is example.

% snmpset -v 2c -c cisco 10.89.245.47 1.3.6.1.4.1.9.5.1.4.1.1.10.1.20 i 2

SNMPv2-SMI::enterprises.9.5.1.4.1.1.10.1.20 = INTEGER: 2

%

% snmpset -v 2c -c cisco 10.89.245.47 1.3.6.1.4.1.9.5.1.4.1.1.9.1.20 i 10000000

SNMPv2-SMI::enterprises.9.5.1.4.1.1.9.1.20 = INTEGER: 10000000

%

R37-Cat3560a#sh run int f0/18

Building configuration...

Current configuration : 57 bytes

!

interface FastEthernet0/18

speed 10

duplex full

end

kurttheman Tue, 02/03/2009 - 09:00

Hi,

thanks for the detailed information. Hopefully I will be able to test this on a Cisco 3560G this Thursday.

I will provide feedback once I was able to test it - but again thanks for your great support on this!!

Best wishes from Germany,

Kurt

Actions

This Discussion