[libvirt-users] net.ipv4.conf.all.forwarding

Laine Stump laine at laine.org
Thu Oct 22 20:33:52 UTC 2015

On 10/21/2015 10:34 AM, lejeczek wrote:
> hi everybody
> I'd like to ask how libvirtd influences net.ipv4.conf.all.forwarding, 
> would you know?
> I've noticed that if I use host's bridge, therefor there is no 
> <forward mode= > in my network then "net.ipv4.conf.all.forwarding" 
> goes back to 0.
> Is this intended I wonder? Looks like libvirt decides it's user 
> responsibility now.

Anytime libvirt starts a network that has <forward mode='nat'/> or 
<forward mode='route'/>, it sets net.ipv4.ip_forward = 1 (I hadn't known 
it before, but I just experimented and found that 
net.ipv4.conf.all.forwarding is apparently a synonym for 
net.ipv4.ip_forward). libvirt never sets this tunable to 0 though.

What you're probably experiencing is that your system config has 
ip_forward left at the default of 0, and you've disabled all of 
libvirt's networks that have a forward mode=nat/route, so when the host 
system is booted, ip_forward stays at the value set in the system config 
(0) because libvirt has had no need to set it to (1).

If you want it to be set to 1, add a line in /etc/sysctl.conf (or 
wherever is the correct place for kernel tunables in your distro; 
/etc/sysctl.d/* for example)

> many thanks
> _______________________________________________
> libvirt-users mailing list
> libvirt-users at redhat.com
> https://www.redhat.com/mailman/listinfo/libvirt-users

More information about the libvirt-users mailing list