Registry / devops / python-iptables

python-iptables

JSON →
library1.2.0pypypi✓ verified 35d ago

Python bindings for iptables, providing a Pythonic interface to manipulate Linux netfilter rules. Currently at v1.2.0, with infrequent releases and limited maintenance.

devopshttp-networking
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

The library uses the alias 'iptc' (short for iptables C bindings).

from iptc import Table

List all rules in the FILTER table. Run as root.

import os from iptc import Table, Chain, Rule, Match, Target table = Table(Table.FILTER) for chain in table.chains: print(f"Chain {chain.name}") for rule in chain.rules: print(f" Rule: {rule.src} -> {rule.dst}")
Debug
Known footguns
breakingMust be run as root (or with CAP_NET_ADMIN). Non-root users will get permissions error.
deprecatedNo longer maintained; last release 1.2.0 (2020). Consider alternatives like nftables for new projects.
gotchaTable.commit() must be called to apply rule changes. Forgetting it leaves rules unapplied.
Upgrade
Version history

Breaking-change detection hasn't run for this library yet.

Audit
Security & dependencies

CVE tracking and dependency tree are planned for a later release.

Agent activity
0 hits · last 30 days

No traffic data recorded yet.

Resources