如何强制 SOCKS 代理(Danted)打开 UDP 端口

Whe*_*z3y 6 debian socks

我几乎为这个问题浪费了 1 天的时间。

我有 2 台电脑;1. Windows 作为客户端,10.20.30.20 2. Debian(最新)作为服务器,10.20.30.10

我安装 Dante(SOCKS 代理)并配置/重新启动它。我可以从“1”使用这个 SOCKS 代理(10.20.30.10/1080TCP)。(火狐浏览器,无授权)

所以我将此代理添加到 uTorrent 的连接设置中。代理服务器:类型 = SOCKS5,代理 = 10.20.30.10,端口 = 1080,无身份验证

uTorrent 开始使用我的 SOCKS 代理,但无法连接到 DHT/UDP。uTorrent 建立这些连接(示例);

*65432 = uTorrent's Listening Port

TCP 10.20.30.20:(random)->10.20.30.10:1080 {Yeah, this is what I'm expected!}
UDP 10.20.30.20:65432->10.20.30.10:(random) {Huh?}
Run Code Online (Sandbox Code Playgroud)

由于 uTorrent 生成 UDP 数据包,而 Dante 未打开 UDP 端口,因此 UDP 数据包被服务器忽略(丢弃)。Dante 仅打开 1 个端口(TCP 1080),我不明白为什么 uTorrent 在中继 UDP 时不使用 TCP 协议。

我的问题是: 1. 当询问时,如何强制 Dante 动态打开 UDP 端口?2. 如果“SOCKS5 支持UDP”为真,为什么uTorrent 无法将UDP 发送到TCP 端口?


但丁设置

logoutput: syslog
internal: 10.20.30.10 port = 1080
external: tun0
method: username none
clientmethod: none
user.privileged: root
user.notprivileged: nobody
user.libwrap: nobody
connecttimeout: 50

client pass {
from: 10.20.30.20/32 port 1024-65535 to: 0.0.0.0/0
}
client block {
from: 0.0.0.0/0 to: 0.0.0.0/0
log: connect error
}

block {
from: 0.0.0.0/0 to: 127.0.0.0/8
log: connect error
}
pass {
from: 10.20.30.20/32 to: 0.0.0.0/0
protocol: tcp udp
#command: bind connect udpassociate
##^ I already tried Enable/Disable command, change from to 0.0.0.0/0, and so on, but no success!
}
block {
from: 0.0.0.0/0 to: 0.0.0.0/0
log: connect error
}
Run Code Online (Sandbox Code Playgroud)

小智 1

即使我使用了 UDP,我也遇到了同样的问题,UDP 无法工作protocol: tcp udp。使用后,将以下更改为下面的袜子传递命令对我有用。

client pass...
client block...

socks pass {
    from: 0.0.0.0/0 to: 0.0.0.0/0
    command: bind connect udpassociate
}
socks pass {
    from: 0.0.0.0/0 to: 0.0.0.0/0
    command: bindreply udpreply
}
Run Code Online (Sandbox Code Playgroud)