03-18-2004 06:16 AM - edited 03-02-2019 02:22 PM
Can anyone please tell me how to find the OID that will give me the MAC address of a device connected to port (0-24)?
Thank you!
Sharon
Solved! Go to Solution.
03-22-2004 06:54 AM
dot1dTpFdbEntry contains three entries and is indexed by dot1dTpFdbAddress.
dot1dTpFdbEntry OBJECT-TYPE
SYNTAX Dot1dTpFdbEntry
ACCESS not-accessible
STATUS mandatory
DESCRIPTION
"Information about a specific unicast MAC address
for which the bridge has some forwarding and/or
filtering information."
INDEX { dot1dTpFdbAddress } <--
::= { dot1dTpFdbTable 1 }
Dot1dTpFdbEntry ::=
SEQUENCE {
dot1dTpFdbAddress <--
MacAddress,
dot1dTpFdbPort <--
INTEGER,
dot1dTpFdbStatus <--
INTEGER
}
1) So you need to poll dot1dTpFdbPort to get the port index number.
nms-server2:/mibs> snmpwalk -c public@6 14.32.6.12 dot1dTpFdbPort
BRIDGE-MIB::dot1dTpFdbPort.0.1.66.69.224.255 = INTEGER: 2
BRIDGE-MIB::dot1dTpFdbPort.0.2.126.248.168.87 = INTEGER: 2
BRIDGE-MIB::dot1dTpFdbPort.0.2.185.144.76.102 = INTEGER: 385 <-- portIndex is 385
2) so port index is 385, what's the ifIndex for that port?
nms-server2:/mibs> snmpwalk -c public 14.32.6.12 dot1dBasePortIfIndex | grep 385
BRIDGE-MIB::dot1dBasePortIfIndex.385 = INTEGER: 101 <-- ah, ha, ifIndex is 101
3) now ifIndex is 101, what port is it?
nms-server2:/mibs> snmpwalk -c public 14.32.6.12 ifName | grep 101
IF-MIB::ifName.101 = STRING: 4/1 <-- it's port 4/1
4) verify from CLI
nms-6506a> (enable) show cam dynamic 4/1
* = Static Entry. + = Permanent Entry. # = System Entry. R = Router Entry.
X = Port Security Entry $ = Dot1x Security Entry
VLAN Dest MAC/Route Des [CoS] Destination Ports or VCs / [Protocol Type]
---- ------------------ ----- -------------------------------------------
6 00-02-b9-90-4c-66 4/1 [ALL]
<-- this mac matches 0.2.185.144.76.102
03-18-2004 08:04 AM
You need to poll dot1dTpFdbEntry (1.3.6.1.2.1.17.4.3.1.1) in BRIDGE-MIB
03-19-2004 03:06 PM
Hi minie
I dont have access to this page (yet .)
And I dont have much knowledge in SNMP
I will be more then happy to get some more info on: dot1dTpFdbEntry
Do I need to send:
1.3.6.1.2.1.17.4.3.1.1
To get port 1 mac
And
1.3.6.1.2.1.17.4.3.1.n
To get port n mac ?
Thank you very much
Sharon .
03-21-2004 12:17 AM
I was able to get the article from a friend,
The article describes problem finding MAC when using Cisco works or ANI ,
I am trying to write a piece of java code that will sample Cisco devices,
And I dont know the correct OID to send , in order to receive the MAC from each port
Please advice.
Sharon.
03-22-2004 05:55 AM
As I mentioned earlier, the oid is 1.3.6.1.2.1.17.4.3.1.1, dot1dTpFdbAddress. To get more info on BRIDGE-MIB, you can either find the MIB.
ftp://ftp.cisco.com/pub/mibs/v2/
or use SNMP Object Navigator
03-22-2004 06:05 AM
Hi minie
Thank you for the information,
I am able to receive the entire Mac addresses using 1.3.6.1.2.1.17.4.3.1.1, dot1dTpFdbAddress
My problem is how to attribute each Mac to its port.
I guess I have to dig in the mib file ...
Thank you.
Sharon
03-22-2004 06:54 AM
dot1dTpFdbEntry contains three entries and is indexed by dot1dTpFdbAddress.
dot1dTpFdbEntry OBJECT-TYPE
SYNTAX Dot1dTpFdbEntry
ACCESS not-accessible
STATUS mandatory
DESCRIPTION
"Information about a specific unicast MAC address
for which the bridge has some forwarding and/or
filtering information."
INDEX { dot1dTpFdbAddress } <--
::= { dot1dTpFdbTable 1 }
Dot1dTpFdbEntry ::=
SEQUENCE {
dot1dTpFdbAddress <--
MacAddress,
dot1dTpFdbPort <--
INTEGER,
dot1dTpFdbStatus <--
INTEGER
}
1) So you need to poll dot1dTpFdbPort to get the port index number.
nms-server2:/mibs> snmpwalk -c public@6 14.32.6.12 dot1dTpFdbPort
BRIDGE-MIB::dot1dTpFdbPort.0.1.66.69.224.255 = INTEGER: 2
BRIDGE-MIB::dot1dTpFdbPort.0.2.126.248.168.87 = INTEGER: 2
BRIDGE-MIB::dot1dTpFdbPort.0.2.185.144.76.102 = INTEGER: 385 <-- portIndex is 385
2) so port index is 385, what's the ifIndex for that port?
nms-server2:/mibs> snmpwalk -c public 14.32.6.12 dot1dBasePortIfIndex | grep 385
BRIDGE-MIB::dot1dBasePortIfIndex.385 = INTEGER: 101 <-- ah, ha, ifIndex is 101
3) now ifIndex is 101, what port is it?
nms-server2:/mibs> snmpwalk -c public 14.32.6.12 ifName | grep 101
IF-MIB::ifName.101 = STRING: 4/1 <-- it's port 4/1
4) verify from CLI
nms-6506a> (enable) show cam dynamic 4/1
* = Static Entry. + = Permanent Entry. # = System Entry. R = Router Entry.
X = Port Security Entry $ = Dot1x Security Entry
VLAN Dest MAC/Route Des [CoS] Destination Ports or VCs / [Protocol Type]
---- ------------------ ----- -------------------------------------------
6 00-02-b9-90-4c-66 4/1 [ALL]
<-- this mac matches 0.2.185.144.76.102
03-22-2004 11:18 PM
Thank you very much minie
I will follow those steps today, and try to get the mac by port# .
I don't understand why is it so complicated
If I want to get :
Port description
Port speed
Port vlan
It's just sending single (OID + port# ) request and receiving back value
Simple as that
Thanks again
Sharon
03-29-2004 02:59 AM
Hi
I am working in RT env , I'm trying to get the Mac as fast as I can
Is there anyway I can send SNMP command to the switch so it will refresh the dot1dTpFdbAddress table?
Thanks again
Sharon.
03-29-2004 05:38 AM
All the MIB objects are updated in real time. You can't "refresh" them.
03-29-2004 12:47 PM
Hi minie
The problem started when the switch is sending a trap (link up), when a computer / Device is connecting to the network Through port n,
When the computer is connected I must do several things,
So I start by reading the Mac from port n , sometimes I am trying to read the Mac from: dot1dTpFdbAddress and I dont receive it
But if I delay the execution a bit (1sec) I get a result (not always)
I wonder how it can be possible.
The switch is sending a trap LINKUP trap before the dot1dTpFdbAddress is updated?!?!?!
Should I open new thread for this matter?
10x Thanks
Sharon
03-29-2004 01:08 PM
Sharon,
You have to keep in mind the spanning tree protocol. Linkup/linkdown trap is for layer 2 status. As soon as a device/host is connected to it, the trap will be sent. However, STP needs 30 seconds to go thru listening/learning/forwarding state, unless you configured "portfast" on that port.
Well, MIB objects supposed to be updated real time, but depending on implementation, I'm not surprised that it might be seconds delayed.
The bottom line is you can not "refresh" it. There's nothing you can do about it.
Find answers to your questions by entering keywords or phrases in the Search bar above. New here? Use these resources to familiarize yourself with the community: