利用SOCAT来做端口转发

yum install socat

socat TCP4-LISTEN:8080,reuseaddr,fork TCP4:192.168.11.5:80& or socat TCP4-LISTEN:8080,reuseaddr,fork TCP4:192.168.11.5:3389&

这样就把本地的8080与192.168.11.5:80做了映射.

查看端口情况

netstat -antup

如果要终止运行的话

ps -ef|grep socat kill -9 xxxID

更新https://www.laba.me/li-yong-socat-lai-zuo-duan-kou-zhuan-fa/

你可能感兴趣的:(利用SOCAT来做端口转发)