Running CentOS 6 I have noticed that Libvirt will automatically configure IPtables once a VM is using the built in NAT , or "default" network. How do I modify the IPtable rules without breaking libvirt's ability to configure these rules?
This is the firewall settings on a fresh install with no VMs using virbr0...
Table: filter
Chain INPUT (policy ACCEPT)
num target prot opt source destination
Chain FORWARD (policy ACCEPT)
num target prot opt source destination
Chain OUTPUT (policy ACCEPT)
num target prot opt source destination
Table: mangle
Chain PREROUTING (policy ACCEPT)
num target prot opt source destination
Chain INPUT (policy ACCEPT)
num target prot opt source destination
Chain FORWARD (policy ACCEPT)
num target prot opt source destination
Chain OUTPUT (policy ACCEPT)
num target prot opt source destination
Chain POSTROUTING (policy ACCEPT)
num target prot opt source destination
Table: nat
Chain PREROUTING (policy ACCEPT)
num target prot opt source destination
Chain POSTROUTING (policy ACCEPT)
num target prot opt source destination
Chain OUTPUT (policy ACCEPT)
num target prot opt source destination
Table: filter
Chain INPUT (policy ACCEPT)
num target prot opt source destination
Chain FORWARD (policy ACCEPT)
num target prot opt source destination
Chain OUTPUT (policy ACCEPT)
num target prot opt source destination
My concern is that if I begin to add custom rules that it will break this setup. If I run "service iptables save" after adding a rule, IPtables will then have saved this dynamic configuration. I assume it's dynamic because "/etc/sysconfig/iptables" does not reflect the second set of rules I pasted, but rather the first even when the second set is showing as active.