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 220.127.116.11 to get through the VPS instead of my default gateway, doing the following:
route add 18.104.22.168 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
tun0 is the virtual interface of TincVPN, and
et0 is the interface where the default VPS gateway is (one uses
et0 and the other
That supposedly is the minimum required for NAT to work, but it simply does not. All I get is
From 22.214.171.124 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?