Socat端口转发

安装socat

# Centos
yum install socat
# Debian/Ubuntu
apt-get install socat

转发TCP

使用nohup命令后台侦听本机20001端口,并连接远程主机korea.yovter.xyz:443的TCP端口将日志输出到/root/socat.log

nohup socat TCP4-LISTEN:20001,reuseaddr,fork TCP4:korea.yovter.xyz:443 >> /root/socat.log 2>&1 &

转发UDP

使用nohup命令后台侦听本机20001端口,并连接远程主机korea.yovter.xyz:443的UDP端口将日志输出到/root/socat.log

nohup socat -T 600 UDP4-LISTEN:20001,reuseaddr,fork UDP4:korea.yovter.xyz:443 >> /root/socat.log 2>&1 &
Last modification:November 3rd, 2020 at 06:22 am
If you think my article is useful to you, please feel free to appreciate