python-iptables
python-iptables copied to clipboard
Python bindings for iptables
Environment: - OpenWRT 19.07 - iptables v1.8.3 (legacy) Sample code: ```python import os os.environ['XTABLES_LIBDIR'] = "/usr/lib/iptables" os.environ['PYTHON_IPTABLES_XTABLES_VERSION'] = "12" import iptc print(iptc.easy.dump_table('filter', ipv6=False)) ``` Full result: ``` Traceback (most recent...
Not sure why iptc cannot work with syslog module. For the following code, test1 will only send the first 2 log messages. test2 and test3 works properly. I tested this...
I'm running a Docker container on the `host` network. I figured out that creating iptables from inside the container will make them appear in the host's `iptables-legacy`. When running `iptc`...
Hi, ### Disclamer: First all - I'm fairly new to python and this is my first project with python-iptables - so I'm sorry if this it not the correct place...
when i update iptables after use docker swarm deploy some stack. It's failed. Anybody knows how to fix this? ``` Traceback (most recent call last): File "/usr/local/lib/python3.5/dist-packages/applianced/job_base.py", line 73, in...
this is not working. ``` for chain in self.table.chains: if chain.is_builtin(): chain.flush() ```
Hi, I try use iptc module inside namespace and as soon as I use iptc.Target() somehow it do something with my namespace that when I delete it from system my...
Replication is simple. Create a new chain in the nat ip6table, e.g. ``` # ip6tables -t nat -N foo ``` Try to add that chain as the target of a...
Hi, I have a custom chain where packets are marked for further processing. What I am trying to do is - Look up for a special rule base on its...
I am trying to run the python-iptables as a non-root user. My script is test.py: import iptc import os uid = os.getuid() print("Real user ID of the current process:", uid)...