Switches, Hubs, and Modems
Showing results for 
Search instead for 
Did you mean: 

Vlan configuration via snmp on HP switches

Occasional Visitor

Vlan configuration via snmp on HP switches


at first, I will explain, what I want to do. I write a bash script to configure Vlans on a HP switch, for exsample 3500yl. I want to do it via snmp.

The Vlan-names and ids, are saved on a switch, I did it manualy with cli. Now, I want to assign Vlans to ports. It works with untagged ports. I can assign Vlan to a port, when it stays untagged.

I do it with these oid: (Q-BRIDGE-MIB :: dot1qPvid).

My problem is, I connot assign Vlans, if the port is already tagged. I know, how to set the port untagged, but I want to add to a tagged port with a specified Vlan another Vlan, so a tagged port can pass two oder more Vlans if it is tagged.

I do not have any problems with untagged ports, but I can not do with tagged.

If I query the switch with this OID: (Q-BRIDGE-MIB :: dot1qVlanStaticEgressPorts), I get a hex string, but I don't know, how to decode it.

Have anybody some experience in it, or can give me a hint ?

Thanks a lot.

Occasional Visitor

Re: Vlan configuration via snmp on HP switches

Convert the 64-bit hex-string to binary.
0: port is NOT present on that vlan
1: port is present on the that vlan

As for your first question, I believe that you have to set the port to UNtagged then move it to the desired VLAN using:

snmpset -v 2c -c community hostIP MemberOfVLAN-OID x "HEXstring-with-ALL-the-ports-which-you-want-turned-on"