Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IPv6 UDP 连通性问题 #102

Closed
7ith1um opened this issue May 27, 2023 · 8 comments · Fixed by #393
Closed

IPv6 UDP 连通性问题 #102

7ith1um opened this issue May 27, 2023 · 8 comments · Fixed by #393
Assignees

Comments

@7ith1um
Copy link

7ith1um commented May 27, 2023

What happened:

带有 IPv6 目标地址的 UDP 数据包无法被代理

What you expected to happen:

带有 IPv6 目标地址的 UDP 数据包正常代理

How to reproduce it (as minimally and precisely as possible):

% dig +short www.google.com @2400:3200:: // 证实本地 IPv6 环境正常
107.181.166.244
% dig +short +tcp www.google.com @2606:4700:4700::1111 // 证实服务端 IPv6 环境正常
172.217.25.164
% dig +short www.google.com @2606:4700:4700::1111 // 代理 v6udp 超时
;; communications error to 2606:4700:4700::1111#53: timed out
^C

Anything else we need to know

未在日志中观察到任何关于 [2606:4700:4700::1111]:53 的条目

Environment:

  • Dae version (use dae --version): dae version 0.1.9patch1
  • OS (e.g cat /etc/os-release):
  • Kernel (e.g. uname -a):
  • Others:
@mzz2017
Copy link
Contributor

mzz2017 commented May 27, 2023

@7ith1um 日志里没有,有两种可能,1是代理没有ipv6地址不支持ipv6,2是走了直连。找一下有没有什么notify什么kernel

@mzz2017
Copy link
Contributor

mzz2017 commented May 27, 2023

我看到了你提供的说明中,ipv6 tcp 是正常的,ipv6 udp 不正常工作有多种可能,不一定是 dae 的问题,比方说服务端不支持 ipv6 的 udp,还需要进一步排查说明

@7ith1um
Copy link
Author

7ith1um commented May 27, 2023

如下操作

% dig +short www.google.com @2400:3200::              
31.13.95.17
% dig +short +tcp www.google.com @2606:4700:4700::1111
142.250.206.228
% dig +short +tcp www.google.com @1.1.1.1             
142.250.206.228
% dig +short www.google.com @1.1.1.1 
142.250.206.228
% dig +short www.google.com @2606:4700:4700::1111 
;; communications error to 2606:4700:4700::1111#53: timed out
^C
% dae suspend // 关闭 dae
% dig +short www.google.com @2606:4700:4700::1111 // 可以收到响应
202.160.128.210

对应如下日志 (日志等级为 debug)

5月 27 20:15:42 systemd[1]: Started dae Service.
5月 27 20:16:01 dae[11855]: level=info msg="localhost:34981 <-> [2606:4700:4700::1111]:53" dialer=next ip="[2606:4700:4700::1111]:53" mac="00:d8:61:a3:b2:b7" network=tcp6 outbound=proxy pid=11901 pname=dig policy=fixed sniffed=
5月 27 20:16:09 dae[11855]: level=info msg="localhost:39175 <-> 1.1.1.1:53" dialer=next ip="1.1.1.1:53" mac="00:d8:61:a3:b2:b7" network=tcp4 outbound=proxy pid=11908 pname=dig policy=fixed sniffed=
5月 27 20:16:13 dae[11855]: level=info msg="localhost:45417 <-> 1.1.1.1:53" dialer=next domain= ip="1.1.1.1:53" mac="00:d8:61:a3:b2:b7" network=udp4 outbound=proxy pid=11913 pname=dig policy=fixed

关闭 dae 后,可以正常收到响应,这说明应该不是走了直连。
而我让 dae 使用 socks5 连接上游代理服务器并抓包,观察不到任何目标地址为 IPv6 的 UDP Associate 请求。
这些现象应该可以说明是 dae “吃了” udp 数据包。

@mzz2017
Copy link
Contributor

mzz2017 commented May 27, 2023

@7ith1um dae 的确吃了 udp 数据包,因为在连接观测中你的节点的 ipv6 的 udp 不通,你可以尝试把 group filter 只选择该节点,policy 使用 fixed(0),此时将不会有联通性测试,你应该会看到日志,但仍然不通

@7ith1um
Copy link
Author

7ith1um commented May 27, 2023

这是我在此 issue 中,使用的 dae 配置

global {
    log_level: info

    wan_interface: enp39s0
    tproxy_port: 3346
}

node {
    next: 'socks5://[::1]:1080'
}

group {
    proxy {
        filter: name(next)
        policy: fixed(0)
    }
}

也就是说 #102 (comment) 就是在

group filter 只选择该节点,policy 使用 fixed(0)

的设置下测试的

@mzz2017
Copy link
Contributor

mzz2017 commented May 27, 2023

@7ith1um 好的,我将进一步排查,谢谢

@mzz2017
Copy link
Contributor

mzz2017 commented May 27, 2023

@7ith1um 已复现问题,影响范围:

  1. 所有版本
  2. 仅影响 wan 接口
  3. 仅影响 ipv6 的 udp

目前定位是 ebpf 方面的问题,稍后会进行进一步排查和修复

@7ith1um
Copy link
Author

7ith1um commented May 27, 2023

了解了,感谢您的积极回复。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants