SNMP ModuleΒΆ
This module can create VLAN and managed the PVID of a port. It uses SNMP and supports devices that support the Q-BRIDGE-MIB and IF-MIB
When a port is configured using SNMP the configuration is applied to the switchport general and thus is only active when the switchport mode is set to general.
For the WISI Novalink switch the following model can be used to deploy the following configuration:
Allow vlan 100 and 101 on uplink port twe1
Set vlan 100 as untagged on port twe3
Allow vlan 101 as tagged on port twe4
import snmp
device = snmp::Device(
name="switch1",
hostname="192.168.17.109",
community="inmanta",
)
twe1 = snmp::Port(device=device, name="twe1", port_mode="general")
twe3 = snmp::Port(device=device, name="twe3", port_mode="general", pvid=100)
twe5 = snmp::Port(device=device, name="twe4", port_mode="general")
snmp::VLAN(
device=device,
vlan_id=100,
name="Service ABC100",
egress_ports=[twe1, twe3],
untagged_ports=[twe3]
)
snmp::VLAN(
device=device,
vlan_id=101,
name="Service ABC101",
egress_ports=[twe1, twe4],
)
egress ports: ports on which the vlan is allowed tagged and untagged
untagged ports: ports on which frames of this vlan should be pushed out without a vlan tag. This port MUST also be listed in the egress ports.
pvid: the vlan id to assign to untagged frames that ingress into the port