1

I have a remote server which has a publically accessible IP Address. On this server’s ports elements are hosted to the web on various ports. So on another PC connected to the same network I can go to [server_ip]:[port] and see the application hosted on the server’s Processor A.

The challenge I’m facing is the server has a second processor (B), which is only accessible via Processor A. For example, connected to Server Processor A, I can SSH into Processor B. However there is no public connection to processor B. My goal is to host one of the applications on Proccessor B, but allow its ‘web interface’ to be accessible from the outside.

So I flow diagram of trying to load a web page hosted on Processor B would have to route through processor A.

PC making request for web page -> Server Processor A -> Server Processor B

I’ve been trying to accomplish this with ssh tunneling, but can’t seem to get that to work. The IP addresses of the two processors seem to be on their own interface, so I am guessing I would need to somehow allow Server Processor A to know that a request on a certain report needs to be forwarded to Processor B.

Is this possible?

5
  • 2
    I'm not sure I correctly unserstand your usage of the term "processor" here; could you clarify what you mean by that?
    – AdminBee
    Jan 14, 2020 at 16:11
  • Sorry @AdminBee , I did a poor job of explaining it. Basically I have 3 PCs. My PC, PC A, and PC B. My PC can only connect to PC A. PC A and PC B are somehow connected and have IP Addresses that they can talk from PC A to PC B and vise versa. My goal is to make it so from My PC I can access a website hosted on PC B, which would have to be done by routing through PC A
    – billybob2
    Jan 14, 2020 at 16:46
  • Hopefully that makes sense
    – billybob2
    Jan 14, 2020 at 16:46
  • You can always set up a reverse proxy on A with something like HAproxy or nginx. You could also mess with the routing tables on A and use iptables to port forward the traffic from B.
    – Pheric
    Jan 15, 2020 at 6:15
  • have to use all built in stuff unfortunately :(
    – billybob2
    Jan 15, 2020 at 14:34

2 Answers 2

0

This seems like a straight forward port forwarding example. What you mean by "Processor" notwithstanding, you can try:

hostB$ ssh -R8080:127.0.0.1:80 hostA

This makes some assumptions that I can adjust based on any clarifications you make. What we have so far is as follows:

  1. hostB$ start the command from host B's CLI (you can also start at A but it'd be a slightly different command)
  2. ssh use secure shell...
  3. -R8080:127.0.0.1:80 Forward on the Remote side of the tunnel, port 8080 and send it to 127.0.0.1 port 80 on the local side.
  4. hostA The dns name of hostA. You could also just use the IP address if you know it

Note that the client making the web page call will need to specify the correct port. You can do this with :port after the address, for example: http://192.168.0.99:8080

If for some reason you need all calls to be on port 80 and some served by A and others B then you will need some rewrite rules or proxying on A.

0

What you are describing can be accomplished with a reverse proxy, which you can setup with most HTTP servers such as Apache's HTTPD or NGINX. You can install and configure the reverse proxy on PC A.

https://httpd.apache.org/docs/2.4/howto/reverse_proxy.html

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.