Listen on TCP port p1 and current machine IP address and forward traffic to ip2 and port p2.
socat TCP-LISTEN:p1,fork TCP:ip2:p2
# ip2 and p2 can be local machine and p1 can be the new opened port on the same machine.
# fork allows to persist the connection
# socat binary can be copied and directly used on Linux systems: /usr/bin/socat