Unsolved

This post is more than 5 years old

4 Posts

20259

July 11th, 2005 11:00

MAC to switchport

I am trying to get a mac to switchport mapping via snmp. Basically I am looking for the same information that is contained within the dynamic address table. Is this possible?

thanks.

-p

July 11th, 2005 16:00

I'm assuming you are trying to determine if a MAC is learn on a port.  You didn't mention which switch you are working with so although this will work on most switches, it may not work with all switches.  You can try anyway and see if it does what you want. 
 
Here are the two parameters you need.  The parameter "dot1qTpFdbPort" will identify the port the MAC is associated with. The "dot1qTpFdbStatus" is used to identify whether the MAC address is "learned" or "user configured" etc. The OID itself contains the MAC address.  Both of these are in the RFC2674 MIB.

So walk the entire dot1qTpFdbTable using the OID: ".1.3.6.1.2.1.17.7.1.2.2". This will return both the "port" (as .1.3.6.1.2.1.17.7.1.2.2.1.2) and the "status" (as .1.3.6.1.2.1.17.7.1.2.2.1.3). From this you can identify the port on which the MAC is associated and the status which tell you how the MAC was identified.

Here is an example walk:
$ snmpwalk -v 1 -c private 192.168.1.1:161 .1.3.6.1.2.1.17.7.1.2.2
SNMPv2-SMI::mib-2.17.7.1.2.2.1.2.1.0.13.86.47.78.64 = INTEGER: 24
SNMPv2-SMI::mib-2.17.7.1.2.2.1.3.1.0.13.86.47.78.64 = INTEGER: 3

Notice that "mib-2.17.7.1.2.2.1.2" identifies column 2 (port) and "mib-2.17.7.1.2.2.1.3" identifies column 3 (status). Notice that the MAC address is in the OID. In this case the MAC is from port 24 and the status of 3 indicates that the MAC is learned.

Please review the definition of the MIB object in RFC2674 to get a better idea of how this works.

Cuong.


4 Posts

July 12th, 2005 09:00

Ok, that makes sense. I am a little confused about the mappings though. For example:
1/e10 10
1/e10 10
1/e4 4
3/g1 149
3/g1 149
3/g1 149
2/e15 65
3/g1 149
2/e9 59
3/g1 149
2/e9 59
1/e18 18
2/e9 59
2/e9 59
5/e24 224
2/e7 57
3/g1 149
2/e13 63
2/e13 63
2/e14 64
3/e19 119

The left is from openmanage, the right is snmp. My setup in question is 5 stacked 3324's. How for example does switch 2 port 9 translate to 59?

Thanks.

-p

July 12th, 2005 12:00

This is because the 33xx software supports both 3324 and 3348 switches.  So the 3324 for example has 24 10/100 ports plus 2 Gig ports.  The 3348 has 48 10/100 ports plus 2 Gig ports.  The shared software base for the two switch types allocates enough memory space to account for all possible ports instead of just for the 24+2 existing ports on the 3324.  So the way the ports are numbered in a stack configuration is this:

Unit 1 ports are numbered from 1-48 (10/100) + 49-50 (1000).  Note that the two Gig ports are numbered 49 and 50 even in a 24 ports configuration since all the 10/100 ports come before the Gig ports.

Unit 2 ports are numbered from 51-98 (10/100) + 99-100 (1000).  Unit 2 is just offset by 50, with the Gig ports again at the end.

The mapping continues for the other stack units.  The formula is something like this (unit number - 1) * 50 + unit port number = stack port number.  NOTE that g1 is unit port number 49, and g2 is unit port number 50.

So in your example, 2/e9 = (2-1) * 50 + 9 = 59. 

Also, 3/g1 = (3 - 1) * 50 + 49 = 149.

And if you had 1/g2, it would be 1/g2 = (1 - 1) * 50 + 50 = 50.  This is true even in the 24 ports switch.

Using a shared software base simplify our development and maintenance.  The management interfaces (CLI / OpenManage Network Manager) know to translate the information appropriately so that the user is presented with the logical view of the stack.

Cuong.

No Events found!

Top