在使用fakeip时遇到问题,不能在github的issue提交?
入口使用mixed,浏览器使用socks5或http正常。
入口使用tproxy,sing-box开启全局fakeip,前端我自己用python写的dns服务器,国外域名指定走fakeip,上游服务器指定到sing-box下的全局fakeip端口。
现象:
重启sing-box后,会发生之前访问过的网站,重启后无法访问。我知道是fakeip污染导致,ip发生变化了。
可我将前端dns的fakeip下的ttl设置为1,使用dig www.google.com命令,看到域名对应的ip地址已经一致了。可还是无法访问,这个其实之前在xray/v2ray也是这么用,等ttl老化fakeip就可以了。
但sing-box不知还需要什么处理。
问题描述:
sing-box版本:
sing-box version 1.3-beta14
Environment: go1.20.5 linux/amd64
Tags: with_gvisor,with_quic,with_dhcp,with_wireguard,with_utls,with_reality_server,with_clash_api
Revision: 7d263eb733bd9794b7cc8781f62463d53251ef54
CGO: disabled
sing-box 客户端日志
missing fakeip context
sing-box 客户端配置
{
"log": {
"disabled" : false,
"level": "debug",
"output": "/dev/shm/sing-box.log",
"timestamp": true
},
"dns": {
"servers": [
{
"tag": "remote",
"detour": "direct",
"address": "fakeip"
},
{
"tag": "block",
"address": "rcode://success"
}
],
"rules": [
{
"query_type": [
"A",
"AAAA"
],
"rewrite_ttl": 6,
"disable_cache": false,
"server": "remote"
}
],
"fakeip": {
"enabled": true,
"inet4_range": "198.18.0.0/15",
"inet6_range": "fc00::/64"
}
},
"inbounds": [
{
"type": "direct",
"tag": "dns-in",
"listen": "::",
"listen_port": 15656,
"sniff": true
},
{
"type": "mixed",
"tag": "mixed-in",
"listen": "::",
"listen_port": 7070,
"sniff": true,
"users": [],
"set_system_proxy": false
},
{
"type": "tproxy",
"tag": "tproxy-in",
"listen" : "::",
"listen_port": 7072,
"udp_fragment": true,
"sniff": false,
"sniff_override_destination": false
}
],
"outbounds": [
{
"type": "shadowsocks",
"tag": "ss-out",
"network": [ "tcp", "udp" ],
"method": "",
"password": "xxx",
"udp_over_tcp": {
"enabled": true,
"version": 2
},
"detour": "stls"
},
{
"type": "shadowtls",
"tag": "stls",
"server": "server ip",
"server_port": server port,
"routing_mark": 20,
"version": 3,
"password": "xxx",
"tls": {
"enabled": true,
"server_name": "s0.awsstatic.com",
"utls": {
"enabled": true,
"fingerprint": "chrome"
}
}
},
{
"type": "direct",
"tag": "direct",
"routing_mark": 20
},
{
"type": "block",
"tag": "block"
},
{
"type": "dns",
"tag": "dns-out"
}
],
"route": {
"rules": [
{
"source_ip_cidr": [ "192.168.2.31/32" ],
"outbound": "direct"
},
{
"ip_cidr": [ "172.26.10.168/32" ],
"network": [ "tcp", "udp" ],
"outbound": "ss-out"
},
{
"protocol": "dns",
"outbound": "dns-out"
},
{
"geoip": [ "private","cn","hk" ],
"geosite": [ "cn", "hk" ],
"outbound": "direct"
},
{
"geoip": [ "private","cn","hk" ],
"geosite": [ "cn", "hk" ],
"invert": true,
"outbound": "ss-out"
},
{
"protocol": [
"tls",
"http",
"quic"
],
"outbound": "ss-out"
}
],
"auto_detect_interface": true,
"geoip": {
"path": "/etc/sing-box/geoip.db",
"download_detour": "ss-out"
},
"geosite": {
"path": "/etc/sing-box/geosite.db",
"download_detour": "ss-out"
}
}
}