Contents

How use socat for Port Forwarding!

   Sep 27, 2022     1 min read

Hi I writing this document because I think this time all Iranians need help for Limitations of internet.

maybe you ask why?
because now many times internet changes to Intranet and it’s just Intranet maybe you ask what’s the meaning of intranet It’s better to say that national network is using rather than Intranet. I think now you understand what’s the meaning of intranet yeah it’s true it’s a house without any Connections to out

ok now let's go

how Port Forward Received to another destination use socat for UDP Protocol:

it’s very easy really😃 you just need

use this command:

sudo socat -ddd UDP4-RECVFROM:writePortRecivedData,fork UDP4-SENDTO:DestinationIP:Port

yeah it's very easy and now description :

you just need to replace writePortRecivedData with port that you want to accept data from it and just replace DestinationIP with address that you need to forward data to the port that is your destination port

like this:

sudo socat -ddd UDP4-RECVFROM:878,fork UDP4-SENDTO:127.0.0.1:404

and for TCP Protocol:

sudo socat -ddd tcp-listen:writePortRecivedData,reuseaddr,fork tcp:DestinationIP:Port

yeah it's very easy and now description :

you just need to replace writePortRecivedData with port that you want to accept data from it and just replace DestinationIP with address that you need to forward data to the port that is your destination port

thank you for reading this post I wish you to have a nice day have a great time.