Using the SNMP to Configure VLANs

  1. Use the objects in dot1qVlanStaticTable (in dot1qVlan in the QBRIDGE-MIB module) to create VLANs 2 and 3.

    Set the dot1qVlanStaticRowStatus object to ‘CreateandGo (4)‘ to create a VLAN. If the other parameters are not specified, simply specifying the dot1qVlanIndex and dot1qVlanStaticRowStatus is sufficient to create the VLAN.

    The full path to the object is iso(1).org(3).dod(6).internet(1).mgmt(2).mib-2(1).dot1dBridge(17).qBridgeMIB(7). qBridgeMIBObjects(1).dot1qVlan(4).dot1qVlanStaticTable(3).dot1qVlanStaticEntry(1).dot1qVlanStaticRowStatus(5).

    Click to expand in new window
    GUID-FF4F7BAB-11EA-46F3-BA09-1CE36ED421FE-low.jpg
  2. To assign ports 1/0/1 and 1/0/2 to VLAN2, retrieve the current dot1qStaticEgressPorts mask and append interfaces 1/0/1 and 1/0/2 to this mask by setting the first octet to 0xC0.
    The dot1qVlanStaticEgressPorts bit mask can be constructed according to the following rules:
    • Each octet within this value specifies a set of eight ports, with the first octet specifying ports (1-8), the second octet specifying ports (9-16), and so on.
    • Within each octet, the most significant bit represents the lowest numbered port, and the least significant bit represents the highest numbered port. Thus, each port of the bridge is represented by a single bit within the value of this object. If that bit has a value of 1, then that port is included in the set of ports. The port is not included if its bit has a value of 0.

    For example, if the switch has 12 ports and we want to add ports 1 and 4 in the VLAN and exclude all other ports, then the bit mask in hex will be 0x50 0x00.

  3. To specify that frames will always be transmitted tagged from ports that are members of VLAN 2, use the dot1qVlanStaticUntaggedPorts object and set the value of the appropriate number of octets to 0.
    Each octet represents eight ports, so for a 48-port switch, the first six octets would be zero.
  4. To specify that ports 1/0/1 and 1/0/2 will only accept tagged frames and will reject untagged frames on receipt, set the dot1qPortAcceptableFrameTypes object to admitOnlyVlanTagged(2).
    The object is in dot1qPortVlanEntry in the dot1qPortVlanTable.
  5. To assign VLAN3 as the default VLAN for interface 1/0/2., set the value of dot1qPvid for 1/0/2 (instance 2) to 3.
  6. To assign ports 1/0/2, 1/0/3, and 1/0/4 to VLAN3, retrieve the current dot1qStaticEgressPorts mask and append the interfaces to this mask by setting the first octet to 0x70.