go-gost / gost

GO Simple Tunnel - a simple tunnel written in golang
https://gost.run
MIT License
4.11k stars 504 forks source link

KCP协议BUG #345

Open clywm520 opened 10 months ago

clywm520 commented 10 months ago

linux A为 KCP服务端,有公网IP linux B为 KCP客户端,无公网IP,但可以访问外网 linux C为全内网,但可以访问B。

linuxA 启动命令: KCP服务端 nohup gost -L "tun://:8421?net=192.168.8.1/24&gw=192.168.8.3&route=192.168.1.0/24" -L "relay+kcp://123:123@: 8443?kcp.keepalive=10&kcp.mode=fast3" >/dev/null 2>&1 &

linuxB 启动命令: KCP客户端 nohup gost -L "tun://:0/:8421?net=192.168.8.3/24&gw=192.168.8.1&route=10.0.12.0/24&keepalive=true&ttl=10s" - F "relay+kcp://123:123@A公网IP:8443?kcp.keepalive=10&kcp.mode=fast3" >/dev/null 2>&1 &

GOST UDP代理: gost -L rudp://:18443/A服务器IP:8443?keeplive=true

linuxC 启动命令:

nohup gost -L "tun://:0/:8421?net=192.168.8.3/24&gw=192.168.8.1&route=10.0.12.0/24&keepalive=true&ttl=10s" - F "relay+kcp://123:123@LINUXB内网IP:18443?kcp.keepalive=10&kcp.mode=fast3" >/dev/null 2>&1 &

当LINUX C出现以下日志:

{"dst":":8421/udp","handler":"tun","kind":"handler","level":"error","listener":"tun","local":":0","msg":"io: read/write on closed pipe","remote":"192.168.8.5","service":"service-0","time":"2023-11-23T16:19:00.411+08:00"}

然后就再也链接不上了。 内网IP就不能互通了

linux A为 KCP服务端,有公网IP linux B为 KCP客户端,无公网IP,但可以访问外网 linux C为全内网,但可以访问B。

linuxA 启动命令: KCP服务端 nohup gost -L "tun://:8421?net=192.168.8.1/24&gw=192.168.8.3&route=192.168.1.0/24" -L "relay+kcp://123:123@: 8443?kcp.keepalive=10&kcp.mode=fast3" >/dev/null 2>&1 &

linuxB 启动命令: KCP客户端 nohup gost -L "tun://:0/:8421?net=192.168.8.3/24&gw=192.168.8.1&route=10.0.12.0/24&keepalive=true&ttl=10s" - F "relay+kcp://123:123@A公网IP:8443?kcp.keepalive=10&kcp.mode=fast3" >/dev/null 2>&1 &

GOST UDP代理: gost -L rudp://:18443/A服务器IP:8443?keeplive=true

linuxC 启动命令:

nohup gost -L "tun://:0/:8421?net=192.168.8.3/24&gw=192.168.8.1&route=10.0.12.0/24&keepalive=true&ttl=10s" - F "relay+kcp://123:123@LINUXB内网IP:18443?kcp.keepalive=10&kcp.mode=fast3" >/dev/null 2>&1 &

当LINUX C出现以下日志:

{"dst":":8421/udp","handler":"tun","kind":"handler","level":"error","listener":"tun","local":":0","msg":"io: read/write on closed pipe","remote":"192.168.8.5","service":"service-0","time":"2023-11-23T16:19:00.411+08:00"}

然后就再也链接不上了。 内网IP就不能互通了

clywm520 commented 10 months ago

用socat代理转发是OK的,估计是gost 转发UDP端口的BUG