You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
On the one hand we have examples of some rules which can be created with iptables-nft utility and can't be dumped/restored with nft utility, for instance:
or we have physdev or match-set compatibility rules in iptables-nft which are not supported in nft utility.
On the other hand nft utility can create tables with arbitrary names:
nft add table newtable
which can't be dumped or restored with iptables-nft.
I found an article where it is said that "Mixing iptables-nft and nft on the other hand is not unproblematic, either. A good rule of thumb to avoid issues is to not touch the tables iptables-nft creates with nft." https://www.redhat.com/en/blog/using-iptables-nft-hybrid-linux-firewall
Conclusion here is that nft and iptables-nft are completely incompatible between each other in terms of dumping nftables rules in CRIU, some simple rules created by one may work with another, but surely not all of them as the examples above point out.
When it comes to CRIU we don't know if nftables were created by nft or iptables-nft or even by both of them in the dumpee netns. So it's hard for CRIU to follow "not to mix" rule.
I've prepared a fix for this problem in Virtuozzo CRIU (where we have all kinds of rules in Virtuozzo containers both created with nft and iptables-nft) fork which looks for me more as a workaround:
So for now in Virtuozzo criu where we have all kinds of rules in containers both created with nft and iptables-nft I've prepared a fix which uses both nft and iptables-nft: OpenVZ/vzcriu@d986e6d OpenVZ/vzcriu@8baea43
And it works somehow.
Note: that I do not use libnft to call nft tool in it as I need to call iptables-nft directly anyways, so to be symmetric I call them both directly without library.
Question are: do we want this in mainstream? is there a better way?
The text was updated successfully, but these errors were encountered:
I just don't have so much time to port everything from OpenVZ repos (600+ patches) to mainstream, but if there is something useful in it - please don't hesitate to port it =)
On the one hand we have examples of some rules which can be created with
iptables-nft
utility and can't be dumped/restored withnft
utility, for instance:or we have
physdev
ormatch-set
compatibility rules iniptables-nft
which are not supported innft
utility.On the other hand
nft
utility can create tables with arbitrary names:which can't be dumped or restored with
iptables-nft
.I found an article where it is said that "Mixing iptables-nft and nft on the other hand is not unproblematic, either. A good rule of thumb to avoid issues is to not touch the tables iptables-nft creates with nft." https://www.redhat.com/en/blog/using-iptables-nft-hybrid-linux-firewall
Conclusion here is that
nft
andiptables-nft
are completely incompatible between each other in terms of dumping nftables rules in CRIU, some simple rules created by one may work with another, but surely not all of them as the examples above point out.When it comes to CRIU we don't know if nftables were created by
nft
oriptables-nft
or even by both of them in the dumpee netns. So it's hard for CRIU to follow "not to mix" rule.I've prepared a fix for this problem in Virtuozzo CRIU (where we have all kinds of rules in Virtuozzo containers both created with
nft
andiptables-nft
) fork which looks for me more as a workaround:So for now in Virtuozzo criu where we have all kinds of rules in containers both created with nft and iptables-nft I've prepared a fix which uses both nft and iptables-nft:
OpenVZ/vzcriu@d986e6d
OpenVZ/vzcriu@8baea43
And it works somehow.
Note: that I do not use libnft to call
nft
tool in it as I need to calliptables-nft
directly anyways, so to be symmetric I call them both directly without library.Question are: do we want this in mainstream? is there a better way?
The text was updated successfully, but these errors were encountered: