ldx / python-iptables

Python bindings for iptables
730 stars 183 forks source link

iptc.ip4tc.IPTCError: can't initialize filter: b'Permission denied (you must be root)' #251

Closed leond08 closed 4 years ago

ldx commented 6 years ago

@leond08 you should run your script or application as root to be able to use iptables.

matinats commented 4 years ago

Why? I am running a firewalld inside a docker container that runs as a non-root user. If I give the container and this firewalld script the NET_ADMIN capability, why not run as user? The script imports iptc and applies rules. If I try to run directly iptables commands they execute successfully. Why not iptc?