Cisco IOS Switch – Why Is ‘no spanning-tree vlan XXX’ Automatically Inserted on VLAN Creation?

ciscocisco-ioscisco-ios-12spanning tree

Yesterday we added a few VLANs (218-220) to one of our core-switches (WS-C3560X-24, c3560e-universalk9-mz.122-55.SE3 running as vtp-server) and noticed that a configuration directive no spanning-tree vlan 218-220 was automatically inserted into the switches runnig-configuration.

We are working with these switches for years now and such a directive was never automatically inserted on vlan creation. The VLANs were created by issuing the vlan 218 and respective commands.

What caused this directive to be added to the switches config?

We didn't upgrade the switches firmware recently.

Best Answer

Cisco switches do this automatically for new VLANs when you have exceeded the platform's maximum spanning-tree instance limit. With Cisco PVST+, the switch will run one spanning-tree instance on each VLAN on each active interface.

If you do a show spanning-tree summary at the CLI, you will likely find that the STP Active count will be at or near 128 or 256 for the platforms you mention (depending on platform, older platforms may be lower).

To reduce the number of active spanning-tree instances, you have a several options:

  1. If your switches are all Cisco and running in VTP server or client mode, then you can enable VLAN pruning on the VTP server(s) with the vtp pruningcommand. This will prune unnecessary VLANs from your trunk links automatically.
  2. If any of your switches are in VTP transparent mode or you use multiple vendors, you may need to manually prune unnecessary VLANs by using switchport trunk allowed vlan <VLAN list> command to the trunk interfaces.
  3. Reduce the number of active trunk ports or access ports. Trunk ports will make the largest difference. For instance, if you have multiple trunk ports between the same two switches, converting them to a single link aggregation group will reduce the number of logical connections.
  4. Remove unnecessary VLANs. Maybe you have some old unused VLANs that are no longer needed? Remove them.