McEvoy, James
2013-Jun-14 19:26 UTC
[libvirt-users] Enabling route_localnet on private network
I have an issue setting a persistent kernel option on a libvirt net device since that device does not exist early enough during the boot of the KVM host. I am using the 127.0.0.0 local net for cluster communication between the KVM host and its guests as well as between KVM guests. In order to use addresses on the 127.0.0.0/8 network, which is reserved for local communication, two configuration changes must be made after the system is rebooted. First the default route of 127.0.0.1/0 to the loopback device must be deleted which I did by adding an "ip route delete" command to the ifcfg-br0 file that starts the bridged network that is used by the KVM guests. The second configuration change is where I am having trouble. For the second change I need to set the kernel boolean net.ipv4.conf.pvt0.route_localnet to be true to allow routing of the 127.0.0.0/8 on the libvirt net device that I have configured to use addresses on the 127.0.0.0/8 network. Normally I would do this by adding "net.ipv4.conf.pvt0.route_localnet = 1" to /etc/sysctl.conf but this does not work because the libvirt pvt0 device does not exist when the settings in the /etc/sysctl.conf are done. My question is where can I add the command "/sbin/sysctl -w net.ipv4.conf.pvt0.route_localnet=1" to the start-up files so the command is run after the libvirt device pvt0 has been autostarted? I am running on RHEL 6.4 x86_64. --jim
Gao Yongwei
2013-Jun-15 03:36 UTC
Re: [libvirt-users] Enabling route_localnet on private network
My question is where can I add the command "/sbin/sysctl -w> net.ipv4.conf.pvt0.route_localnet=1" to the start-up files so the command > is run after the libvirt device pvt0 has been autostarted? >Does libvirt hooks can do this ?http://libvirt.org/hooks.html
McEvoy, James
2013-Jun-15 17:17 UTC
Re: [libvirt-users] Enabling route_localnet on private network
Gao, It looks like these hooks will do exactly what I need. Thanks for the pointer... --jim ________________________________ From: Gao Yongwei [itxx00@gmail.com] Sent: Friday, June 14, 2013 8:36 PM To: McEvoy, James Cc: libvirt-users@redhat.com Subject: Re: [libvirt-users] Enabling route_localnet on private network My question is where can I add the command "/sbin/sysctl -w net.ipv4.conf.pvt0.route_localnet=1" to the start-up files so the command is run after the libvirt device pvt0 has been autostarted? Does libvirt hooks can do this ?http://libvirt.org/hooks.html