1

Finding out how many devices are connected to a single switchport is easy on a non-stacked Cisco network switch with a sh mac add ta or sh mac add int fa/gi/eth.

In our enterprise we have many large stacks of 3750 series switches. Is there a command or other ways to discover which specific switchports have multiple devices connected?

  • Did any answer help you? if so, you should accept the answer so that the question doesn't keep popping up forever, looking for an answer. Alternatively, you could provide and accept your own answer. – Ron Maupin Aug 11 '17 at 14:56
2

So purely from an IOS/NXOS CLI it's going to be kind of painful. Simply running "show mac address-table dynamic | count " will show the number of times a given interface shows up in the list. Running this for each interface will give you the info you want (...this is the painful part).

If the platform supports scripting (ex: the Python interpreter in NXOS) then it would be fairly straightforward to iterate through the dynamic MAC listing and iterating a hash of counters based on the interface name. At that point you'd simply iterate through the dictionary and print values greater than 1.

Similarly you could pull the output of the "sh mac dynamic" and run it through a fairly trivial script on a local laptop.

  • Thanks for the excellent info. The ios does support tcl scripting which could come in very handily. Google already show a few hits on Cisco ios scripting :-) – user4565 Nov 30 '16 at 3:28
  • On an enterprise-wide basis a great way to go is actually pulling the CAM and ARP tables from every switch and storing it in a basic database. This allows for a huge number of possible inquiries - from easily hitting your request (all ports with x or more stations), tracking an arbitrary IP to its MAC and what port it has lived on, integrated inventory information, etc. There's also a big win in keeping timestamp information with this, which allows for historical trending of usage, host movement, etc. – rnxrx Nov 30 '16 at 3:48
0

There isn't any difference between a stack of 3750 switches and a single 3750 switch. The show mac-address-table command still works on switch stacks the same way it works on stand-alone switches.

Catalyst 3750 Command Reference:

show mac address-table

Use the show mac address-table user EXEC command to display a specific MAC address table static and dynamic entry or the MAC address table static and dynamic entries on a specific interface or VLAN.

show mac address-table [ | { begin | exclude | include } expression ]

Syntax Description

Command Modes

User EXEC

Command History

enter image description here Usage Guidelines

Expressions are case sensitive. For example, if you enter | exclude output, the lines that contain output do not appear, but the lines that contain Output appear.

Examples

This is an example of output from the show mac address-table command:

Switch> show mac address-table
Mac Address Table
------------------------------------------
Vlan Mac Address Type Ports
---- ----------- ---- -----
All 0000.0000.0001 STATIC CPU
All 0000.0000.0002 STATIC CPU
All 0000.0000.0003 STATIC CPU
All 0000.0000.0009 STATIC CPU
All 0000.0000.0012 STATIC CPU
All 0180.c200.000b STATIC CPU
All 0180.c200.000c STATIC CPU
All 0180.c200.000d STATIC CPU
All 0180.c200.000e STATIC CPU
All 0180.c200.000f STATIC CPU
All 0180.c200.0010 STATIC CPU
1 0030.9441.6327 DYNAMIC Gi6/0/4
Total Mac Addresses for this criterion: 12
  • Thanks for the information and link. What I'm looking for is a way to single out only the switchports that have many devices connected. For example someone connects a small dumb 8 port desktop switch or god forbid a small hub. Thoughts anyone? – user4565 Nov 29 '16 at 23:03
  • That is what the switchport port-security command is for. You can set a maximum for MAC addresses allowed to be seen on an access port. There are various options for how long to maintain MAC addresses seen on the port. – Ron Maupin Nov 29 '16 at 23:08
  • Thanks again for the info but it is not the solution. Thoughts anyone? – user4565 Nov 30 '16 at 0:14
  • That is the solution to prevent your dreaded scenario. What you are asking would actually require software to create a custom report. – Ron Maupin Nov 30 '16 at 0:15
  • 1
    By the way, you wrote that this is easy on a non-stacked switch, and my answer correctly pointed out that it is exactly the same (just as easy) on a stacked switch. Your comment actually changes your question. – Ron Maupin Nov 30 '16 at 0:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.