JConsole over ssh local port forwarding with different port number
I would like to connect to my remote jmx by using jconsole. However, the jmx port 9010 is blocked by the firewall. By following this answer, I was able to make it work successfully by applying the local port forwarding as below (9010 -> 9010) :
ssh -L 9010:localhost:9010 192.168.0.100
However if I change local port which is different to remote port, as below (9010 -> 9011) :
ssh -L 9011:localhost:9010 192.168.0.100
Then the jconsole will failed to connect. Even I try different ports, jconsole still not able to connect to the jmx service.
The reason I want to do this is because I am required to monitor multiple JBOSS-EAP server, but both of jmx ports are 9010, which is not possible to do forward from two server port to a single local port, if the first jmx using 9010 local port, then the second one need to connect to local port other than 9010. My scenario is describe as the picture below :
Is there any solution how to make it works? Sorry for my bad English.