File: disable-port-ingress-filtering.py

package info (click to toggle)
snimpy 0.8.3-1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 484 kB
  • ctags: 435
  • sloc: python: 3,361; makefile: 6
file content (22 lines) | stat: -rw-r--r-- 570 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/snimpy

"""Disable port ingress filtering on Nortel switch (also known as
filter-unregistered-frames)."""

from __future__ import print_function

import sys

load("SNMPv2-MIB")
load("Q-BRIDGE-MIB")

s = M(host=sys.argv[1], community=sys.argv[2])

if "Ethernet Routing Switch 55" not in s.sysDescr:
    print("Not a 5510")
    sys.exit(1)

for id in s.dot1qPortIngressFiltering:
    if s.dot1qPortIngressFiltering[id]:
        print("Filtering on port %d of %s is not disabled, disable it." % (id, sys.argv[1]))
        s.dot1qPortIngressFiltering[id] = False