SSH port forwarding visualized

Image by Joey Kyber

Local Port Forwarding

A visual representation of Local Port Forwarding
ssh -L <local-machine ip>: <local port>:<mysql server ip>:3306 user@pub001.host

Remote Port Forwarding / Reverse SSH

A visual representation of Remote Port Forwarding
ssh -R <friend-ip>:<friend port>:<local-ip>:<local port> user@common_server
<common-server ip>:<friend-port> 

Dynamic Port Forwarding

A visual representation of Dynamic Port Forwarding
ssh -D <local-ip>:1080 user@10.204.220.3
ssh -D 7777