有冇人識係手機上setup sing-box? 想借你config抄下

本帖最後由 Reguna 於 2024-10-25 02:35 編輯

如題 我想係手機做到以下既野:
1. 若瀏覽chatgpt.com及其subdomain,則行Wireguard出口A (付費VPN既Wireguard server)
2. 若瀏覽192.168.0.0/24,就行Wireguard出口B(我屋企Wireguard server)
3. 除此之外全部直連

就我理解,sing-box/v2rayng/shadowrocket等等手機App可以做到。 我用sing-box係因為佢cross platform+免費。
問題係佢份doc真係好簡陋,setup左兩日都未搞得掂
想問有冇師兄手機有用singbox,但個config又係work既?
如有,跪求po上黎比我參考下,thanks

我而家個config係咁
一踢著個singbox就網都上唔到,我覺得係dns問題
開termux ping到8.8.8.8但ping唔到google.com
  1. {
  2.   "log": {
  3.     "level": "info",
  4.     "timestamp": true
  5.   },
  6.   "dns": {
  7.     "servers": [
  8.       {
  9.         "tag": "default",
  10.         "address": "8.8.8.8",
  11.         "detour": "direct"
  12.       }
  13.     ],
  14.     "rules": [
  15.       {
  16.         "outbound": "any",
  17.         "server": "default"
  18.       }
  19.     ],
  20.     "final": "default",
  21.     "strategy": "prefer_ipv4"
  22.   },
  23.   "inbounds": [
  24.     {
  25.       "type": "tun",
  26.       "tag": "tun-in",
  27.       "mtu": 1500,
  28.       "address": "172.18.0.122/30",
  29.       "auto_route": true,
  30.       "strict_route": true,
  31.       "stack": "mixed",
  32.       "sniff": true
  33.     }
  34.   ],
  35.   "outbounds": [
  36.     {
  37.       "type": "direct",
  38.       "tag": "direct"
  39.     },
  40.     {
  41.       "type": "dns",
  42.       "tag": "dns-out"
  43.     },
  44.     {
  45.       "type": "wireguard",
  46.       "tag": "home",
  47.       "interface_name": "wg0",
  48.       "local_address": "10.0.0.3/24",
  49.       "private_key": "<omitted>",
  50.       "server": "<omitted>.duckdns.org",
  51.       "server_port": 51820,
  52.       "peer_public_key": "Z1XXLsKYkYxuiYjJIkRvtIKFepCYHTgON+GwPq7SOV4=",
  53.       "pre_shared_key": "<omitted>",
  54.       "mtu": 1420
  55.     },
  56.     {
  57.       "type": "wireguard",
  58.       "tag": "airvpn",
  59.       "interface_name": "wg1",
  60.       "local_address": "10.166.51.11/32",
  61.       "private_key": "<omitted>",
  62.       "server": "sg3.vpn.airdns.org",
  63.       "server_port": 1637,
  64.       "peer_public_key": "PyLCXAQT8KkM4T+dUsOQfn+Ub3pGxfGlxkIApuig+hk=",
  65.       "pre_shared_key": "<omitted>",
  66.       "mtu": 1320
  67.     }
  68.   ],
  69.   "route": {
  70.     "rules": [
  71.       {
  72.         "protocol": "dns",
  73.         "outbound": "dns-out"
  74.       },
  75.       {
  76.         "domain_suffix": "chatgpt.com",
  77.         "outbound": "airvpn"
  78.       },
  79.       {
  80.         "ip_cidr": [
  81.           "10.0.0.0/24",
  82.           "192.168.1.0/24"
  83.         ],
  84.         "outbound": "home"
  85.       }
  86.     ],
  87.     "final": "direct",
  88.     "auto_detect_interface": true,
  89.     "override_android_vpn": true
  90.   }
  91. }
複製代碼

TOP