I only have basic experience with VPNs (mostly OpenVPN) and mostly theoric, but now I want to set up something more complex and I am evaluating the possible issues that I may face. I will try to represent the hypothetic situation via examples. Let's assume OpenVPN for this setup.
I have one main server that will run the OpenVPN client and different remote locations that will have different OpenVPN servers. I will open different tunnels at the same time from the main server to these remote locations. Let's say I will have ten different tunnels open at the same time.
Each of the tunnels will have a local IP assigned for the client, for example:
10.0.0.2/24 (tunnel A)
10.0.1.2/24 (tunnel B)
10.0.2.2/24 (tunnel C)
So, for instance, OpenVPN server in tunnel A would be
10.0.0.1/24. If I want to access some resource inside tunnel A's LAN - for instance, an Apache running on
172.16.0.50, I would just input the IP in my VPN client's computer and I would hit the web server (assuming all the routes are ok).
My main concerns lays in having different tunnels at the same time and multiple services running under the same local IP. Taking the above example:
Tunnel A: server 10.0.0.1/24, client 10.0.0.2/24, Apache 172.16.0.50
Tunnel B: server 10.0.1.1/24, client 10.0.1.2/24, Apache 172.16.0.50
In this particular example, we have two Apache instances running in different networks but sharing the same local IP, therefore when client inputs
172.16.0.50 while the two tunnels are active, I guess it will fail.
I am not sure if my guess is right but I bet this is not so atypical situation. Can someone explain what would need to be done in this situation?
EDIT: My apologies if I was not clear enough - let me simplify the issue breaking it down in simple steps:
- Two VPN servers (VPN1 & VPN2) and one VPN client
- VPN1 and VPN2 share the same LAN IPs for their internal services: 172.16.0.0/24
- Both VPN1 and VPN2 have an Apache running under 172.16.0.50
- VPN client connects to both VPN servers (VPN1 & VPN2)
- Issue -> Both have the same LAN numeration (172.16.0.0/24) and also Apache is running under the exact same IP
- Question -> Is there a way to sort this out besides changing the LAN (and therefore Apache's IP) in one of the VPN servers?