0

After a couple of days research I've completely rewritten my question to make it easier to answer, and hopefully clearer of what I'm looking for.

I have an Ubuntu 18.04 VPS server with a dedicated IPv4 address (we'll call it xxx.xxx.152.21) on eth0, calling the server VPS1. I have installed Tinc VPN with the address 10.8.2.1 for the VPS on interface tun1, and on the same Tinc VPN network I have a small server with the address 10.8.2.10 that I'm calling SSR1.

If I place an application server on SSR1, say listening to port 8044, what is the best way of 'linking' xxx.xxx.152.21:8044 to 10.8.2.10:8044?

SSR1 is behind a router that does not allow port forwarding which is why I've set Tinc VPN up. I've looked through tools such as netcat and ip route but not sure what is best to use or if they will function for what I'm trying to do.

UPDATE

It turns out that something was wrong with my Nginx install and a full reinstallation put the proxy_pass correct. Indeed Nginx will forward HTTP packets on to any of the network interfaces. I'm still working on a way to pass other protocol packets on different ports on to the internal network and not sure if this should be done using IPTables or netcat. My only concern about netcat is I'm not sure to what extent it means by having to start a new process with each connection/request as mentioned in the documentation.

Mozzie
  • 1
  • 1
  • A proxy should certainly work just fine. You probably should include details about how you tried to set that up. NAT on the VPS should work too, but it would probably require both SNAT and DNAT rules for the routing to work. Using netcat, is more or less just another way of making a proxy. – Zoredache Jun 19 '18 at 00:08
  • @Zoredache I presume you mean with the proxy_pass in the Nginx configuration with Nginx on the VPS? I've currently got Nginx on the VPS listening on port 80 of it's public IP address, but the proxy_pass isn't sending packets on to the tun1 10.8.2.10 address. Both tun1 and eth0 appear in `ifconfig` with their respective IP addresses. Is there somewhere in Nginx that I have to make it aware of tun1 or should it be able to communicate with IP address automatically? proxy_pass is set to 10.8.2.10:8044 – Mozzie Jun 19 '18 at 12:24
  • @Mozzie Then use `tshark` or `tcpdump` to troubleshoot nginx traffic. – kubanczyk Jun 20 '18 at 04:57

0 Answers0