I want to connect two servers to eachother over the internet. For various reasons I cannot use IPSec for this.
I would like traffic to be transparently encrypted as if I was using IPSec transport mode. I have decided to use routing for this (but I'm open to better alternatives)
My tunnel is up on 10.255.255.0/30
, A uses .1
, B uses .2
. Let's say server A is at 192.168.0.100
and server B 172.16.0.200
.
While I could add a route to encrypt all traffic (using on A ip route add 172.16.0.200/32 dev tun0 via 10.255.255.2
), doing so kills the tunnel because OpenVPN traffic is using the same remote IP to keep the tunnel up.
I need a way to route the actual OpenVPN tunnel through eth0
but otherwise use tun0
to carry all traffic between server A and B. I have ip_forward enabled on both servers and appropriate firewall rules to allow the traffic, but I am not sure where to start in iptables to accomplish this.