Cisco SNMP – How to Return Physical Port Speed of Cisco Switch Over SNMP

ciscosnmp

If I set a bandwidth parameter to Cisco Catalyst family switch port like this:

s1#sh run int Fa0/4 | i band
 bandwidth 15000
s1#

..then ifHighSpeed no longer returns the physical port speed, but instead the bandwidth value:

$ snmpwalk -v 2c -c public s1 ifHighSpeed.5
IF-MIB::ifHighSpeed.5 = Gauge32: 15
$

Is there a way to return physical port speed over SNMP even if bandwidth is specified? I tried with portAdminSpeed(.1.3.6.1.4.1.9.5.1.4.1.1.9), but SNMP agent in my switch does not know about that.

Best Answer

So I've just tried this on an older 3750 (12.2(52)SE) and here's what I get - given the following configuration:

interface FastEthernet1/0/1
 switchport trunk encapsulation dot1q
 switchport trunk allowed vlan 1,5,500
 switchport mode trunk
 bandwidth 5000
 spanning-tree link-type point-to-point
!

SNMP gives back the bandwidth value for the ifSpeed OID (bps):

IF-MIB::ifSpeed.10001 = Gauge32: 5000000

and a value of 5 for the ifHighSpeed (Mbps):

IF-MIB::ifHighSpeed.10001 = Gauge32: 5

Now, knowing that the ifIndex for fa1/0/1 is 10001 on this switch, I walked the entire MIB grepping for that index number, and there isn't a single relevant OID that gives a return value of 100000000 or 100.

So, long story short, it doesn't look like it is possible to return the physical link speed when the bandwidth parameter is set.

Related Topic