Jump to content
Search In
  • More options...
Find results that contain...
Find results in...
MrSuperb

Share VPN Connection with SSH?

Recommended Posts

Posted · Original PosterOP

Local server IP: 192.168.0.10

Local server IP in VPN: 128.0.0.10

Remote server IP in VPN: 128.0.0.20

 

I have a local Server that connects via VPN (L2TP/IPSec) to a remote server.

e.g. I can access 128.0.0.20:1234 from the local server.

I also have a client with the IP 192.168.0.30

Now I would like to be able to forward requests/ports from the local client like

192.168.0.10:2345 (local server) to 128.0.0.20:2345 (remote server) and back again.

 

Is this possible? if so, what is the easy way to achieve this?

ssh tunnel on the local server?

 

Thanks


Mini-Desktop: NCASE M1 Build Log
Mini-Server: M350 Build Log

Link to post
Share on other sites

Are you truly using ports 1234 and 2345 or is that just for example. If you have configured your VPN correctly you should be able to access 128.0.0.10 and 128.0.0.20 on both sides of VPN.

 

 

 

SSH uses port 22. 

 

Also for future reference if these servers are not externally facing your internal IPs should be in the 192.168.0.0 /16, 10.0.0.0 /8, or 172.16.0.0/12 ranges. 

 


CPU: Intel i7 6700k Cooler: Fractal Design Celsius S36 GPU: Asus GTX 970 Strix RAM: Corsair Vengeance LPX DDR4 2x8GB 2400  Mobo: Asus Z170 Pro Gaming Case: Fractal Design Define S PSU:  EVGA Supernova 750 W G2 SSD: Samsung 850 Evo 256 GB

Link to post
Share on other sites
Posted · Original PosterOP
5 minutes ago, Jack DeGregorio said:

Are you truly using ports 1234 and 2345 or is that just for example. If you have configured your VPN correctly you should be able to access 128.0.0.10 and 128.0.0.20 on both sides of VPN.

 

 

 

SSH uses port 22. 

 

Also for future reference if these servers are not externally facing your internal IPs should be in the 192.168.0.0 /16, 10.0.0.0 /8, or 172.16.0.0/12 ranges. 

 

those ports are just examples ;)

 

The Remote Server hosts a website on Port 52000 (i.e. locally reachable by localhost:52000) and an IP like 128.xxx.xxx.2

The Local Server can connect to the Remote Network via VPN and gets an IP like 128.xxx.xxx.1

Now I can access the (remote) website from the local server via 128.xxx.xxx.2:52000

The Local Server (in the local adress space) has also an IP like 192.168.xxx.10

 

Now let's add a third Computer and call him 'client' with a local IP like 192.168.xxx.20

This client doesn't have (direct) access to the VPN.

 

I want to know how I can share the VPN connection of the local server with this local client.

i.e. I want to be able to call 128.xxx.xxx.xx2:52000 from the client as well as from the server.

 

local server (128.xxx.xxx.1 / 192.168.xxx.10) <== (VPN L2TP/IPSec) ==> remote Server (128.xxx.xxx.2)

Local Client uses VPN connection from local server to connect to remote server ...

local client (192.168.xxx.20) => local server (192.168.xxx.10 / 128.xxx.xxx.1) => remote server (128.xxx.xxx.2)


Mini-Desktop: NCASE M1 Build Log
Mini-Server: M350 Build Log

Link to post
Share on other sites

So what it sounds like to me is that you need a rule to allow your client to get to the remote server via SSH port 22. In the VPN solutions I have used Forti-Gates I build a rule on both sides of firewall allowing 192.168.xxx.xxx /16 access to 128.xxx.xxx.xxxx /32 via SSH port 22. Or just move your client to that same setup in the 128 space. 

 

Again is this website externally facing and you are just trying to get access to it via SSH. 

 

 


CPU: Intel i7 6700k Cooler: Fractal Design Celsius S36 GPU: Asus GTX 970 Strix RAM: Corsair Vengeance LPX DDR4 2x8GB 2400  Mobo: Asus Z170 Pro Gaming Case: Fractal Design Define S PSU:  EVGA Supernova 750 W G2 SSD: Samsung 850 Evo 256 GB

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now


×