Is there a way to automatically add a host route (pointing to the VM IP) when VM starts ? ATM I'm doing this by hand. I've also tried to add a route via /etc/sysconfig/network-scripts/route-virbr0 file, but it doesn't work, probably due to the fact that I don't have the appropriate ifcfg-virbr0 file.

Adding just a static route pointing to the VM doesn't work for obvious reason - there's no appropriate network interface (virbr0) when the host enters the multiuser mode, so route addition just fails.

1 Answer 1


If you're using libvirt, you can add static routes in the libvirt network XML.

For example:

  <route address="" prefix="24" gateway=""/>

  <route family="ipv6" address="2001:db8:ca2:3::" prefix="64" gateway="2001:db8:ca2:2::2"/>

Now libvirt will bring up the routes when it activates the virtual network.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .