interconnect two openvpn servers

This forum is for admins who are looking to build or expand their OpenVPN setup.

Moderators: TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech, TinCanTech

Forum rules
Please use the [oconf] BB tag for openvpn Configurations. See viewtopic.php?f=30&t=21589 for an example.
Post Reply
j0su4
OpenVpn Newbie
Posts: 1
Joined: Wed Dec 07, 2022 5:17 pm

interconnect two openvpn servers

Post by j0su4 » Wed Dec 07, 2022 5:21 pm

Hi everyone, I've only been using openvpn for a short time and every day it surprises me more and I like it more.

I would like to make a configuration but I don't know if this would be possible. I explain:

I have a pc, let's call it PCA, with ubuntu 22.04 in which I have openvpn installed and working correctly without problems.
It has an ip 10.8.0.1 to which about 30 linux users are connected that work correctly.

Now I have a second pc, let's call it PCB, with ubuntu 22.04 openvpn installed and working correctly without problems
It has an ip 10.64.0.1 in which about 10 linux users are connected that work correctly.

The configuration that I am trying to do is that the PCB pc is a client of the PCA pc and at the same time is a server of the 10 original users.

When I connect PCB as a PCA client, the 10 users are disconnected but the PCB works as a client correctly.

Is this what I want to do possible?

User avatar
ordex
OpenVPN Inc.
Posts: 444
Joined: Wed Dec 28, 2016 2:32 am
Location: IRC #openvpn-devel @ libera.chat

Re: interconnect two openvpn servers

Post by ordex » Mon Dec 12, 2022 9:06 pm

It is possible, but you have to configure routing/policy routing properly on PCB to make sure that its clients are still able to connect.

I am guessing that what is happening is: all traffic is now going to PCA, therefore all replies to your clients are not going back over the main interface, but are being sent over the tunnel to PCA. This should be fixed with policy routing.

Post Reply