Re: libvirt - VM’s not getting IP Addresses
Reply #5 –
Hi steve,
For me the default configuration that comes with the ntables package in /etc/nftables.conf didn't work, no matter what, regardless that I have loaded inet filter, ip libvirt_network, ip6 libvirt_network tables.
I'm not skilled enough to efficient troubleshoot this issue.
Anyway, I was lucky enough to find a workaround here https://forums.gentoo.org/viewtopic-p-8674890.html#8674890.
So, I slightly modified the default /etc/nftables.conf file according and magically works.
define qemu_bridge_if = "virbr0"
table ip nat {
chain postrouting {
type nat hook postrouting priority 100; policy accept;
# "masquerade" means the servers to which one connects from the VM can't tell packets are coming from the latter
ip saddr 192.168.122.0/24 masquerade
}
}
table inet filter {
# "input" is the name of the chain
chain input {
# -------------------------------- qemu
iifname $qemu_bridge_if accept comment "accept from virtual VM"
# packets that reach here are bound to be dropped
counter comment "count dropped packets"
}
chain forward {
type filter hook forward priority 0; policy drop;
# -------------------------------- qemu
iifname $qemu_bridge_if accept comment "accept VM interface as input"
oifname $qemu_bridge_if accept comment "accept VM interface as output"
counter comment "count dropped packets"
}
}