Need to have access to my office PC from my laptop hopping through two VPN servers

2

Here's the illustration of what I have:

enter image description here

  1. My office PC with it's IP of 123.45.e.f.
  2. Office VPN, which I will connect to from my VPS to get to my office PC.
  3. My own VPS, which I use as a:

    • client to connect to office VPN (through vpnc, which creates a tun0 with 123.45.c.d IP address);
    • VPN server my laptop can connect to (OpenVPN, tun1, 10.8.0.1)
  4. My own laptop I will use as a VPN client to connect to VPS OpenVPN server (will create a tun0 with 10.8.0.2 IP address)

Now what I have to do is to allow my laptop to connect to at least my office PC, but preferably to all the 123.45.x.x subnet. Please advice on how to best configure OpenVPN, routing, iptables or whatever else is needed on my VPS so that my laptop could gain access to my office PC.

P.S. The reason I'm hopping through my VPS is that being connected to the office WiFi I cannot access my office PC and I cannot connect to office VPN (which is another way to access my office PC). The only way to access my PC from office WiFi I have is hopping though an outside network.

Andrii Yurchuk

Posted 2012-08-29T07:44:06.430

Reputation: 179

This question is way to localized. – Ramhound – 2012-10-17T11:53:16.087

Answers

0

I just need to have access to my office PC from my laptop hopping through two VPN server.

Is this really what you need or do you need to connect to both the VPS and the Office LAN? You might not need "hopping".

The VPS is already connecting to the Office LAN as a OpenVPN client so maybe your laptop can be a another client.

Of course that would mean connecting to two VPN clients in your laptop... and so if you want to have access to the LAN office when you connect to the VPS OpenVPN server, what you need is proper routing. Basically the VPS OpenVPN server would need to pass the route to the other VPN.

I don't have you're server config, but based on that map, you'll need to add a:

push "route 123.45.c.d..... 

in the VPS server.conf.

This way you're laptop will "learn" the route to the office network (it's not really important if it is an OpenVPN network... it's just another network that the VPS is connected to).

If I wasn't clear enough feel free to ask any questions.

Mikec

Posted 2012-08-29T07:44:06.430

Reputation: 59