ldx / python-iptables

Python bindings for iptables
730 stars 182 forks source link

iptables and iptables-legacy with Docker containers #319

Open ghost opened 3 years ago

ghost commented 3 years ago

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 on the host machine, it uses iptables-legacy. However, sometimes I need to access and modify the rules from iptables. I'm running Raspberry Pi OS.

Is it possible to specify the binary (?) that iptc uses?

Thanks!

ldx commented 3 years ago

It's not a binary, python-iptables uses the underlying C libraries, so it can only work with iptables-legacy rules.

Can you make sure you always use iptables-legacy, both on the host and in the container?

ghost commented 3 years ago

I will try and see if it works for me.