背景:遇到新型肺炎,公司要求延期返崗,一周在家辦公。
而女朋友家那邊,連接公司vpn遠程連接辦公電腦,不是很順暢,所以我就想架設一個vpn代理,來加速連接。
調研了一下,發現socat符合需求,實際使用效果也很不錯。
在此寫下部署過程。
yum安裝
yum install socat -y
安裝screen
yum install screen -y
代理l2tp的3個udp端口
udp500
udp1701
udp4500
執行一次screen
然后運行一條代理命令
bind 為本地ip
UDP4 為目標ip和端口
socat -d -d -lf /var/log/socat.log UDP4-LISTEN:1701,bind=111.111.111.111,reuseaddr,fork UDP4:106.38.xx.xx:1701
socat -d -d -lf /var/log/socat.log UDP4-LISTEN:4500,bind=111.111.111.111,reuseaddr,fork UDP4:106.38.xx.xx:4500
socat -d -d -lf /var/log/socat.log UDP4-LISTEN:500,bind=111.111.111.111,reuseaddr,fork UDP4:106.38.xx.xx:500
netstat -nua 查看端口監聽
ps:防火牆記得允許