iptables – You can not make NAT work no matter what happens

I have two OpenVZ VPS, one with Debian and the other with CentOS, and I can not work as a gateway for me either.

I am networked with them using TincVPN, where they can be accessed through 10.0.0.1 and 10.0.0.2.

As proof, I'm trying to get a PING request to 8.8.8.8 to get through the VPS instead of my default gateway, doing the following:

route add 8.8.8.8 gw 10.0.0.1

And in the respective VPS, I do:

echo "1"> / proc / sys / net / ipv4 / ip_forward
iptables -A FORWARD -i tun0 -j ACCEPT
iptables -t nat -A POSTROUTING -s 10.0.0.0/24 -o eth0 -j MASQUERADE

Where tun0 is the virtual interface of TincVPN, and et0 is the interface where the default VPS gateway is (one uses et0 and the other venet0).

That supposedly is the minimum required for NAT to work, but it simply does not. All I get is From 8.8.8.8 icmp_seq = 1 Unknown destination network

Of course I did not stop there, I tried dozens of scripts that I found in OpenVPN forums, etc., but nothing I try works, no matter what I do.

I can not make it work between the VPS or between my PC and them, even though I have done it a million times before. This is driving me crazy.

I'm starting to think that the provider does something to OpenVZ that prevents the VPS from being used as a gateway, but is this possible?

I tried to use Forwarding = kernel in tinc.conf but this also proved ineffective.

Does anyone know what could be missing?