[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: [libvirt-users] routed mode

On 05/17/2014 11:06 PM, JvR O wrote:
net.ipv4.ip_forward = 1

centos 65 host has static private ip
I have added a route

ip route add via

but each time I use 'service network restart' the new route disappears

In general adding a route with the "ip" commandline utility will only make that change temporarily.

At any rate, it's not the virtualization host that needs a route added (there will already be a direct route for that added when the bridge is created), but *all the other machines on your network* (or at least the default router) that will need a route added. (Or possibly I've misunderstood the mistake you made, and you actually tried to enter the above route on some other machine on the network, not the virtualization host itself. In that case, the reason it didn't work when you first added the route is because you have the wrong destination)

For example, if your virtualization host has a physical ethernet adapter at, and you've created a libvirt network with forward mode='route' and an ip address of, all other hosts on the physical network will need to know how to get to machines on the network; this is done by adding a route equivalent to this on (at least) the default router for the network:


Likewise, on any other subnet that isn't on the far side of a NAT gateway, you will need to add a route with destination with the gateway being the local-subnet IP address of some router that is also connected to the network.

Beyond this short explanation, this really is a straight networking question, not virtualization-related, so you could be better serviced by looking up some IP routing FAQs.

anyway I have made a ping before restarting the network and is still not working

Because the machines out on the physical network do not have access to the routing table on your virtualization host, and have no idea where is anyway. The rule for a useful route is that the destination should be some subnet that none of the local machine's interfaces are directly connected to, and the gateway must be an address that *is* on a subnet directly connected to one of the machine's interfaces.

Thank you.

2014-05-15 12:23 GMT+02:00 Sven Schwedas <sven schwedas tao at>:
On 2014-05-15 12:10, JvR O wrote:
> Why is not working?

• sysctl → ip_forward?

• Target hosts have a correct route to your new subnet?

Mit freundlichen Grüßen, / Best Regards,
Sven Schwedas
TAO Beratungs- und Management GmbH | Lendplatz 45 | A - 8020 Graz
Mail/XMPP: sven schwedas tao at | +43 (0)680 301 7167

libvirt-users mailing list
libvirt-users redhat com

libvirt-users mailing list
libvirt-users redhat com

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]