By default the libvirt daemon will create some iptables rules for its NAT virtual network (if any). Those rules may not be exactly what you want, so the question is "how to disable libvirt nwfilter rules?".
One possible solution (by the book) is to create a bridged virtual network instead of the NAT one.
If that is too complicated for you then you can hack the init script of libvirtd daemon (/etc/init.d/libvirtd) like I did.
All you have to do is to change the start() function from this one:
start() { ebegin "Starting libvirtd" start-stop-daemon --start --env KRB5_KTNAME=/etc/libvirt/krb5.tab --exec /usr/sbin/libvirtd -- -d ${LIBVIRTD_OPTS} eend $? }
to the following one:
start() { ebegin "Starting libvirtd" start-stop-daemon --start --env KRB5_KTNAME=/etc/libvirt/krb5.tab --exec /usr/sbin/libvirtd -- -d ${LIBVIRTD_OPTS} ebegin " My hack: flushing libvirt iptables rules..." sleep 1 /sbin/iptables -F <your_chain or your_rules> eend $? eend $? }
By flushing the iptables chain/rules you just disabled libvirt nwfilter rules. Simple, right? Maybe it's not the most orthodox way of doing it but it always works.
Now, if you think that this article was interesting don't forget to rate it. It shows me that you care and thus I will continue write about these things.
Eugen Mihailescu
Latest posts by Eugen Mihailescu (see all)
- Dual monitor setup in Xfce - January 9, 2019
- Gentoo AMD Ryzen stabilizator - April 29, 2018
- Symfony Compile Error Failed opening required Proxies - January 22, 2018