diff --git a/docs/examples/fakeip.md b/docs/examples/fakeip.md new file mode 100644 index 00000000..e6854c6b --- /dev/null +++ b/docs/examples/fakeip.md @@ -0,0 +1,105 @@ +```json +{ + "dns": { + "servers": [ + { + "tag": "google", + "address": "tls://8.8.8.8" + }, + { + "tag": "local", + "address": "223.5.5.5", + "detour": "direct" + }, + { + "tag": "remote", + "address": "fakeip" + }, + { + "tag": "block", + "address": "rcode://success" + } + ], + "rules": [ + { + "geosite": "category-ads-all", + "server": "block", + "disable_cache": true + }, + { + "outbound": "any", + "server": "local" + }, + { + "geosite": "cn", + "server": "local" + }, + { + "query_type": [ + "A", + "AAAA" + ], + "server": "remote" + } + ], + "fakeip": { + "enabled": true, + "inet4_range": "198.18.0.0/15", + "inet6_range": "fc00::/18" + }, + "strategy": "ipv4_only" + }, + "inbounds": [ + { + "type": "tun", + "inet4_address": "172.19.0.1/30", + "auto_route": true, + "sniff": true, + "domain_strategy": "ipv4_only" // remove this line if you want to resolve the domain remotely (if the server is not sing-box, UDP may not work due to wrong behavior). + } + ], + "outbounds": [ + { + "type": "shadowsocks", + "tag": "proxy", + "server": "mydomain.com", + "server_port": 8080, + "method": "2022-blake3-aes-128-gcm", + "password": "8JCsPssfgS8tiRwiMlhARg==" + }, + { + "type": "direct", + "tag": "direct" + }, + { + "type": "block", + "tag": "block" + }, + { + "type": "dns", + "tag": "dns-out" + } + ], + "route": { + "rules": [ + { + "protocol": "dns", + "outbound": "dns-out" + }, + { + "geosite": "cn", + "geoip": [ + "private", + "cn" + ], + "outbound": "direct" + }, + { + "geosite": "category-ads-all", + "outbound": "block" + } + ], + "auto_detect_interface": true + } +} +``` \ No newline at end of file diff --git a/docs/examples/fakeip.zh.md b/docs/examples/fakeip.zh.md new file mode 100644 index 00000000..ac29a859 --- /dev/null +++ b/docs/examples/fakeip.zh.md @@ -0,0 +1,105 @@ +```json +{ + "dns": { + "servers": [ + { + "tag": "google", + "address": "tls://8.8.8.8" + }, + { + "tag": "local", + "address": "223.5.5.5", + "detour": "direct" + }, + { + "tag": "remote", + "address": "fakeip" + }, + { + "tag": "block", + "address": "rcode://success" + } + ], + "rules": [ + { + "geosite": "category-ads-all", + "server": "block", + "disable_cache": true + }, + { + "outbound": "any", + "server": "local" + }, + { + "geosite": "cn", + "server": "local" + }, + { + "query_type": [ + "A", + "AAAA" + ], + "server": "remote" + } + ], + "fakeip": { + "enabled": true, + "inet4_range": "198.18.0.0/15", + "inet6_range": "fc00::/18" + }, + "strategy": "ipv4_only" + }, + "inbounds": [ + { + "type": "tun", + "inet4_address": "172.19.0.1/30", + "auto_route": true, + "sniff": true, + "domain_strategy": "ipv4_only" // 如果您想在远程解析域,删除此行 (如果服务器程序不为 sing-box,可能由于错误的行为导致 UDP 无法使用)。 + } + ], + "outbounds": [ + { + "type": "shadowsocks", + "tag": "proxy", + "server": "mydomain.com", + "server_port": 8080, + "method": "2022-blake3-aes-128-gcm", + "password": "8JCsPssfgS8tiRwiMlhARg==" + }, + { + "type": "direct", + "tag": "direct" + }, + { + "type": "block", + "tag": "block" + }, + { + "type": "dns", + "tag": "dns-out" + } + ], + "route": { + "rules": [ + { + "protocol": "dns", + "outbound": "dns-out" + }, + { + "geosite": "cn", + "geoip": [ + "private", + "cn" + ], + "outbound": "direct" + }, + { + "geosite": "category-ads-all", + "outbound": "block" + } + ], + "auto_detect_interface": true + } +} +``` \ No newline at end of file diff --git a/docs/examples/index.md b/docs/examples/index.md index dbc6c42b..c39a7f32 100644 --- a/docs/examples/index.md +++ b/docs/examples/index.md @@ -9,3 +9,4 @@ Configuration examples for sing-box. * [ShadowTLS](./shadowtls) * [Clash API](./clash-api) * [WireGuard Direct](./wireguard-direct) +* [FakeIP](./fakeip) diff --git a/docs/examples/index.zh.md b/docs/examples/index.zh.md index 1338081f..2dd801ec 100644 --- a/docs/examples/index.zh.md +++ b/docs/examples/index.zh.md @@ -9,3 +9,4 @@ sing-box 的配置示例。 * [ShadowTLS](./shadowtls) * [Clash API](./clash-api) * [WireGuard Direct](./wireguard-direct) +* [FakeIP](./fakeip) diff --git a/mkdocs.yml b/mkdocs.yml index 651a96d2..036865da 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -115,6 +115,7 @@ nav: - ShadowTLS: examples/shadowtls.md - Clash API: examples/clash-api.md - WireGuard Direct: examples/wireguard-direct.md + - FakeIP: examples/fakeip.md - Contributing: - contributing/index.md - Developing: