Sunday, July 25, 2010

Virtual Trunking Protocol

VTP (Virtual Trunking Protocol) is a Cisco layer 2 proprietary protocol that allows each switch in the network to have an overall view of the active VLANs. VTP can add, delete or modify VLANs and is distributed over the network thus reduce administration in every switch manually.

Without VTP, a switch configuration will not be forwarded to the other switches in the network. This can be a major problem when a switch creates a VLAN. With VTP, this problem can be prevented because VTP notify their neighbors by sending VTP advertisements originating from the switch that sends the advertisement. However, VTP advertisements can only happen in network with the same domain. These advertisements are multicast but are only send to switches trunking with the local switch.

In default, a cisco switch does not have a domain. To create a domain, type the command “vtp domain XXX” (with XXX is the domain name) in the switch’s configuration mode. Do the same on the other switches that needs to be put in the same domain. A cisco switch can only belong to 1 domain only.

There are also operating modes marked by VTP Operation Mode in the “show vtp status” command. The default setting of Cisco switches is in the “SERVER” mode. In this mode, a VTP switch can be used to add, delete or modify VLANs. Therefore, a VTP domain deployment needs to have at least 1 VTP set in the “Server” mode (make sure this switch is really secured physically). Another mode is the “CLIENT” mode. This mode cannot do anything except listen for VTP advertisement and change its settings if required by the advertisement. The last mode is the “TRANSPARENT” mode. This mode is used when the switch is set not to advertise its VLAN configuration and not to synchronize its VLAN configuration based on VTP received advertisements. VLANS can be created, changed or deleted when in transparent mode but are locally significant only. In VTP version 1, transparent switches forwards only VTP messages that they receive from VTP advertisements but do not synchronize or send its VTP configuration ONLY if the VTP version number and domain name on that switch is the same as on its downstream switches. In VTP version 2, transparent switches forwards only VTP messages that they receive from VTP advertisements but do not synchronize or send its VTP configuration even though the domain name doesn’t match. To switch between these modes type the “vtp mode client/server/transparent” in the switch configuration mode.

A VTP advertisement itself will be sent if the Configuration Revision on the switch (in the Server mode) is changed/added. The receiving switch (either in client or server mode) will inspect the value of the revision. If the value is higher than its own configuration revision number, then the receiving switch will revise its configuration according to the advertisement. If it receives a lower or the same value, it will not change its value. To reset a switch’s revision number change the VTP domain name to a nonexistent domain and change it back to the original name or a second way is to change the VTP mode to transparent and then back to the server mode.

No comments:

Post a Comment