docs: README

This commit is contained in:
mzz2017
2023-03-25 17:57:02 +08:00
parent bfaa8d634e
commit f265e84f08
3 changed files with 185 additions and 3 deletions

View File

@ -1,5 +1,7 @@
# Quick Start Guide
[中文](README_zh.md)
## Linux Kernel Requirement
## Kernel Version
@ -91,9 +93,9 @@ docker compose up -d --build
### Others
Other users can build dae by scratch. See [Build Guide](build-by-yourself.md) for more help.
Other users can build dae from scratch. See [Build Guide](build-by-yourself.md) for more help.
### Minimal Configuration
## Minimal Configuration
For minimal bootable config:
@ -163,6 +165,12 @@ See more at [example.dae](https://github.com/daeuniverse/dae/blob/main/example.d
If you use PVE, refer to [#37](https://github.com/daeuniverse/dae/discussions/37).
### Troubleshooting
## Reload and suspend
When the configuration changes, it is convenient to use command to hot reload the configuration, and the existing connection will not be interrupted in the process. When you want to suspend dae, you can use command to pause.
See [Reload and suspend](reload-and-suspend.md).
## Troubleshooting
See [Troubleshooting](troubleshooting.md).

View File

@ -0,0 +1,172 @@
# 吃鹅直通手册
## Linux 内核要求
## 内核版本
使用 `uname -r` 来查看内核版本。
> **注意**
> 如果你的内核版本低于 `5.8`,可以参考 [**Upgrade Guide**](./kernel-upgrade.md) 升级你的内核。
**绑定到 LAN 接口: >= 5.8**
如果你想作为路由器、网桥等中间设备,提供代理服务,需要把 dae 绑定到 LAN 接口上。
该特性要求 dae 所在的机器的内核版本 >= 5.8。
如果你只在 `lan_interface` 中填写了接口,那么本地程序将无法被代理,你需要在 `wan_interface` 中填写 `auto` 或是手动输入 WAN 接口。
**绑定到 WAN 接口: >= 5.8**
如果你想为本地程序提供代理服务,需要把 dae 绑定到 WAN 接口上。
该特性要求 dae 所在的机器的内核版本 >= 5.8。
如果你只在 `wan_interface` 中填写了接口或 `auto`,而 `lan_interface` 中没有填写内容,那么从局域网中来的流量将无法被代理。如果你想同时代理本机和局域网流量,请同时填写 `wan_interface``lan_interface`
## 内核配置选项
通常,主流桌面发行版都会打开这些选项。但是为了减小内核大小,在嵌入式设备发行版(如 OpenWRT、Armbian 等)上这些选项可能处于关闭状态。使用以下命令在您的机器上显示内核配置选项:
```shell
zcat /proc/config.gz || cat /boot/{config,config-$(uname -r)}
```
dae 需要以下内核选项:
```
CONFIG_DEBUG_INFO_BTF=y
CONFIG_BPF_EVENTS=y
CONFIG_KPROBE_EVENTS=y
CONFIG_NET_CLS_ACT=y
CONFIG_NET_SCH_INGRESS=m
CONFIG_NET_INGRESS=y
CONFIG_NET_EGRESS=y
```
你可以通过以下命令检查他们:
```shell
(zcat /proc/config.gz || cat /boot/{config,config-$(uname -r)}) | grep -E 'CONFIG_(DEBUG_INFO_BTF|BPF_EVENTS|KPROBE_EVENTS|NET_CLS_ACT|NET_SCH_INGRESS|NET_INGRESS|NET_EGRESS)='
```
> **注意**
> `Armbian` 用户可以参考 [**Upgrade Guide**](./kernel-upgrade.md) 升级到支持的内核。
## 安装
### Archlinux/Manjaro
dae 已发布于 [AUR](https://aur.archlinux.org/packages/dae/),使用下述命令安装:
```shell
# yay -S dae
pacman -S --needed git base-devel
git clone https://aur.archlinux.org/dae.git
cd dae
makepkg -si
```
安装后,使用 systemctl 对服务进行控制:
```shell
# 启动 dae
sudo systemctl start dae
# 开机自动启动 dae
sudo systemctl enable dae
```
### Docker
预编译镜像可相关文档请查阅https://hub.docker.com/r/daeuniverse/dae。
作为替代,你也可以使用 `docker compose`:
```shell
git clone --depth=1 https://github.com/daeuniverse/dae
docker compose up -d --build
```
### 其他方式
其他用户可以手动编译 dae。见 [Build Guide](build-by-yourself.md)。
## 最小 dae 配置
最小可启动的配置:
```shell
global{}
routing{}
```
然而,此配置使 dae 处于空载状态。如果您希望 dae 能正常工作,以下是较小配置下的最佳实践:
```shell
global {
# 绑定到 LAN 和/或 WAN 接口。将下述接口替换成你自己的接口名。
#lan_interface: docker0
wan_interface: auto # 使用 "auto" 自动侦测 WAN 接口。
log_level: info
allow_insecure: false
auto_config_kernel_parameter: true
}
subscription {
# 在下面填入你的订阅链接。
}
# 更多的 DNS 样例见 https://github.com/daeuniverse/dae/blob/main/docs/dns.md
dns {
upstream {
googledns: 'tcp+udp://dns.google:53'
alidns: 'udp://dns.alidns.com:53'
}
routing {
request {
fallback: alidns
}
response {
upstream(googledns) -> accept
!qname(geosite:cn) && ip(geoip:private) -> googledns
fallback: accept
}
}
}
group {
proxy {
#filter: name(keyword: HK, keyword: SG)
policy: min_moving_avg
}
}
# 更多的 Routing 样例见 https://github.com/daeuniverse/dae/blob/main/docs/routing.md
routing {
pname(NetworkManager, systemd-resolved, dnsmasq) -> must_direct
dip(224.0.0.0/3, 'ff00::/8') -> direct
### 以下为自定义规则
dip(geoip:private) -> direct
dip(geoip:cn) -> direct
domain(geosite:cn) -> direct
fallback: proxy
}
```
完整样例:[example.dae](https://github.com/daeuniverse/dae/blob/main/example.dae)。
如果你使用 PVE可以参考 [#37](https://github.com/daeuniverse/dae/discussions/37)。
## 热重载和暂停
当配置变化时,可以方便使用命令进行配置的热重载,在该过程中不会中断已有连接。当想暂停代理时,可使用命令进行暂停。
详见 [Reload and suspend](reload-and-suspend.md)。
## 错误排查
详见 [Troubleshooting](troubleshooting.md)。

View File

@ -22,6 +22,8 @@ Various Linux distributions have different methods to upgrade the Linux kernel.
### Upgrade to BTF Kernel on Armbian Linux
For Armbian users, we have compiled kernels with BTF on.
See [daeuniverse/armbian-btf-kernel](https://github.com/daeuniverse/armbian-btf-kernel).
### Upgrade Kernel on Debian-based Linux