I do not want ip forwarding enabled for all my interfaces (I'm using Snort inline from this host and the IPS interfaces must not forward). I need ip forwarding enabled for for my KVM guests behind the default NAT interface.
I added the following to /etc/rc.local
# default I know, Just in case...
sysctl net.ipv4.ip_forward=0
# enable forwarding for KVM guests
echo 1 > /proc/sys/net/ipv4/conf/virbr0-nic/forwarding
echo 1 > /proc/sys/net/ipv4/conf/virbr0/forwarding
echo 1 > /proc/sys/net/ipv4/conf/eth0/forwarding
This seems to work. I'm just checking to see if there a better way to do this?
With out adding the last 3 lines in /etc/rc.local my KVM guests behind the default NAT interface can not get to the Internet.