tags:

views:

28

answers:

1

Hello :>

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 interface.

If anyone got an explanation for this I'd be very happy :)

A: 

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
Andomar
Ah I forgot to mention one thing. I've no access to the switch whatsoever. The only thing I have is a the dump taken from the switch, a cisco switch in this case (the dump should be correct since it was taken from a running switch on a network). I'm just trying to interpret the answers. So I'm not sure about Gi0/1 and Gi0/9 , but from this results should I assume that they are not a part of the bridge?
Phantaquh
@Phantaquh: In my experience you shouldn't assume anything about SNMP. Get someone with access to the switch to look at it, and see what happens when you add/remove an interface from a bridge
Andomar
Ah well thanks for your answers Andomar :). I'm not sure I can access it. But the program I'm making is supposed to create a model of the switch by only using the "GET" / "GETNEXT" commant etc. And it would be good to cover all possible cases, and exceptions. Well I'll see what I can do, if I figure it out I'll be sure to post it here. Thanks.
Phantaquh