Browse Source

add a couple examples..

ssh-lenovo
John-Mark Gurney 5 years ago
parent
commit
916a869da8
1 changed files with 19 additions and 0 deletions
  1. +19
    -0
      vlanmang.py

+ 19
- 0
vlanmang.py View File

@@ -44,6 +44,11 @@ class SwitchConfig(object):
pysnmp.hlapi.UsmUserData object, either of which can write to the
necessary MIBs to configure the VLANs of the switch.

Example for SNMPv3 where the key for both authentication and
encryption are the same:
UsmUserData('username', key, key, authProtocol=usmHMACSHAAuthProtocol,
privProtocol=usmDESPrivProtocol)

vlanconf -- This is a dictionary w/ vlans as the key. Each value has
a dictionary that contains keys, 'u' or 't', each of which
contains the port that traffic should be sent untagged ('u') or
@@ -53,6 +58,20 @@ class SwitchConfig(object):
index number, or it can be a string, which will be looked up via
the IF-MIB::ifName table.

Example specifies that VLANs 1 and 2 will be transmitted as tagged
packets on the port named 'lag1'. That ports 1, 2, 3, 4 and 5 will
be untagged on VLAN 1, and ports 6, 7, 8 and 9 will be untagged on
VLAN 2:
{ 1: {
'u': [ 1, 2, 3, 4, 5 ],
't': [ 'lag1' ],
},
2: {
'u': [ 6, 7, 8, 9 ],
't': [ 'lag1' ],
},
}

ignports -- Ports that will be ignored and not required to be
configured. List any ports that will not be active here, such as
any unused lag ports.


Loading…
Cancel
Save