How it works...
When you use the -L flag with SSH, you're specifying that any connection attempts made to the local machine, on the first port listed, are to be forwarded to the remote host and port.
Let's break down the command:
[vagrant@centos1 ~]$ ssh -f -L 9999:127.0.0.1:8888 192.168.33.11 sleep 120
First, the -f and sleep 120 at the end of the command are a quick way to create a session and background it while we perform our test:
-f ... sleep 120
The second part is the interesting bit:
-L 9999:127.0.0.1:8888
Here, we're saying that local port 9999 should have any connection requests forwarded to the remote host on 127.0.0.1:8888.
Because of the way we created our web server, the following is also valid syntax:
-L 9999:192.168.33.11:8888
This is because our remote web server was listening on all addresses, so instead of sending our request to the remote localhost address, we're just using the eth1 address instead.