Double VPN using OpenVPN as client and server

Hello everyone! I am trying to configure a VPN chain consisting of two servers. What I have is two servers configured with https://github.com/angristan/openvpn-install script. What I want is to connect to server_1 via VPN which in its turn will be connected to server_2 via another tunnel. I have already got it working for simple client-server connection but whenever I try to configure OpenVPN on the second machine it just gets unavailable (lost connection) and I have to rollback to a previous working state, so I can’t retrieve any logs. What I do exactly is put my double_vpn.conf file created by server_2 install script into server_1’s /etc/openvpn folder and then execute systemctl start openvpn@double_vpn
and after that server_2 becomes unavailable

I do this all the time, what usually causes that is when you have set server 2 as gateway, so the traffic to server 1 is routed to server 2 causing it to drop connection. To solve this you have to remove the route-gw command and specify routing tables manually.

you probably need to setup some basic policy routing so that non VPN traffic on server2 does not get sent via the VPN tunnel

Hello! I’m glad I’m not the only one who experienced this problem. Could you please provide me a more detailed guide on how to do this?

Unfortunately not, I just headbanged my way out of this. The general idea is that you want an explicit routing rule for your server1 IP so that it doesn’t get affected by the connection to server2.