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

[BUG] Trojan-go Use IPv6 for DNS on a Server with IPv6 Disabled #524

Open
1 task done
Dr-Incognito opened this issue Jan 10, 2024 · 0 comments
Open
1 task done

Comments

@Dr-Incognito
Copy link

Dr-Incognito commented Jan 10, 2024

  • 我确定我已经尝试多次复现此次问题,并且将会提供涉及此问题的系统和网络环境,软件及其版本。

我们建议您按照下方模板填写 Bug Report,以便我们收集更多的有效信息

简单描述这个 Bug

The IPv6 has been disabled on the server.

➜  trojan-go sysctl net.ipv6.conf | grep disable_ipv6
net.ipv6.conf.all.disable_ipv6 = 1
net.ipv6.conf.default.disable_ipv6 = 1
net.ipv6.conf.docker0.disable_ipv6 = 1
net.ipv6.conf.eth0.disable_ipv6 = 1
net.ipv6.conf.lo.disable_ipv6 = 1

But Trojan-go continuously uses IPv6 for DNS queries.

[ERROR] 2024/01/10 08:42:10 github.com/p4gefau1t/trojan-go/proxy.(*Proxy).relayPacketLoop.func1.1:proxy.go:141 lookup time.apple.com on [::1]:53: dial udp [::1]:53: connect: cannot assign requested address

The Trojan-go REALLY LOVES IPv6 although it is listening to IPv4 port 8443.

➜  trojan-go netstat -nxtlp
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name    
tcp        0      0 0.0.0.0:5355            0.0.0.0:*               LISTEN      200/systemd-resolve 
tcp        0      0 0.0.0.0:80              0.0.0.0:*               LISTEN      295/nginx: master p 
tcp        0      0 127.0.0.53:53           0.0.0.0:*               LISTEN      200/systemd-resolve 
tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN      295/nginx: master p 
tcp        0      0 127.0.0.54:53           0.0.0.0:*               LISTEN      200/systemd-resolve 
tcp        0      0 a.b.c.d:8443            0.0.0.0:*               LISTEN      647/trojan-go       
tcp6       0      0 :::5355                 :::*                    LISTEN      200/systemd-resolve 

Both the server and client work (with the same config) well on another server containing IPv6.

如何复现这个 Bug

服务器和客户端环境信息

在此描述你的服务器和客户端所处的网络环境,系统架构,以及其他信息

服务端和客户端日志

[ERROR] 2024/01/10 08:42:09 github.com/p4gefau1t/trojan-go/proxy.(*Proxy).relayPacketLoop.func1.1:proxy.go:141 lookup time.apple.com on [::1]:53: dial udp [::1]:53: connect: cannot assign requested address
[ERROR] 2024/01/10 08:42:10 github.com/p4gefau1t/trojan-go/proxy.(*Proxy).relayPacketLoop.func1.1:proxy.go:141 lookup time.apple.com on [::1]:53: dial udp [::1]:53: connect: cannot assign requested address
[ERROR] 2024/01/10 08:42:10 github.com/p4gefau1t/trojan-go/proxy.(*Proxy).relayPacketLoop.func1.1:proxy.go:141 lookup time.apple.com on [::1]:53: dial udp [::1]:53: connect: cannot assign requested address

服务端和客户端配置文件

{
    "run_type": "server",
    "local_addr": "0.0.0.0",
    "local_port": 8443,
    "remote_addr": "127.0.0.1",
    "remote_port": 80,
    "password": [
    ],
    "log_level": 1,
    "log_file": "/var/log/trojan-go.log",
    "ssl": {
        "cert": "fullchain.pem",
        "key":  "privkey.pem",
        "sni": "example.com",
        "fallback_port": 443
    },
    "router": {
        "enabled": true,
        "block": [
            "geoip:private"
        ],
        "geoip": "/opt/trojan-go/geoip.dat",
        "geosite": "/opt/trojan-go/geosite.dat"
    }
}

服务端和客户端版本信息

Trojan-Go v0.10.6
Go Version: go1.17.1
OS/Arch: linux/amd64
Git Commit: 2dc60f52e79ff8b910e78e444f1e80678e936450

Developed by PageFault (p4gefau1t)
Licensed under GNU General Public License version 3
GitHub Repository:      https://github.com/p4gefau1t/trojan-go
Trojan-Go Documents:    https://p4gefau1t.github.io/trojan-go/

其他信息

N/A

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

No branches or pull requests

1 participant