Search.setIndex({"docnames": ["examples", "index", "intro", "usage"], "filenames": ["examples.rst", "index.rst", "intro.rst", "usage.rst"], "titles": ["Examples", "Welcome to python-iptables\u2019s documentation!", "Introduction", "Usage"], "terms": {"python": [0, 3], "iptabl": [0, 3], "implement": [0, 3], "low": [0, 3], "interfac": [0, 2], "tri": [0, 3], "close": 0, "underli": 0, "c": [0, 2], "librari": [0, 2], "The": [0, 2, 3], "modul": [0, 1], "iptc": [0, 2], "improv": 0, "usabl": 0, "provid": [0, 2], "rich": 0, "set": [0, 2], "function": 0, "design": 0, "simplifi": 0, "interact": 0, "import": [0, 2], "dump_tabl": 0, "nat": [0, 3], "ipv6": [0, 2, 3], "fals": 0, "input": 0, "output": [0, 2], "postrout": 0, "prerout": 0, "dump_chain": 0, "filter": [0, 2, 3], "comment": 0, "dn": 0, "traffic": 0, "googl": 0, "1": 0, "56": 0, "dst": 0, "8": 0, "32": 0, "protocol": 0, "udp": 0, "accept": 0, "dport": 0, "53": 0, "add_chain": 0, "testchain": 0, "true": 0, "rule_d": 0, "tcp": 0, "22": 0, "insert_rul": 0, "delete_chain": 0, "flush": 0, "goto": 0, "A": [0, 3], "forward": 0, "p": 0, "gre": 0, "g": 0, "testchaingoto": 0, "rule_goto_d": 0, "In": 0, "you": [0, 2, 3], "usual": [0, 2], "first": [0, 2], "creat": [0, 3], "ani": 0, "sourc": [0, 1], "destin": 0, "address": [0, 3], "out": [0, 2], "specifi": [0, 2, 3], "in_interfac": 0, "eth0": 0, "src": 0, "192": 0, "168": 0, "0": 0, "255": 0, "thi": [0, 2, 3], "packet": [0, 2, 3], "come": [0, 2], "ip": 0, "mai": [0, 2], "contain": [0, 2], "i": [0, 1, 3], "like": [0, 2], "certain": 0, "attribut": 0, "while": 0, "tell": [0, 3], "what": [0, 1, 3], "do": [0, 2, 3], "drop": 0, "transform": 0, "somehow": 0, "etc": [0, 2], "One": 0, "can": [0, 2, 3], "via": [0, 1], "m": 0, "create_match": 0, "t": [0, 2], "create_target": 0, "paramet": 0, "chang": [0, 2], "after": [0, 2], "them": [0, 3], "It": [0, 2], "also": [0, 2, 3], "perfectli": 0, "valid": 0, "instanti": 0, "constructor": 0, "still": 0, "need": [0, 2, 3], "have": [0, 2, 3], "add": 0, "manual": 0, "add_match": 0, "might": 0, "take": 0, "object": [0, 3], "To": [0, 2, 3], "port": 0, "80": 0, "up": [0, 2], "mark": 0, "0xff": 0, "ar": [0, 2], "alwai": 0, "string": 0, "suppli": 0, "valu": 0, "note": 0, "most": [0, 2], "extens": [0, 2, 3], "For": [0, 3], "state": 0, "relat": 0, "establish": 0, "work": 0, "howev": 0, "foobar": 0, "throw": 0, "an": [0, 2], "except": 0, "traceback": 0, "recent": 0, "call": [0, 2, 3], "last": 0, "file": [0, 2], "py": [0, 2], "line": [0, 3], "7": [0, 2], "home": 0, "user": [0, 2, 3], "project": 0, "ip4tc": 0, "369": 0, "__setattr__": 0, "self": 0, "pars": [0, 2], "name": 0, "replac": 0, "_": 0, "286": 0, "_pars": 0, "argv": 0, "inv": 0, "entri": 0, "516": 0, "ct": 0, "cast": 0, "_ptrptr": 0, "pointer": 0, "c_void_p": 0, "xtabl": [0, 2], "736": 0, "new": 0, "ret": 0, "fn": 0, "arg": 0, "1031": 0, "parse_match": 0, "xtableserror": 0, "error": 0, "2": [0, 2], "option": 0, "consist": 0, "multipl": 0, "word": 0, "good": 0, "127": 0, "test": [0, 2], "just": 0, "one": [0, 2, 3], "when": [0, 3], "pass": 0, "list": [0, 2], "let": 0, "": [0, 2], "assum": 0, "ipset": 0, "blacklist": 0, "command": [0, 3], "match_set": 0, "how": 0, "time": 0, "wa": 0, "us": [0, 1, 3], "sinc": [0, 2], "expect": 0, "two": 0, "see": 0, "manpag": [0, 2], "find": 0, "inform": 0, "readi": 0, "construct": 0, "your": [0, 2, 3], "want": 0, "show": 0, "put": [0, 2], "cours": [0, 2], "check": [0, 2], "intefac": 0, "print": 0, "all": [0, 2], "proto": 0, "out_interfac": 0, "As": [0, 2], "code": 0, "snippet": 0, "abov": 0, "organ": 0, "fix": 0, "ipv4": [0, 2, 3], "mangl": [0, 3], "raw": [0, 3], "secur": [0, 3], "access": 0, "create_chain": 0, "sudo": [0, 2], "l": 0, "n": [0, 2], "refer": [0, 2], "prot": 0, "opt": 0, "exist": 0, "len": 0, "10": 0, "There": 0, "basic": [0, 2], "e": 0, "reject": 0, "eth": 0, "we": 0, "either": 0, "target_nam": 0, "match_nam": 0, "method": 0, "could": 0, "been": 0, "instead": 0, "former": 0, "save": 0, "anoth": 0, "which": [0, 2, 3], "go": 0, "1234": 0, "0xffff": 0, "set_mark": 0, "mandatori": 0, "insert": 0, "masquerad": 0, "to_port": 0, "here": [0, 2], "onli": [0, 3], "properti": 0, "decid": 0, "whether": [0, 2], "appli": [0, 3], "follow": 0, "iprang": 0, "src_rang": 0, "100": 0, "200": 0, "dst_rang": 0, "172": 0, "33": 0, "106": 0, "equival": 0, "rang": 0, "j": 0, "negat": 0, "front": 0, "mac": 0, "mac_sourc": 0, "00": 0, "11": 0, "44": 0, "55": 0, "result": 0, "polici": [0, 1], "queri": 0, "byte": 0, "get_count": 0, "refresh": 0, "connect": 0, "sy": 0, "pleas": 0, "send": 0, "some": 0, "stdout": 0, "sleep": 0, "3": [0, 2], "get": 0, "back": 0, "same": [0, 2], "even": 0, "hit": 0, "updat": [0, 2], "sport": 0, "togeth": 0, "default": [0, 2], "automat": 0, "perform": 0, "commit": 0, "each": [0, 2, 3], "oper": 0, "That": 0, "effect": 0, "immedi": 0, "happen": 0, "batch": 0, "typic": 0, "case": 0, "travers": 0, "remov": 0, "specif": 0, "criteria": 0, "If": [0, 2], "enabl": 0, "delet": 0, "restart": 0, "someth": 0, "delete_rul": 0, "break": 0, "clearli": 0, "ideal": 0, "veri": 0, "readabl": 0, "altern": 0, "disabl": 0, "than": 0, "drawback": 0, "singleton": 0, "instanc": 0, "includ": [0, 2], "support": [0, 1], "defin": [0, 2], "convert": 0, "from": [0, 1, 3], "encode_iptc_rul": 0, "obtain": 0, "represent": 0, "decode_iptc_rul": 0, "These": 0, "mainli": 0, "caus": 0, "complex": [0, 2], "upstream": 0, "netfilt": [0, 2], "requir": 0, "quit": [0, 3], "signific": 0, "effort": 0, "workaround": 0, "avail": [0, 2], "hashlimit": 0, "explicitli": 0, "hashlimit_htable_expir": 0, "201": 0, "notrack": 0, "problemat": 0, "204": 0, "content": 1, "introduct": 1, "about": 1, "instal": 1, "pip": 1, "compil": 1, "custom": 1, "usag": 1, "table6": 1, "chain": [1, 2], "match": [1, 2], "target": [1, 2], "rule": [1, 2], "rule6": 1, "iptcerror": 1, "exampl": 1, "high": [1, 3], "level": [1, 3], "abstract": 1, "more": [1, 2, 3], "counter": 1, "autocommit": 1, "easi": 1, "dictionari": 1, "known": 1, "issu": 1, "index": 1, "search": [1, 2], "page": 1, "tool": 2, "manag": 2, "standard": 2, "manipul": 2, "framework": 2, "under": 2, "linux": 2, "maintain": 2, "inspect": 2, "tabl": 2, "kernel": 2, "sever": 2, "differ": 2, "number": 2, "built": [2, 3], "jump": [2, 3], "pythonesqu": 2, "wrapper": 2, "bind": 2, "interoper": 2, "achiev": [2, 3], "libiptc": 2, "libxtabl": 2, "binari": 2, "its": 2, "meant": 2, "primarili": 2, "dynam": 2, "router": 2, "firewal": 2, "where": 2, "often": 2, "program": 2, "wish": 2, "look": 2, "ebtabl": 2, "6": 2, "4": 2, "wai": [2, 3], "upgrad": 2, "make": 2, "sure": 2, "distribut": 2, "share": 2, "so": 2, "thei": [2, 3], "lib": 2, "ubuntu": 2, "distutil": 2, "cd": 2, "setup": 2, "build": 2, "virtualenv": 2, "mkvirtualenv": 2, "system": 2, "packag": 2, "directori": 2, "linker": 2, "path": 2, "ld": 2, "conf": 2, "folder": 2, "co": 2, "d": 2, "usr": 2, "local": 2, "now": 2, "run": 2, "warn": 2, "don": 2, "product": 2, "machin": 2, "would": 2, "continu": 2, "y": 2, "part": 2, "necessari": 2, "reset": 2, "environ": 2, "otherwis": 2, "onc": 2, "everyth": 2, "place": 2, "fire": 2, "Of": 2, "root": 2, "abl": 2, "stuck": 2, "old": 2, "version": 2, "date": 2, "locat": 2, "ask": 2, "tmp": 2, "git": 2, "clone": 2, "org": 2, "autogen": 2, "sh": 2, "configur": 2, "prefix": 2, "depend": 2, "point": 2, "iptables_libdir": 2, "xtables_libdir": 2, "ones": 2, "well": 2, "full": 2, "document": 2, "api": [2, 3], "mimic": 3, "logic": 3, "network": 3, "translat": 3, "modifi": 3, "variou": 3, "insid": 3, "ha": 3, "few": 3, "own": 3, "other": 3, "should": 3, "end": 3, "reach": 3, "zero": 3, "kind": 3, "plethora": 3, "class": 3, "belong": 3, "hide": 3, "detail": 3, "virtual": 3, "anyth": 3}, "objects": {}, "objtypes": {}, "objnames": {}, "titleterms": {"exampl": 0, "high": 0, "level": 0, "abstract": 0, "rule": [0, 3], "chain": [0, 3], "tabl": [0, 1, 3], "more": 0, "about": [0, 2], "match": [0, 3], "target": [0, 3], "counter": 0, "autocommit": 0, "easi": 0, "dictionari": 0, "known": 0, "issu": 0, "welcom": 1, "python": [1, 2], "iptabl": [1, 2], "": 1, "document": 1, "indic": 1, "introduct": 2, "instal": 2, "via": 2, "pip": 2, "compil": 2, "from": 2, "sourc": 2, "us": 2, "custom": 2, "what": 2, "i": 2, "support": 2, "usag": 3, "table6": 3, "polici": 3, "rule6": 3, "iptcerror": 3}, "envversion": {"sphinx.domains.c": 2, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 8, "sphinx.domains.index": 1, "sphinx.domains.javascript": 2, "sphinx.domains.math": 2, "sphinx.domains.python": 3, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx.ext.intersphinx": 1, "sphinx.ext.todo": 2, "sphinx": 57}, "alltitles": {"Examples": [[0, "examples"]], "High level abstractions": [[0, "high-level-abstractions"]], "Rules": [[0, "rules"]], "Chains and tables": [[0, "chains-and-tables"]], "More about matches and targets": [[0, "more-about-matches-and-targets"]], "Counters": [[0, "counters"]], "Autocommit": [[0, "autocommit"]], "Easy rules with dictionaries": [[0, "easy-rules-with-dictionaries"]], "Known Issues": [[0, "known-issues"]], "Welcome to python-iptables\u2019s documentation!": [[1, "welcome-to-python-iptables-s-documentation"]], "Indices and tables": [[1, "indices-and-tables"]], "Introduction": [[2, "introduction"]], "About python-iptables": [[2, "about-python-iptables"]], "Installing via pip": [[2, "installing-via-pip"]], "Compiling from source": [[2, "compiling-from-source"]], "Using a custom iptables install": [[2, "using-a-custom-iptables-install"]], "What is supported": [[2, "what-is-supported"]], "Usage": [[3, "usage"]], "Table": [[3, "table"]], "Table6": [[3, "table6"]], "Chain": [[3, "chain"]], "Policy": [[3, "policy"]], "Match": [[3, "match"]], "Target": [[3, "target"]], "Rule": [[3, "rule"]], "Rule6": [[3, "rule6"]], "IPTCError": [[3, "iptcerror"]]}, "indexentries": {}})