Iptables inserted by LXD and iptables-persistent


(John R) #1

Is it possible for iptables inserted by LXD and iptables-persistent to work together.

On installation, iptables-persistent saves all of LXD’s rules into /etc/iptables/rules.v4

Do I need to ensure that I only keep my own port-forwarding rules in this file, to avoid duplicating LXD’s?


#2

In general, the iptables rules of LXD do not change over time and I do not think there have been any changes for the rules over the last versions.
Installing iptables-persistent and having them auto-capture the current rules is an easy way to save any IP forwarding rules you have applied without additional effort.
I suppose that it would be an issue to revisit if you actually get problems with iptables-persistent messing with LXD.


(Stéphane Graber) #3

LXD always clears its rules (based on the generated comment it puts in them) so having them restored shouldn't be a problem, LXD will just reset things when it starts.