weird answer from a switch using SNMP for geting info about interfaces / ports
I've just started using SNMP a week ago. I'm creating a java program that is supposed to collect information from a switch.
I used the following mibs
IF-MIB, BRIDGE-MIB
My goal was to link the physical ports with the interfaces.
When I "snmpwalked" ifName I got 26 different interfaces. [Vl1, Vl53, Gi0/1, Gi0/2, Gi0/3, Gi0/4, Gi0/5, Gi0/6, Gi0/7, Gi0/8, Gi0/9, Gi0/10, Gi0/11, Gi0/12, Gi0/13, Gi0/14, Gi0/15, Gi0/16, Gi0/17, Gi0/18, Gi0/19, Gi0/20, Gi0/21, Gi0/22, Gi0/23, Gi0/24, Nu0, Fa0]
"snmpwalked" ifIndex
[1, 53, 10101, 10102, 10103, 10104, 10105, 10106, 10107, 10108, 10109, 10110, 10111, 10112, 10113, 10114, 10115, 10116, 10117, 10118, 10119, 10120, 10121, 10122, 10123, 10124, 10501, 10502]
Now I used the bridge mib to link the ports to interfaces: "snmpwalk" dot1dBasePort
[2, 3, 4, 5, 6, 7, 8, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24]
"snmpwalk" dot1dBasePortIfIndex
[10102, 10103, 10104, 10105, 10106, 10107, 10108, 10110, 10111, 10112, 10113, 10114, 10115, 10116, 10117, 10118, 10119, 10120, 10121, 10122, 10123, 10124]
that is, port number 2 is linked to interface 10102 and so on.
The strange thing is that according to the ifName / ifIndex result there should be a physicall port '1' and a physicall port '9' but they seem to be gone. Or maybe I've misunderstood something :<
As you can see there is a interface 10101 but no port is linked to that in开发者_StackOverflow社区terface.
If anyone got an explanation for this I'd be very happy :)
Are you sure Gi0/1
and Gi0/9
are part of a bridge?
For a Cisco switch, log into the switch and use show running
or show vlan
to double-check.
If I remember right, configuring a bridge goes something like:
conf t
bridge 42 priority 32768
interface Gi0/9
bridge-group 42 priority 128
end
精彩评论