From 916a869da8194c211455ba184624c8f03295487e Mon Sep 17 00:00:00 2001 From: John-Mark Gurney Date: Mon, 23 Sep 2019 16:15:31 -0700 Subject: [PATCH] add a couple examples.. --- vlanmang.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/vlanmang.py b/vlanmang.py index 7d10923..2abf349 100644 --- a/vlanmang.py +++ b/vlanmang.py @@ -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.