how to put a port to trunk mode using SNMP on Catalyst 2970 and 3759G switch

Unanswered Question
Apr 17th, 2010
User Badges:


Has anybody figured out how to change the mode of a port on Catalyst 2970 and 3750G

switch from access to trunk using SNMP?

On Catalyst 3500XL switch, when I did an SNMP walk on vlanTrunkPortRowStatus mib

variable in CISCO-VTP-MIB, I only gathered the trunk port information and this result is

correct.I can put a port to trunk mode by assigning 'createAndGo' value to vlanTrunkPortRowStatus

mib vatiable.

But unfortunately, on Catalyst 2970 and 3750G, I gathered all access port and trunk port information

when I did so. Using this mib, I can't realize my goal.

Is there another way of accomplishing this using SNMP?



  • 1
  • 2
  • 3
  • 4
  • 5
Overall Rating: 0 (0 ratings)
Joe Clarke Sat, 04/17/2010 - 09:33
User Badges:
  • Cisco Employee,
  • Hall of Fame,

    Founding Member

The CISCO-VTP-MIB is the way to go on 2970 and 3750 switches.  All access ports will have a vlanTrunkPortDynamicStatus value of notTrunking(2) where as all trunk ports will have the value of trunking(1).  To change an access port to trunk port, do:

vlanTrunkPortEncapsulationType.IFINDEX -> 4 (for dot1q encap)

vlanTrunkPortDynamicState.IFINDEX -> 1

That's the simplest way of doing things.  You can also set things like native VLAN and allowed VLANs in the same vlanTrunkPortTable.


Please support CSC Helps Haiti


This Discussion