I think my question is much easier to understand looking at the draw below. The idea is that for some reasons (such like accessing the intranet of my company, or getting access to some web pages that only my company has access to) I want to browse the Internet using the IP of my company, but from home. The problem is that to get access to my PC "inside" I have to go through a gate.
One solution could be of course to login into gate, and from there to my PC, with
ssh -X. Once inside I can open a Firefox window that will pop up in my PC at home. The problem of this approach is that it is very slow because I have to send the whole GUI through the network, instead of just the Internet packages.
A better idea to overcome this problem would be to use
ssh -D8080 ip.remote.company to create a tunnel, and then setup Firefox in my PC at home to use the remote computer as proxy, sending the internet packages (but not the GUI) through this secure channel, such as explained in many web pages.
The problem, of course, is that I have to go through the gate, which adds a level of complexity, so I have to setup (I think) two tunnels instead of just one, those drawn in red in the figure.
How can I setup a port forwarding (or something similar) to tunnel my connection to Internet through the network of my company, as illustrated in the figure, from outside? Of course I have access and accounts in the three computers.