A VLAN is a group of switch ports that share broadcast messages. By default, a trunk port is a member of all VLANs. It shares broadcast messages of all VLANs with the connected device.
VTP pruning automatically manages VLAN membership on a trunk connection. It keeps membership of active VLANs only. It automatically removes membership of inactive VLANs.
Let us take an example.
The following image shows a network. Switch1 and Switch2 have a trunk connection on Gig0/1. Switch1 has VLAN-10 and VLAN-20. Switch2 has VLAN-20 and VLAN-30. VTP pruning is not enabled on both switches.
By default, a trunk port is a member of all VLANs. Switch1's trunk port is a member of VLAN-10 and VLAN-20. It forwards broadcast messages from both VLANs to Switch2. Switch2's trunk port is a member of VLAN-20 and VLAN-30. It forwards broadcast messages from VLAN-20 and VLAN-30 to Switch1.
Switch1 has no member in VLAN-30. It drops all broadcast messages it receives for VLAN-30. Similarly, Switch2 drops all traffic it receives for VLAN-10.
With this configuration , both switches are wasting bandwidth and resources. To fix this issue, you can manually configure the VLAN membership on the trunk ports of both switches.
In this example, you need to remove VLAN-10's membership from Switch1's trunk port and VLAN-30's membership from Switch2's trunk port.
The main problem with this approach is that if you add a VLAN-10 member to Switch2 or a VLAN-30 member to Switch1, you need to add these VLAN memberships to trunk ports again.
This is a complex and confusing task in a multi-switched network with multiple VLANs, where every VLAN is not necessarily active on every switch. You may accidentally prune a VLAN from a trunk, creating connectivity problems.
VTP pruning
VTP pruning solves this problem. It dynamically manages VLAN membership on trunk ports based on the configured VLANs.
If we enable VTP pruning on both switches, Switch1 will not forward VLAN-10's broadcast messages to Switch2, and Switch2 will not forward VLAN-30's broadcast messages to Switch1.
VTP pruning enabled trunk ports share VLAN information. Switch1's trunk port shares Switch1's VLAN information with Switch2. Switch2's trunk port shares Switch2's VLAN information with Switch1. From the shared information, Switch2 learns about Switch1's VLANs, and Switch1 learns about Switch2's VLANs.
Based on the remote switch's configured VLANs, VTP Pruning automatically updates VLAN membership on the local trunk port.
In this example, Switch1 removes VLAN-10, and Switch2 removes VLAN-30 from the trunk ports. They exchange only VLAN-20's broadcast messages.
If you add a VLAN to a switch, the switch shares that information with all connected switches. From the shared information, connected switches automatically update VLAN information on their trunk ports.
For example, if you add a VLAN-10 member to Switch2, Switch2 shares this information with Switch1, and Switch1 adds VLAN-10 to the trunk port.
If you remove all members of VLAN-20 from Switch1, Switch1 shares this information with Switch2, and Switch2 removes VLAN-20 from the trunk port connected to Switch1.
This way switches automatically update VLAN membership on trunk ports based on the active VLANs on the remote switches.
VTP modes
You can enable VTP pruning in VTP server mode only. A VTP server shares VTP pruning information only with other VTP servers and clients. A switch in transparent mode can not incorporate VTP messages. In transparent mode, you need to manually manage VLAN information on trunk ports.
This tutorial is a part of the tutorial series on VLAN, VTP, and DTP Concepts and Configurations on Cisco Routers. Other parts of this series are the following.
Chapter 01 VLAN Basic Concepts Explained with Examples
Chapter 02 Advantages and Disadvantages of VLANs
Chapter 03 Static and Dynamic VLAN Membership Explained
Chapter 04 Access Link and Trunk Link Explained
Chapter 05 VLAN Tagging Explained with DTP Protocol
Chapter 06 DTP Modes and Protocol Explained
Chapter 07 802.1Q Native VLAN concept Explained
Chapter 08 Cisco Inter-Switch Link (ISL) Explained
Chapter 09 Trunk Tagging and Frame Tagging Explained
Chapter 10 VTP Modes and VTP Protocol Explained
Chapter 11 VTP Pruning on switches Explained
Chapter 12 VLAN Practice Lab Setup in Packet Tracer
Chapter 13 Configure VTP Server and Client in Switch
Chapter 14 VLAN Configuration Commands Step by Step Explained
Chapter 15 Router on Stick Configuration Explained