python-iptables icon indicating copy to clipboard operation
python-iptables copied to clipboard

iptables and iptables-legacy with Docker containers

Open ghost opened this issue 4 years ago • 2 comments

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!

ghost avatar Mar 03 '21 08:03 ghost

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?

ldx avatar Mar 11 '21 00:03 ldx

I will try and see if it works for me.

ghost avatar Mar 16 '21 08:03 ghost