Files
v2ray_simple/examples/tun.client.toml
e1732a364fed 335d864e53 添加macos的tproxy功能; 修订文档,代码,示例
将条件编译相关文件全部移动到 cmd/verysimple文件夹中
2022-12-14 09:54:32 +08:00

55 lines
2.3 KiB
TOML
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# tun; vs的tun功能仅在 vs_gui 系列中存在。
# 你要配置好路由表才能让tun正常使用。
# 在mac/windows上路由表不是那么好配置尤其是没有linux那么灵活
# 而如果是在linux上的话直接推荐使用tproxy
# 对于小白来说,下面的指导太过于高级,难以看懂,因此对于小白来说推荐全自动化的方案。
# 在macos上, 配置路由表还需要在tun设备建立之后才能进行因为tun设备的名称是无法自定义的
# 在macos上, 需要管理员权限(sudo)运行vs_gui 才能 成功自动创建tun设备
# 下面给出macos上的路由表配置指导
# 首先删除默认路由,然后将路由指向 utun3 (用户自己运行的到的名称可能不同)
# 最后将自己的服务器的ip (我们的例子是 vlesss 的 127.0.0.1请你改成实际服务器ip) 的路由指向原来的 路由器地址
# sudo route delete -host default
# sudo route add default -interface utun3
# sudo route add -host 127.0.0.1 192.168.1.1
# 关闭vs后要将原来的路由添回。不会的话重启可以复原。
# sudo route delete -host default
# sudo route add default 192.168.1.1
# 这个方案只适用于 不直连,全经过代理的情况。如果要分流直连,则需要更高级的 路由方案才行,否则会导致本地回环
# 你还可以参考 https://github.com/yangchuansheng/love-gfw/blob/master/docs/gotun2socks-macos.md
[[listen]]
protocol = "tun"
# tun Server使用 host 配置作为 tun device name (macos不设此项)
# 使用 ip 配置作为 gateway 的ip , 若不给出,默认为 10.1.0.20
# 使用 extra.tun_selfip 作为 tun向外拨号的ip, 若不给出, 默认为 10.1.0.10
# 使用 extra.tun_mask 作为 子网掩码, 若不给出, 默认为 255.255.255.0
# 如果 extra.tun_auto_route 给出vs_gui会试图自动配置路由表.
# 此时必须额外给出需要 直连的ip列表, 比如你的 代理服务器的ip地址; 如果不给出, 则不会自动配置路由表
# 目前的自动配置逻辑 完全仿照上面的路由示例。
extra.tun_auto_route = true
extra.tun_auto_route_direct_list = [ "127.0.0.1" ]
[[dial]]
protocol = "vlesss"
uuid = "a684455c-b14f-11ea-bf0d-42010aaa0003"
host = "127.0.0.1"
port = 4433
version = 0
insecure = true
utls = true