Velvet Star Monitor

Standout celebrity highlights with iconic style.

general

bring the internet through an ssh tunnel using a tinyproxy

Writer Matthew Barrera

Hy everyone, I ask you for help in order to achieve the following (sorry for my English). I have ssh connection from a VM1 to another VM2 (using openBSD), I have internet connection in VM1 and I want to bring internet from VM1 to VM2 using a tinyproxy in order to install some stuff in VM2. I am really lost.

The idea is install tinyproxy (an edit the configuration) in VM1 but at that point ,how I use it through a ssh tunnel for provide internet to vm2

2

1 Answer

More information about your network setup would be needed to answer this fully, so I will be making a few assumptions here. You need to adjust the answer to your case.

First question is: you say you have a ssh connection from VM1 to VM2. Do you have only the ssh connection, or do you have regular, full network connection between VM1 and VM2? If you do have a full connection, you don't need to use a ssh tunnel for the proxy, it just overcomplicates things.

Assume for the moment you have a full connection and your VM1 IP address is 192.168.1.100 and your VM2 IP address is 192.168.1.200. You should configure a proxy on VM1 to listen for example on port 3128 (that's usually a common port number used for proxy, although you can use any unused port number), and configure VM2 to use proxy 192.168.1.100:3128. That's basically all.

If you have only the ssh connection (for example there is a firewall between the two VMs that passes only the ssh traffic), you need to forward ports over ssh connection. Assume you are still running proxy on VM1 on port 3128, and you are connecting via ssh from VM1 to VM2 (as you wrote in your question). In that case, you need to use the following command on VM1 to connect to VM2:

ssh -R 3128:localhost:3128 192.168.1.200

After you establish the connection, you can set VM2 to use proxy at localhost:3128.

You can also connect the other way, ie. from VM2 to VM1, using the command (on VM2):

ssh -L 3128:localhost:3128 192.168.1.100

Similarly, after the connection is established, set VM2 to use proxy at localhost:3128.

2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy