I'm trying to get MAC address table from port number on Cisco switch using this manual.
For this i make
snmpwalk .1.3.6.1.2.1.17.4.3.1.1
to get the MAC address table;
snmpwalk .1.3.6.1.2.1.17.4.3.1.2
to get the bridge port number;
snmpwalk .1.3.6.1.2.1.17.1.4.1.2
to get the bridge port to ifIndex mapping.
But the problem I'm facing is the follows: i have more than one bridge port number for one MAC: i.e. the first snmp contains
SNMPv2-SMI::mib-2.17.4.3.1.1.0.14.94.0.119.122 = Hex-STRING: 00 0E 5E 00 77 7A
SNMPv2-SMI::mib-2.17.4.3.1.1.0.开发者_Go百科14.94.10.250.7 = Hex-STRING: 00 0E 5E 0A FA 07
while the second:
SNMPv2-SMI::mib-2.17.4.3.1.2.0.14.94.0.119.122 = INTEGER: 6
SNMPv2-SMI::mib-2.17.4.3.1.2.0.14.94.10.250.7 = INTEGER: 6
so... which MAC should I use for bridge port number 6
?
ps: i'm not an admin, so sorry if the question is stupid, and thanks in advance!
You are looking at the "forwarding database" (FDB). What you are seeing is which port a particular MAC address will be forwarded to. If several systems are connected to that port -- e.g., because what you plugged in to the port was a switch itself -- then multiple MAC addresses will map to the same port in the FDB.
What are you actually trying to do? And why do you think this is on-topic for StackOverflow? :-)
I guess you are looking for some network topology like stuff.
Here are some very good algorithms for doing the same.
It describes Spanning Tree Protocol and FDB processing while getting data from a switch or router.(Algorithm-3 and 4 in pdf).
I hope, it helps you.
As pointed out above, the correct answer is that you should use both MAC address since both MAC address appears from that particular interface (Mac address table entries have many to one relation).
However, the port number you have is just the bridge port number. You will have to translate it to the Interface name using dot1dBasePortIfIndex => ifName mapping.
精彩评论