I have a virbr0
interface, created by libvirt with
inet 10.1.2.1 netmask 255.255.255.0 broadcast 10.1.2.255
There's an active IPSec tunnel with
leftsubnet=10.1.2.0/24
rightsubnet=192.168.160.0/20
The VMs are able to reach 192.168.160.0/20 but now I would like the VMs to have all their traffic redirected to 192.168.168.254 instead of using the default gateway of the machine.
I thought I could use something like this:
iptables -t nat -A PREROUTING -i virbr0 -d 0.0.0.0/0 -j DNAT --to-destination 192.168.168.254
but that does not work. Am I missing something or am I using the wrong approach?
Thanks!