lxc / incus

Powerful system container and virtual machine manager
https://linuxcontainers.org/incus
Apache License 2.0
2.69k stars 222 forks source link

When I delete a port forward, the iptables rules are not deleted. #305

Closed viniciusbarretobr closed 10 months ago

viniciusbarretobr commented 10 months ago

Required information

Issue description

When I delete a port forward, the iptables rules are not deleted. They only disappear after we restart the main operating system

Steps to reproduce

  1. Create a forward port for an ip
  2. delete a forward
  3. Run the command "iptables -nvL -t nat" and see that the rules are still there.

Information to attach

stgraber commented 10 months ago

Can you show the incus info output? I'd like to know what firewall driver Incus is using.

stgraber commented 10 months ago

Okay, so the issue is that your system must have been using the iptables nft shim.

You can avoid this by either installing the nftables package or using update-alternatives to switch iptables, ip6tables and ebtables to their "real" binary (legacy).

You must have been getting an error on Incus startup in your incusd.log pointing that situation out.

I found a way to workaround this particular issue so it will work with the nft wrapper tools, but that's not really a setup that we can reliably support, so it'd be best to either fully go back to the old xtables or fully switch to nftables.