I would like to connect a virtualbox computer to a local service on a remote computer. I can connect to local services, but the remote one, I have a problem because on the destination, the service runs in a local LAN.
Here is a graphic of the 3 computer and two interfaces on the 3rd computer. I want to connect to 10.0.0.8:200 since the service I want to connect to only runs on that local network on the remote computer.
+--------------------+
| |
| VirtualBox |
| 192.168.11.11:200 |
| |
+-----+--------------+
|
v
+--------------------+
| |
| Local Computer |
| 192.168.11.41:200 |
| |
+-----+--------------+
|
v
+--------------------+
| |
| Remote Computer |
| 8.8.8.8 | <- I can connect here
| |
| 10.0.0.8:200 | <- how do I connect here?
| |
+--------------------+
I'm able to open a tunnel between Local Computer and Remote Computer, but that does not give me a way to connect to the service on local network 10.0.0.8.
What I have so far is the SSH tunnel between the Local Computer and the Remote Computer. I can otherwise connect between the VirtualBox and Local Computer (I have a bridged network setup with works as expected.)
ssh -L 200:8.8.8.8:200 example.com
So what I'm missing is a connection between 8.8.8.8 and 10.0.0.8. How do I create a tunnel/proxy between the two which makes service on 10.0.0.8:200 available to my Local Computer?
ssh -L 200:10.0.0.8:200 8.8.8.8
on your local computer? That should create a tunnel from your local computer to the service via the remote computer. You should then be able to access that service from your VM via the host machine (local computer).ssh -L 200:10.0.0.8:200 example.com
. That means connections to localhost:200 will be forwarded to10.0.0.8:200
on the remote host, which is where your program listens for connection.localhost:200
oryour-local-ip:200
? If the latter, you may want to tryssh -L 0.0.0.0:200:10.0.0.8:200 example.com
.