If I run show mac-address-table dynamic I get a bunch of mac addresses on that table. But due to the aging parameter, I don't see the mac addresses of all possible devices on the network that come through that switch. Is there a way to force an update, perhaps pinging a broadcast IP or any other way, which would include all possible mac adresses? One possibility I know is ping sweep, but that might take a long time (longer than 5 minutes of aging time) and I'd like to see if there is any alternative.
The switch only learns about MAC addresses when a device sends an Ethernet frame to it. So the only way to get the CAM table populated with all of the devices is to get all of the devices to talk.
however, I think you're over thinking the problem. if you just start with what is already there I bet you will get most, if not all, of your devices.
Unless you've got thousands of hosts a ping sweep should almost certainly complete before the switch MAC table caches out the entries. Have you run a ping sweep to check the results?
As an alternative approach, you could use the mac address-table notification feature in conjunction with the relevant show outputs.
This feature will keep a history table of all changes to the mac address table - so if you take a copy of the mac address table at time A and then enable this feature and monitor it for a few days you should end up with a pretty comprehensive world view by combining all the changes with the initial list.
To enable mac address-notification
mac address-table notification change history-size 500 mac address-table notification change
Furthermore, you can have it send SNMP traps so you can collect all the reports easily from an SNMP daemon.
snmp-server host 18.104.22.168 traps SNMP_COMMUNITY_STRING snmp-server enable traps mac-notification change move threshold int range fa0/1 - 24 snmp trap mac-notification change added
Have a look on the sticky mac-address feature. Some info may be found here e.g.. In general, sticky mac-address enables your switch to learn all possible MAC addresses that can appear on the specified switch interface and then save them into the running config. You can write those changes then into the startup config and you'll have all MAC addresses from your network saved and persistant.