ssh forward multiple ports in the same connection and command even works with NAT! -
ssh forward multiple ports in the same connection and command even works with NAT!
You can actually just pass multiple "-L" statements to achieve this.
An example is as below:
ssl -L 80:192.168.10.5:80 -L 443:192.168.10.5:443 -L 2068:192.168.10.5:2068 -L 8192:192.168.10.5:8192 firstname.lastname@example.org
The above essentially is saying forward ports 80,443,2068,8192 to the remote IP of 192.168.10.5 (even though it is behind NAT). Essentially SSH will do the NAT part even if there is no NAT translation/ masquerade on the target.
Remember the port number on the left is the local port number you will access by and the number on the right is the destination IP's port