daeuniverse / dae

eBPF-based Linux high-performance transparent proxy solution.
GNU Affero General Public License v3.0
3.27k stars 202 forks source link

[Support Request] 关于 Trojan 作为 Node 的配置 #363

Closed martinzu closed 11 months ago

martinzu commented 11 months ago

Checks

Support Request

config.dae 完整配置如下:

全局配置

global {

绑定lan网口提供给内网设备,填自己服务器的网口,多个逗号隔开

lan_interface: eth0
wan_interface: auto
log_level: info
auto_config_kernel_parameter: true
dial_mode: domain
allow_insecure: false
so_mark_from_dae: 1234

# tls配置
tls_implementation: utls
utls_imitate: chrome_auto

}

订阅配置

subscription { }

节点配置

node {

节点URI

HK: 'trojan://password@server.address:443?security=tls&type=tcp#server.address'

}

分组配置,以下采用固定策略,使用第一个节点

group { elden_proxy { policy: fixed(0) } }

dns配置

dns { upstream { googledns: 'tcp://dns.google.com:53' alidns: 'udp://dns.alidns.com:53' } routing { request { qname(geosite:cn) -> alidns fallback: googledns } response { upstream(googledns) -> accept fallback: accept } } }

路由配置

routing { pname(NetworkManager) -> direct dip(224.0.0.0/3, 'ff00::/8') -> direct dip(geoip:private) -> direct

### 以下是自定义规则

## 规则
ip(geoip:cn) -> direct
domain(geosite:cn) -> direct
domain(geosite:category-ads) -> block

# 默认出站分组
fallback: elden_proxy

}

journalctl -xfu dae.service 日志: Dec 01 07:13:18 ubuntu dae[1811]: level=info msg="Routing match set len: 9/64" Dec 01 07:13:18 ubuntu systemd[1]: Started dae Service. ░░ Subject: A start job for unit dae.service has finished successfully ░░ Defined-By: systemd ░░ Support: http://www.ubuntu.com/support ░░ ░░ A start job for unit dae.service has finished successfully. ░░ ░░ The job identifier is 1103. Dec 01 07:13:37 ubuntu dae[1811]: level=warning msg="handlePkt: failed to dial proxy to tcp: context deadline exceeded" Dec 01 07:13:37 ubuntu dae[1811]: level=warning msg="handlePkt: failed to dial proxy to tcp: context deadline exceeded" Dec 01 07:13:37 ubuntu dae[1811]: level=warning msg="handlePkt: failed to dial proxy to tcp: context deadline exceeded" Dec 01 07:13:37 ubuntu dae[1811]: level=warning msg="handlePkt: failed to dial proxy to tcp: context deadline exceeded" Dec 01 07:13:47 ubuntu dae[1811]: level=warning msg="handlePkt: failed to dial proxy to tcp: context deadline exceeded" Dec 01 07:13:47 ubuntu dae[1811]: level=warning msg="handlePkt: failed to dial proxy to tcp: context deadline exceeded"

请问节点配置中,trojan 这样配置对吗?

节点配置

node {

节点URI

HK: 'trojan://password@server.address:443?security=tls&type=tcp#server.address'

}

此配置来自于 nekobox 客户端。如果并不正确,该如何配置?官方文档 https://github.com/daeuniverse/dae/blob/main/docs/en/proxy-protocols.md 中并没有说明。还请作者赐教。谢谢

Current Behavior

No response

Expected Behavior

No response

Steps to Reproduce

No response

Environment

Anything else?

No response

dae-prow[bot] commented 11 months ago

Thanks for opening this issue!

martinzu commented 11 months ago

已关注项目并加星~

mzz2017 commented 11 months ago

@martinzu 试试把allow_insecure设置true

martinzu commented 11 months ago

感谢回复。已修改配置,并重启服务,还是未能成功出局~

日志和之前一致,如下: journalctl -xfu dae.service Dec 02 06:39:24 ubuntu dae[10842]: level=warning msg="handlePkt: failed to dial proxy to tcp: context deadline exceeded" Dec 02 06:39:24 ubuntu dae[10842]: level=warning msg="handlePkt: failed to dial proxy to tcp: context deadline exceeded"

mzz2017 commented 11 months ago

@martinzu loglevel开debug,看一下connectivity test 的日志

mzz2017 commented 11 months ago

@martinzu 不过这个日志感觉要么是节点确实连不上,要么是内核有问题

