File: disable-port-ingress-filtering.py

package info (click to toggle)
snimpy 1.0.3-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 584 kB
  • sloc: python: 4,141; makefile: 21
file content (20 lines) | stat: -rw-r--r-- 531 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/snimpy

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

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