0

I've installed OpenVPN on my VPS. I have one question: how to forward traffic going to that VPS to go to VPN tunnel created with my local PC. I will use TCP connection. The whole traffic will be like Internet -> VPS -> VPN tunnel -> my PC. I think it will use iptables for forwarding, but I dont know if it will work and how it will work. The PC have private IP and I dont see any other sollutions. Its kinda like reverse VPN.

The OpenVPN is fully instaled and its working.

I appreciate all tips :)

  • 1
    Use the peer IP address used by your VPS to access the VPS from your PC; that's the simple answer. Otherwise you have to supply more info; edit your question and add the output from the following commands, *after* the VPN is established: `ip addr show`; `ip route show` – wurtel Mar 25 '15 at 13:02

1 Answers1

0

You have at least three possible solutions.

  1. Setting up policy based routing on your private PC. (hard to setup, more permanent, pretty) http://lartc.org/howto/lartc.rpdb.multiple-links.html
  2. Set up ssh port forwarding. (easy, junky solution) https://help.ubuntu.com/community/SSH/OpenSSH/PortForwarding
  3. Set up destination NAT (PAT) and source NAT @ VPS. (easier than (1), ugly) https://thewiringcloset.wordpress.com/2013/03/27/linux-iptable-snat-dnat/
Michal Sokolowski
  • 1,471
  • 1
  • 11
  • 24