How to prevent iptables and nftables rules from running simultaneously?
I'm not sure this is the best way, but to stop iptables from reloading after boot what I did was
rm /etc/sysconfig/iptables-config
rm /etc/sysconfig/ip6tables-config
systemctl disable firewalld
As for your questions at the bottom I haven't personally used nftables but to see if they are in effect at the same time you could set one to, for example drop everything and have the other wide open. Repeat on both sides and if a ping doesn't work either way that would mean they are both active.
The second question I believe is answered from the commands posted. The third question, is kind of opinion based. Do which ever you find is easier to learn and work with.
For the question per se, these are the last two questions from the original post:
- How can I reliably use nft without iptables rules interference?
- Or should I simply use iptables and remove nft?
this is what the nftables wiki says:
What happens when you mix Iptables and Nftables?
How do they interact?
nft Empty Accept Accept Block Blank
iptables Empty Empty Block Accept Accept
Results Pass Pass Unreachable Unreachable Pass
So one should not worry that some traffic will be allowed because it was allowed in one tool, while forbidden in the other.
As for those iptables rules, as I asked, "after a system reboot iptables chains have some rules, which I didn't set (and I have no idea where they come from)", they turned out to come from the libvirtd.service
, which I disabled, since I don't need it. But it wouldn't have hurt even if I had not.