martinzu commented 11 months ago

开了 debug 的日志: journalctl -xfu dae.service Dec 02 07:09:20 ubuntu dae[11242]: level=debug msg=" domain(suffix) -> block" Dec 02 07:09:20 ubuntu dae[11242]: level=info msg="Routing match set len: 9/64" Dec 02 07:09:20 ubuntu dae[11242]: level=debug msg="Read geosite "geosite.dat:cn" from /usr/local/share/dae/geosite.dat" Dec 02 07:09:20 ubuntu dae[11242]: level=debug msg="[rule] qname([n = 4478]) -> alidns" Dec 02 07:09:20 ubuntu dae[11242]: level=debug msg=" qname(full) -> " Dec 02 07:09:20 ubuntu dae[11242]: level=debug msg=" qname(regex) -> " Dec 02 07:09:20 ubuntu dae[11242]: level=debug msg=" qname(suffix) -> alidns" Dec 02 07:09:20 ubuntu dae[11242]: level=debug msg="[rule] upstream([n = 1]) -> accept" Dec 02 07:09:20 ubuntu dae[11242]: level=debug msg=" upstream() -> accept" Dec 02 07:09:20 ubuntu systemd[1]: Started dae Service. ░░ Subject: A start job for unit dae.service has finished successfully ░░ Defined-By: systemd ░░ Support: http://www.ubuntu.com/support ░░ ░░ A start job for unit dae.service has finished successfully. ░░ ░░ The job identifier is 1989. Dec 02 07:10:49 ubuntu dae[11242]: level=warning msg="handlePkt: failed to dial proxy to tcp: context deadline exceeded" Dec 02 07:10:49 ubuntu dae[11242]: level=warning msg="handlePkt: failed to dial proxy to tcp: context deadline exceeded" Dec 02 07:10:49 ubuntu dae[11242]: level=warning msg="handlePkt: failed to dial proxy to tcp: context deadline exceeded" Dec 02 07:10:49 ubuntu dae[11242]: level=warning msg="handlePkt: failed to dial proxy to tcp: context deadline exceeded"

麻烦问下 connectivity test 日志怎么操作查看?@mzz2017

martinzu commented 11 months ago

关键是我确认我两台 trojan 节点都正常,在 nekobox 客户端中连接都没问题

mzz2017 commented 11 months ago

@martinzu 试试用debian11

martinzu commented 11 months ago

神奇,Debian 11 就是好的。ubuntu 估计那里有问题。感谢 @mzz2017

martinzu commented 11 months ago

