docs: nftable set ttl 64

This commit is contained in:
SunBK201 2024-10-16 10:34:39 +08:00
parent 6bc8f0a87c
commit 992928757a

View File

@ -9,6 +9,7 @@ UA3F 是新一代 HTTP User-Agent 修改方法,对外作为一个 SOCK5 服务
[Release](https://github.com/SunBK201/UA3F/releases) 页面已经提供常见架构的编译版本,可以根据自己架构下载并解压到路由器等设备上。
安装(升级)脚本:
```sh
opkg update
opkg install curl libcurl luci-compat
@ -23,6 +24,7 @@ UA3F 已支持 LuCI Web 页面,可以打开 Services -> UA3F 进行相关配
![UA3F-LuCI](https://sunbk201.oss-cn-beijing.aliyuncs.com/img/ua3f-luci)
参数:
- `-p <port>`: 端口号,默认 1080
- `-f <UA>`: 自定义 UA默认 FFF
- `-b <bind addr>`: 自定义绑定监听地址,默认 127.0.0.1
@ -31,6 +33,7 @@ UA3F 已支持 LuCI Web 页面,可以打开 Services -> UA3F 进行相关配
### 作为后台服务运行
安装脚本执行成功后可通过以下命令启动 UA3F
```sh
# 启动 UA3F
uci set ua3f.enabled.enabled=1
@ -39,6 +42,7 @@ service ua3f start
```
关闭或重启 UA3F 命令:
```sh
# 关闭 UA3F
service ua3f stop
@ -47,6 +51,7 @@ service ua3f restart
```
配置 UA3
```sh
# 自定义 UA
uci set ua3f.main.ua="FFF"
@ -63,11 +68,13 @@ reload_config
```
### 手动启动
```sh
sudo -u nobody /usr/bin/ua3f
```
shellclash/shellcrash 用户建议使用以下命令启动:
```sh
sudo -u shellclash /usr/bin/ua3f
# 如果上面命令报错执行下面该命令
@ -75,6 +82,7 @@ sudo -u shellcrash /usr/bin/ua3f
```
### Clash 的配置建议
Clash 与 UA3F 的配置部署教程详见:[UA3F 与 Clash 从零开始的部署教程](https://sunbk201public.notion.site/UA3F-Clash-16d60a7b5f0e457a9ee97a3be7cbf557?pvs=4)
- Clash 需要选用 Meta 内核。
@ -102,6 +110,7 @@ rules:
### Clash 参考配置
提供 3 个参考配置:
1. 国内版,无需进行任何修改,可直接使用 [ua3f-cn.yaml](https://cdn.jsdelivr.net/gh/SunBK201/UA3F@master/clash/ua3f-cn.yaml) (Clash 需要选用 Meta 内核。)
2. 国际版,针对有特定需求的特殊用户进行适配,[ua3f-global.yaml](https://cdn.jsdelivr.net/gh/SunBK201/UA3F@master/clash/ua3f-global.yaml),注意需要在 proxy-providers > Global-ISP > url 中(第 23 行)加入你的代理节点订阅链接。(Clash 需要选用 Meta 内核。)
3. 国际版(增强),针对流量特征检测 (DPI) 进行规则补充,注意该配置会对 QQ、微信等平台的流量进行分流代理因此需要根据自己的需求谨慎选择该配置[ua3f-global-enhance.yaml](https://cdn.jsdelivr.net/gh/SunBK201/UA3F@master/clash/ua3f-global-enhance.yaml),注意需要在 proxy-providers > Global-ISP > url 中(第 23 行)加入你的代理节点订阅链接。(Clash 需要选用 Meta 内核。)
@ -113,4 +122,20 @@ rules:
- [ ] 支持 SOCK5 Auth
- [x] 支持 UDP
- [ ] 支持 IPv6
- [ ] 性能提升
- [ ] 性能提升
## Extra
使用 nftables 固定 TTL 为 64
```sh
nft add table inet ttl64
nft add chain inet ttl64 postrouting { type filter hook postrouting priority -150\; policy accept\; }
nft add rule inet ttl64 postrouting counter ip ttl set 64
```
使用 iptables 固定 TTL 为 64
```sh
iptables -t mangle -A POSTROUTING -j TTL --ttl-set 64
```