With libvirt/qemu/kvm you can define a bridge (or more) to be used by the guest machines. The libvirt machinery should take care of the creation of the bridge - normally called virbr0 with virbr0-nic (to work around some quirks) - and will normally also take care to insert firewall rules - by way of iptables - to ensure connectivity (forwarding, accepting traffic between guests, sometimes denying outbound/inbound traffic on virbr0 altogether).
Now, I am currently in the process of migrating to nftables and I enjoy the added flexibility and the powerful syntax which for all my use cases surpasses my past experience with iptables/ip6tables and ipset in tandem. Alone the fact that I can express certain rules as pertaining to the inet family as a whole instead of IPv4 and IPv6 individually, makes it worthwhile.
Alas, libvirt officially only supports iptables or firewalld.
Now my question is this: is there a canonical way of dealing with this situation and what is it?
Here are a few scenarios I have contemplated (all without firewalld):
- use
nftablesbut use theupdate-alternativesmachinery to ensure libvirt will find aniptables(and so on) to call - move bridge creation away from libvirt and into
netplan, then use other means to dynamically insert the necessary rules - use
nftablesbut leaveiptablesactive -- from all I understand this is probably the worst idea, because they are bound to clash in some edge cases or in general