@mzz2017 大佬,用 docker 运行还是有问题,能看下么?配置文件同上。日志: time="Dec 02 11:16:49" level=info msg="Include config files: [/etc/dae/config.dae]" time="Dec 02 11:16:49" level=info msg="Loading eBPF programs and maps into the kernel..." time="Dec 02 11:16:49" level=info msg="The loading process takes about 120MB free memory, which will be released after loading. Insufficient memory will cause loading failure." time="Dec 02 11:16:52" level=info msg="Loaded eBPF programs and maps" time="Dec 02 11:16:52" level=info msg="Bind to LAN: eth0" time="Dec 02 11:16:52" level=info msg="Bind to WAN: eth0" time="Dec 02 11:16:52" level=info msg="Group "elden_proxy" node list:" time="Dec 02 11:16:52" level=info msg=" HK" time="Dec 02 11:16:52" level=debug msg="Search "geoip.dat" in [/etc/dae, /root/.local/share/dae, /usr/local/share/dae, /usr/share/dae]" time="Dec 02 11:16:52" level=debug msg="Found "geoip.dat" at /usr/local/share/dae/geoip.dat" time="Dec 02 11:16:52" level=debug msg="Read geoip "geoip.dat:private" from /usr/local/share/dae/geoip.dat" time="Dec 02 11:16:52" level=debug msg="Read geoip "geoip.dat:cn" from /usr/local/share/dae/geoip.dat" time="Dec 02 11:16:52" level=debug msg="Search "geosite.dat" in [/etc/dae, /root/.local/share/dae, /usr/local/share/dae, /usr/share/dae]" time="Dec 02 11:16:52" level=debug msg="Found "geosite.dat" at /usr/local/share/dae/geosite.dat" time="Dec 02 11:16:52" level=debug msg="Read geosite "geosite.dat:cn" from /usr/local/share/dae/geosite.dat" time="Dec 02 11:16:52" level=debug msg="Read geosite "geosite.dat:category-ads" from /usr/local/share/dae/geosite.dat" time="Dec 02 11:16:52" level=debug msg="RoutingA: pname([n = 1]) -> direct ip([n = 10526]) -> direct domain([n = 4555]) -> direct domain([n = 664]) -> block fallback: elden_proxy " time="Dec 02 11:16:52" level=debug msg="[rule] pname([n = 1]) -> direct" time="Dec 02 11:16:52" level=debug msg=" pname() -> direct" time="Dec 02 11:16:52" level=debug msg="[rule] ip([n = 10526]) -> direct" time="Dec 02 11:16:52" level=debug msg=" ip() -> direct" time="Dec 02 11:16:52" level=debug msg="[rule] domain([n = 4555]) -> direct" time="Dec 02 11:16:52" level=debug msg=" domain(full) -> " time="Dec 02 11:16:52" level=debug msg=" domain(regex) -> " time="Dec 02 11:16:52" level=debug msg=" domain(suffix) -> direct" time="Dec 02 11:16:52" level=debug msg="[rule] domain([n = 664]) -> block" time="Dec 02 11:16:52" level=debug msg=" domain(full) -> " time="Dec 02 11:16:52" level=debug msg=" domain(regex) -> " time="Dec 02 11:16:52" level=debug msg=" domain(suffix) -> block" time="Dec 02 11:16:52" level=info msg="Routing match set len: 9/64" time="Dec 02 11:16:53" level=debug msg="Read geosite "geosite.dat:cn" from /usr/local/share/dae/geosite.dat" time="Dec 02 11:16:53" level=debug msg="[rule] qname([n = 4555]) -> alidns" time="Dec 02 11:16:53" level=debug msg=" qname(full) -> " time="Dec 02 11:16:53" level=debug msg=" qname(regex) -> " time="Dec 02 11:16:53" level=debug msg=" qname(suffix) -> alidns" time="Dec 02 11:16:53" level=debug msg="[rule] upstream([n = 1]) -> accept" time="Dec 02 11:16:53" level=debug msg=" upstream() -> accept" time="Dec 02 11:17:11" level=warning msg="handlePkt: failed to GetOrCreate: context deadline exceeded" time="Dec 02 11:17:11" level=warning msg="handlePkt: failed to GetOrCreate: context deadline exceeded" time="Dec 02 11:17:19" level=warning msg="handlePkt: failed to GetOrCreate: context deadline exceeded" time="Dec 02 11:17:19" level=warning msg="handlePkt: failed to GetOrCreate: context deadline exceeded" time="Dec 02 11:17:21" level=warning msg="handlePkt: failed to GetOrCreate: context deadline exceeded" time="Dec 02 11:17:27" level=warning msg="handlePkt: failed to GetOrCreate: context deadline exceeded" time="Dec 02 11:17:27" level=warning msg="handlePkt: failed to GetOrCreate: context deadline exceeded" time="Dec 02 11:17:27" level=warning msg="handlePkt: failed to GetOrCreate: context deadline exceeded" time="Dec 02 11:17:27" level=warning msg="handlePkt: failed to GetOrCreate: context deadline exceeded"

martinzu commented 11 months ago

补充下系统信息: root@debian:/etc/dae# uname -r 6.1.0-11-amd64 root@debian:/etc/dae# lsb_release -a No LSB modules are available. Distributor ID: Debian Description: Debian GNU/Linux 11 (bullseye) Release: 11 Codename: bullseye

pengw0048 commented 10 months ago

❣️ This issue is marked as wontfix as you have not yet starred this repo. Please kindly consider giving a star to this repo. Your support means a lot to us. Thanks for your understanding. After you become a stargazer, please also reply to this message with the keyword understood. Afterward, I will reopen this issue for you. Once again, your support is much appreciated. Cheers.

说句题外话,这样的行为很low,我认为也违反了github的acceptable use policy。我已经report abuse。

zhengshuxin commented 10 months ago

已关注项目并加星~

在阁下的star里没有看到针对此项目的star,是在说谎还是作者帮你解答后又取消 star 了?

Codespilot commented 10 months ago

已关注项目并加星~

在阁下的star里没有看到针对此项目的star,是在说谎还是作者帮你解答后又取消 star 了?

白嫖出了新的高度,怕是♥烫手