跳至内容
璟雯院
珺璟如晔,雯华若锦
用户工具
登录
站点工具
搜索
工具
显示页面
修订记录
反向链接
最近更改
媒体管理器
网站地图
登录
>
最近更改
媒体管理器
网站地图
您在这里:
start
»
tech
»
homelab
»
sing-box
tech:homelab:sing-box
本页面只读。您可以查看源文件,但不能更改它。如果您觉得这是系统错误,请联系管理员。
====== Sing-box ====== 先说结论:婕莺也不知道怎么就跑起来了,真的太奇妙了。反正跑起来了。就先这样用吧。 首先需要软路由配置:Openwrt 23.0以上。需要打开的网页: - [[https://sing-box.sagernet.org/zh/ | 文档官网 ]] - [[https://github.com/ffuqiangg/build_openwrt/blob/main/docs/sing-box.md | 随便搜的使用教程]] - [[https://www.right.com.cn/forum/thread-8314833-1-1.html | 有效的论坛帖子 ]] - [[ https://icloudnative.io/posts/sing-box-tutorial/ | 科普读物 ]] ===== 安装Sing-Box ===== <code bash> opkg update opkg install kmod-inet-diag kmod-netlink-diag kmod-tun kmod-tcp-bbr opkg install sing-box curl nano </code> 在 /etc/sing-box 中存在一个配置文件,该配置文件是全局配置文件,所有的配置都从这设置。所以在网络上生成的配置都需要存这里。 可以使用命令 <code bash> wget -U "sing-box" "订阅地址" -O /etc/sing-box/xxx.json </code> 生成配置的服务是:[[ https://github.com/Toperlock/sing-box-subscribe | sing-box-subscribe ]] 可以简单写个Dockerfile挂在VSP上跑。 <code Dockerfile> </code> 然后直接docker run即可,不过在挂载的时候可能遇到无法下载images的验证问题,用GPT-4问问就解决了。 ===== 配置Sing-Box ===== 婕莺使用TUN模式,当然此模式不好的地方在于慢和ssh无法使用,不过婕莺也尝试了Tproxy配置,配了一天还是放弃了。 配置主要分为2步: - 修改防火墙 - 修改Sing-Box配置 <code text> config zone option name 'proxy' option forward 'REJECT' option output 'ACCEPT' option input 'ACCEPT' option mtu_fix '1' option device 'tun0' list network 'proxy' config forwarding option name 'lan-proxy' option dest 'proxy' option src 'lan' config interface 'proxy' option proto 'none' option device 'tun0' </code> <code text> { "type": "tun", "tag": "tun-in", "interface_name": "tun0", "mtu": 9000, "inet4_address": "172.19.0.1/30", "auto_route": true, "stack": "system", "sniff": true, "sniff_override_destination": true } </code> 然后重启OpenWRT的firewall。启动Sing-Box,结束。
/app/www/public/data/pages/tech/homelab/sing-box.txt
· 最后更改: 2024/04/09 12:24 由
温婕莺
页面工具
显示页面
修订记录
反向链接
回到顶部