NOTE: I'm not explaining why I want to do this. But here is the requirement.
There are 4 hosts. Host A, Host B, Host C, Host D
- Host A is running some application which can be accessed at port 8001
- I forwarded port 8001 of Host A to 8002 of Host B.
- Host B is accessible only using Host C.
So, again, I forwarded port 8002 of Host B to 8003 of Host C.
Now, from Host D...when I say:
https://HostC:8003 -- it should take me to the application running on Host A. But I'm not able to do that.
But what I could do was, I forwarded port 22 of Host A to port 7777 of Host B. Then, from Host C, I ran:
$ ssh Host B -p 7777 -L 6666:localhost:8001
ssh Host B -p 7777, took me to a command line on Host A. Hence port 8001 of Host A was directly forwarded to 6666 of Host C.
Now, from Host D,
https://Host C:8001 worked! But, I want to do it using the former way.
- How can I do that?
- What am I missing here?