forward ports from local or remote machine

E.g: Let's suppose telnet is enabled at port 25 in remote machine.$ ssh -L 2025:localhost:25 # That forwards local port 2025 to 25 in the remote machine.
Then in local computer we can exec:$ telnet -l user localhost:2025 # and we would log in into the remote machine.