Use "socat" for temporarily forwarding ports

Temporarily forward ports on Linux with the socat tool:

socat UDP4-LISTEN:12345,fork,reuseaddr,bind=127.0.0.1 UDP4:1.2.3.4:34567

This forwards UDP datagrams from 127.0.0.1 on port 12345 to a remote host 1.2.3.4, port 34567. Use "TCP" instead of "UDP" to forward TCP streams.

Notes: