Cisco Support Community
Showing results for 
Search instead for 
Did you mean: 

Welcome to Cisco Support Community. We would love to have your feedback.

For an introduction to the new site, click here. If you'd prefer to explore, try our test area to get started. And see here for current known issues.

New Member

help using snmp to set trunk port

I need some assistance in locating the mib/variables to allow me to set a trunk port and add/remove vlans on that interface. The equivalent of:

switchport mode trunk

switchport trunk encapsulation dot1q

switchport trunk allowed vlan 400,401

This is on a 4506 running IOS 12.2.25 but will later include other IOS based switches. I could use setHostConfig and but would like to avoid that if possible.



  • Network Management
New Member

Re: help using snmp to set trunk port

Not sure if this will give you all you need, but.....the closest I could find are:



Hopefully, these 2 MIB's can maybe lead you in the right direction. Go here to view these:

New Member

Re: help using snmp to set trunk port

Hi Todd,

I had looked at the CISCO-VTP-MIB and my first thoughts was that it was just informational but after closer inspection I think it will do what I want but not without a lot of pain.

Thanks for your input.


New Member

Re: help using snmp to set trunk port

"There is no joy, if there is no pain." author unknown, but probably a Cisco Sales Engineer :o).

New Member

Re: help using snmp to set trunk port


I really would not recommend to do so.

First you need to know which interface-index is associated to the interface. That's not a big thing but it has to be done first.

Then you need to change several OIDs in the CISCO-VTP-MIB, like vlanTrunkPortDynamicStatus ( (This one is read-only access so you can't set it, it's just an example for trunk related OIDs)

A VERY good source for OIDs is, use the search function.

(Try keyword: TrunkPortDynamicStatus to get an idea)

But, like mentioned before, you need to change several OIDs and you really need to know what you're doing.

I personally read (GET, GETNEXT) information like that from my devices but I wouldn't set them.

And: Different plattform - different OIDs.

Hope, that helped at least a little bit.