XTLS / Xray-core

Xray, Penetrates Everything. Also the best v2ray-core, with XTLS support. Fully compatible configuration.
https://t.me/projectXray
Mozilla Public License 2.0
25.51k stars 3.94k forks source link

无法解析域名, Log里面大量的 "app/proxyman/inbound: connection ends > fake: socket bind: address already in use"记录 #660

Closed AlexAfterbeer closed 3 years ago

AlexAfterbeer commented 3 years ago
  1. 工作环境

    RT-AC1900P Asuswrt-merlin 386.3
    Xray-Core 1.42 linux armv5

    2.故障现象

    启动xray后,所有客户端无法上网,Log文件中出现大量的fake: socket bind:address already in use.
  2. 配置

    {
    "dns": {
        "tag": "dns_in",
        "hosts": { "www.digitalocean.com" : "104.16.182.15" },
        "servers": [
            { "address": "8.8.8.8", "port": 53, "domains": [ "geosite:geolocation-!cn" ] },
            "8.8.8.8" , "8.8.4.4" , "1.1.1.1",
            { "address": "114.114.114.114", "port" 53, "domains": [ "geosite:cn" ], "expectIPs": ["geoip:cn"] }
        ]
    },
    "routing": {
        "domainStrategy": "IPIfNonMatch",
        "rules": [
            { "type": "field",  "inboundTag": [ "dns_in" ] , "outboundTag": "dns_out" },
            { "type": "field",  "network": "udp", "port": 53, "inboundTag": [ "transparent" ] , "outboundTag": "dns_out" },
            { "type": "field", "ip": [ "8.8.8.8", "8.8.4.4", "1.1.1.1" ] , "outboundTag": "proxy" },
            { "type": "field", "ip": [ "114.114.114.114" ] , "outboundTag": "direct" }, 
            { "type": "field", "domain": [ "geosite:google" , "geosite:github" ], "outboundTag": "proxy" },
        ]
    },
    "inbounds": [ 
        { 
            "tag": "transparent",
            "protocol": "dokodemo-door", 
            "port": 1081,
            "settings":{ "network": "tcp,udp", "followRedirect": true },
            "streamSettings": { "sockopt": { "tproxy": "tproxy" , "mark": 2 } },
            "sniffing": { "enabled": true, "destOverride": [ "http", "tls" ] }
        }
    ],
    "outbounds": [
        {
            "tag": "direct",
            "protocol": "freedom",
            "settings": { "domainStrategy": "UseIP" },
            "streamSettings": { "sockopt": { "mark": 2 } }
        },
        {
            "tag": "dns_out",
            "protocol": "dns",
            "settings": { },
            "streamSettings": { "sockopt": { "mark": 2 , "domainStrategy": "UseIP" } }
        },
        {
            "tag": "proxy",
            "protocol": "vless"
            "settings": { "vnext": [ {"address": "www.digitalocean.com", "port":443, ..............} ] },
            "streamSettings": { "sockopt": { "mark": 2, "domainStrategy": "UseIP" } ,"network": "ws", "security":"tls", "wsSettings": {...}, "tlsSettings": {...} }
        }
    ]
    }
  3. iptables脚本

    #!/bin/sh
    insmod nf_tproxy_core
    insmod xt_TPROXY
    insmod xt_socket
    
    ip route add local default dev lo table 100
    ip rule add fwmark 1 lookup 100
    
    iptables -t mangle -N XRAY
    iptables -t mangle -A XRAY -d 0.0.0.0/8 -j RETURN
    iptables -t mangle -A XRAY -d 192.168.0.0/16 -p tcp -j RETURN
    iptables -t mangle -A XRAY -d 192.168.0.0/16 -p udp ! --dport 53 -j RETURN
    iptables -t mangle -A XRAY -j RETURN -m mark --mark 0x2
    iptables -t mangle -A XRAY -p tcp -j TPROXY --on-port 1081 --tproxy-mark 1
    iptables -t mangle -A XRAY -p udp -j TPROXY --on-port 1081 --tproxy-mark 1
    iptables -t mangle -A PREROUTING -j XRAY
    
    iptables -t mangle -N XRAY_MARK
    iptables -t mangle -A XRAY_MARK -d 0.0.0.0/8 -j RETURN
    iptables -t mangle -A XRAY_MARK -d 192.168.0.0/16 -p tcp -j RETURN
    iptables -t mangle -A XRAY_MARK -d 192.168.0.0/16 -p udp ! --dport 53 -j RETURN
    iptables -t mangle -A XRAY_MARK -j RETURN -m mark --mark 2
    iptables -t mangle -A XRAY_MARK -p tcp -j MARK --set-mark 1
    iptables -t mangle -A XRAY_MARK -p udp -j MARK --set-mark 1
    iptables -t mangle -A OUTPUT -j XRAY_MARK
  4. 系统端口使用情况

    admin@RT-AC1900P:/tmp/home/root# netstat -tunlp
    Active Internet connections (only servers)
    Proto Recv-Q Send-Q Local Address           Foreign Address         State       PID/Program name
    tcp        0      0 0.0.0.0:18017           0.0.0.0:*               LISTEN      181/wanduck
    tcp        0      0 127.0.0.1:139           0.0.0.0:*               LISTEN      32558/smbd
    tcp        0      0 192.168.1.1:139         0.0.0.0:*               LISTEN      32558/smbd
    tcp        0      0 0.0.0.0:7788            0.0.0.0:*               LISTEN      994/cfg_server
    tcp        0      0 127.0.0.1:80            0.0.0.0:*               LISTEN      641/httpd
    tcp        0      0 192.168.1.1:80          0.0.0.0:*               LISTEN      641/httpd
    tcp        0      0 127.0.0.1:53            0.0.0.0:*               LISTEN      32486/dnsmasq
    tcp        0      0 192.168.1.1:53          0.0.0.0:*               LISTEN      32486/dnsmasq
    tcp        0      0 0.0.0.0:3702            0.0.0.0:*               LISTEN      32560/wsdd2
    tcp        0      0 192.168.1.1:22          0.0.0.0:*               LISTEN      24124/dropbear
    tcp        0      0 0.0.0.0:59740           0.0.0.0:*               LISTEN      32438/miniupnpd
    tcp        0      0 127.0.0.1:445           0.0.0.0:*               LISTEN      32558/smbd
    tcp        0      0 192.168.1.1:445         0.0.0.0:*               LISTEN      32558/smbd
    udp        0      0 0.0.0.0:9999            0.0.0.0:*                           642/infosvr
    udp        0      0 0.0.0.0:42000           0.0.0.0:*                           211/eapd
    udp        0      0 0.0.0.0:36397           0.0.0.0:*                           1371/avahi-daemon:
    udp        0      0 127.0.0.1:42032         0.0.0.0:*                           560/acsd
    udp        0      0 127.0.0.1:53            0.0.0.0:*                           32486/dnsmasq
    udp        0      0 192.168.1.1:53          0.0.0.0:*                           32486/dnsmasq
    udp        0      0 0.0.0.0:67              0.0.0.0:*                           32486/dnsmasq
    udp        0      0 0.0.0.0:18018           0.0.0.0:*                           181/wanduck
    udp        0      0 0.0.0.0:1900            0.0.0.0:*                           32438/miniupnpd
    udp        0      0 0.0.0.0:7788            0.0.0.0:*                           994/cfg_server
    udp        0      0 0.0.0.0:38000           0.0.0.0:*                           211/eapd
    udp        0      0 0.0.0.0:3702            0.0.0.0:*                           32560/wsdd2
    udp        0      0 0.0.0.0:59000           0.0.0.0:*                           211/eapd
    udp        0      0 0.0.0.0:37000           0.0.0.0:*                           211/eapd
    udp        0      0 192.168.1.255:137       0.0.0.0:*                           32557/nmbd
    udp        0      0 192.168.1.1:137         0.0.0.0:*                           32557/nmbd
    udp        0      0 0.0.0.0:137             0.0.0.0:*                           32557/nmbd
    udp        0      0 192.168.1.255:138       0.0.0.0:*                           32557/nmbd
    udp        0      0 192.168.1.1:138         0.0.0.0:*                           32557/nmbd
    udp        0      0 0.0.0.0:138             0.0.0.0:*                           32557/nmbd
    udp        0      0 127.0.0.1:38032         0.0.0.0:*                           226/nas
    udp        0      0 127.0.0.1:59032         0.0.0.0:*                           237/wlceventd
    udp        0      0 0.0.0.0:47000           0.0.0.0:*                           211/eapd
    udp        0      0 192.168.1.1:40355       0.0.0.0:*                           32438/miniupnpd
    udp        0      0 127.0.0.1:47032         0.0.0.0:*                           766/roamast
    udp        0      0 192.168.1.1:5351        0.0.0.0:*                           32438/miniupnpd
    udp        0      0 0.0.0.0:5353            0.0.0.0:*                           1371/avahi-daemon:
    udp        0      0 0.0.0.0:43000           0.0.0.0:*                           211/eapd
    udp        0      0 127.0.0.1:61689         0.0.0.0:*                           722/mastiff
    admin@RT-AC1900P:/tmp/home/root#
  5. Error Log记录

2021/08/01 16:07:23 [Debug] app/log: Logger started 2021/08/01 16:07:23 [Info] app/dns: DNS: created UDP client initialized for 8.8.8.8:53 2021/08/01 16:07:23 [Info] app/dns: DNS: created UDP client initialized for 8.8.8.8:53 2021/08/01 16:07:23 [Info] app/dns: DNS: created UDP client initialized for 8.8.4.4:53 2021/08/01 16:07:23 [Info] app/dns: DNS: created UDP client initialized for 1.1.1.1:53 2021/08/01 16:07:23 [Info] app/dns: DNS: created UDP client initialized for 114.114.114.114:53 2021/08/01 16:07:24 [Debug] app/router: MphDomainMatcher is enabled for 6 domain rule(s) 2021/08/01 16:07:24 [Debug] app/router: MphDomainMatcher is enabled for 959 domain rule(s) 2021/08/01 16:07:24 [Debug] app/router: MphDomainMatcher is enabled for 11 domain rule(s) 2021/08/01 16:07:24 [Debug] app/router: MphDomainMatcher is enabled for 237 domain rule(s) 2021/08/01 16:07:24 [Debug] app/proxyman/inbound: creating stream worker on 192.168.1.1:1080 2021/08/01 16:07:24 [Debug] app/proxyman/inbound: creating stream worker on 127.0.0.1:1081 2021/08/01 16:07:24 [Info] transport/internet/tcp: listening TCP on 192.168.1.1:1080 2021/08/01 16:07:24 [Info] transport/internet/tcp: listening TCP on 127.0.0.1:1081 2021/08/01 16:07:24 [Info] transport/internet/udp: listening UDP on 127.0.0.1:1081 2021/08/01 16:07:24 [Warning] core: Xray 1.4.2 started 2021/08/01 16:07:24 [Debug] [1018988766] proxy/dokodemo: processing connection from: 192.168.1.42:36110 2021/08/01 16:07:24 [Info] [1018988766] proxy/dokodemo: received request for 192.168.1.42:36110 2021/08/01 16:07:24 [Info] [1018988766] app/dispatcher: sniffed domain: ncsi.uu.netease.com 2021/08/01 16:07:24 [Debug] app/dns: domain ncsi.uu.netease.com matches following rules: [geosite:cn(DNS idx:4)] 2021/08/01 16:07:24 [Debug] app/dns: domain ncsi.uu.netease.com uses following DNS first: [UDP:114.114.114.114:53] 2021/08/01 16:07:24 [Debug] app/dns: UDP:114.114.114.114:53 querying DNS for: ncsi.uu.netease.com. 2021/08/01 16:07:24 [Debug] transport/internet/udp: dispatch request to: udp:114.114.114.114:53 2021/08/01 16:07:24 [Info] transport/internet/udp: establishing new connection for udp:114.114.114.114:53 2021/08/01 16:07:24 [Info] app/dispatcher: taking detour [dns_out] for [udp:114.114.114.114:53] 2021/08/01 16:07:24 [Info] proxy/dns: handling DNS traffic to udp:114.114.114.114:53 2021/08/01 16:07:24 [Debug] transport/internet: dialing to udp:114.114.114.114:53 2021/08/01 16:07:24 [Debug] transport/internet/udp: dispatch request to: udp:114.114.114.114:53 2021/08/01 16:07:24 [Debug] transport/internet/udp: UDP original destination: udp:公网IP地址:35269 2021/08/01 16:07:24 [Debug] transport/internet/udp: UDP original destination: udp:公网IP地址:35269 2021/08/01 16:07:24 [Debug] [3686061533] proxy/dokodemo: processing connection from: 114.114.114.114:53 2021/08/01 16:07:24 [Info] [3686061533] proxy/dokodemo: received request for 114.114.114.114:53 2021/08/01 16:07:24 [Info] [3686061533] app/proxyman/inbound: connection ends > fake: socket bind: address already in use 2021/08/01 16:07:24 [Info] [3686061533] app/dispatcher: default route for udp:公网IP地址:35269 2021/08/01 16:07:24 [Info] [3686061533] proxy/freedom: opening connection to udp:公网IP地址:35269 2021/08/01 16:07:24 [Debug] transport/internet: dialing to udp:公网IP地址:35269 2021/08/01 16:07:27 [Debug] transport/internet/udp: UDP original destination: udp:192.168.1.1:53 2021/08/01 16:07:27 [Debug] [1938424193] proxy/dokodemo: processing connection from: 192.168.1.42:32823 2021/08/01 16:07:27 [Info] [1938424193] proxy/dokodemo: received request for 192.168.1.42:32823 2021/08/01 16:07:27 [Info] [1938424193] app/dispatcher: default route for udp:192.168.1.1:53 2021/08/01 16:07:27 [Info] [1938424193] proxy/freedom: opening connection to udp:192.168.1.1:53 2021/08/01 16:07:27 [Debug] transport/internet: dialing to udp:192.168.1.1:53 2021/08/01 16:07:27 [Debug] transport/internet/udp: UDP original destination: udp:223.5.5.5:53 2021/08/01 16:07:27 [Debug] [2565578959] proxy/dokodemo: processing connection from: 192.168.1.42:42440 2021/08/01 16:07:27 [Info] [2565578959] proxy/dokodemo: received request for 192.168.1.42:42440 2021/08/01 16:07:27 [Info] [2565578959] app/dispatcher: default route for udp:223.5.5.5:53 2021/08/01 16:07:27 [Info] [2565578959] proxy/freedom: opening connection to udp:223.5.5.5:53 2021/08/01 16:07:27 [Debug] transport/internet: dialing to udp:223.5.5.5:53 2021/08/01 16:07:27 [Debug] transport/internet/udp: UDP original destination: udp:公网IP地址:43902 2021/08/01 16:07:27 [Debug] [3341405009] proxy/dokodemo: processing connection from: 223.5.5.5:5 3 2021/08/01 16:07:27 [Info] [3341405009] proxy/dokodemo: received request for 223.5.5.5:53 2021/08/01 16:07:27 [Info] [3341405009] app/proxyman/inbound: connection ends > fake: socket bind: address already in use 2021/08/01 16:07:27 [Info] [3341405009] app/dispatcher: default route for udp:公网IP地址:43902 2021/08/01 16:07:27 [Info] [3341405009] proxy/freedom: opening connection to udp:公网IP地址:43902 2021/08/01 16:07:27 [Debug] transport/internet: dialing to udp:公网IP地址:43902 2021/08/01 16:07:27 [Debug] [3615170242] proxy/dokodemo: processing connection from: 192.168.1.2:1253 2021/08/01 16:07:27 [Info] [3615170242] proxy/dokodemo: received request for 192.168.1.2:1253 2021/08/01 16:07:27 [Info] [3615170242] app/dispatcher: sniffed domain: www.youtube.com 2021/08/01 16:07:27 [Info] [3615170242] app/dispatcher: taking detour [vless_us_2] for [tcp:www.youtube.com:443] 2021/08/01 16:07:27 [Info] [3615170242] transport/internet/websocket: creating connection to tcp:www.digitalocean.com:443 2021/08/01 16:07:28 [Debug] transport/internet/udp: UDP original destination: udp:192.168.1.1:53 2021/08/01 16:07:28 [Debug] transport/internet: dialing to tcp:www.digitalocean.com:443 2021/08/01 16:07:28 [Info] app/dns: returning 1 IPs for domain www.digitalocean.com 2021/08/01 16:07:28 [Info] transport/internet: replace destination with tcp:104.16.182.15:443 2021/08/01 16:07:28 [Debug] [3493052611] proxy/dokodemo: processing connection from: 192.168.1.2:14367 2021/08/01 16:07:28 [Info] [3493052611] proxy/dokodemo: received request for 192.168.1.2:14367 2021/08/01 16:07:28 [Info] [3493052611] app/dispatcher: sniffed domain: www.youtube.com 2021/08/01 16:07:28 [Info] [3493052611] app/dispatcher: taking detour [vless_us_2] for [tcp:www.youtube.com:443] 2021/08/01 16:07:28 [Info] [3493052611] transport/internet/websocket: creating connection to tcp:www.digitalocean.com:443 2021/08/01 16:07:28 [Debug] transport/internet: dialing to tcp:www.digitalocean.com:443 2021/08/01 16:07:28 [Info] app/dns: returning 1 IPs for domain www.digitalocean.com 2021/08/01 16:07:28 [Info] transport/internet: replace destination with tcp:104.16.182.15:443 2021/08/01 16:07:28 [Info] [1018988766] app/proxyman/inbound: connection ends > proxy/dokodemo: connection ends > context canceled 2021/08/01 16:07:28 [Debug] transport/internet/udp: UDP original destination: udp:114.114.114.114:53 2021/08/01 16:07:28 [Debug] transport/internet/udp: UDP original destination: udp:公网IP地址:43902 2021/08/01 16:07:28 [Debug] [2808515850] proxy/dokodemo: processing connection from: 114.114.114.114:53 2021/08/01 16:07:28 [Info] [2808515850] proxy/dokodemo: received request for 114.114.114.114:53 2021/08/01 16:07:28 [Info] [2808515850] app/proxyman/inbound: connection ends > fake: socket bind: address already in use 2021/08/01 16:07:28 [Info] [2808515850] app/dispatcher: default route for udp:公网IP地址:43902 2021/08/01 16:07:28 [Info] [2808515850] proxy/freedom: opening connection to udp:公网IP地址:43902 2021/08/01 16:07:28 [Debug] transport/internet: dialing to udp:公网IP地址:43902 2021/08/01 16:07:28 [Debug] transport/internet/udp: UDP original destination: udp:192.168.1.1:53 2021/08/01 16:07:28 [Debug] [3748991922] proxy/dokodemo: processing connection from: 192.168.1.2:54956 2021/08/01 16:07:28 [Info] [3748991922] proxy/dokodemo: received request for 192.168.1.2:54956 2021/08/01 16:07:28 [Info] [3748991922] app/dispatcher: default route for udp:192.168.1.1:53 2021/08/01 16:07:28 [Info] [3748991922] proxy/freedom: opening connection to udp:192.168.1.1:53 2021/08/01 16:07:28 [Debug] transport/internet: dialing to udp:192.168.1.1:53 2021/08/01 16:07:28 [Debug] transport/internet/udp: UDP original destination: udp:192.168.1.1:53 2021/08/01 16:07:28 [Info] [3615170242] proxy/vless/outbound: tunneling request to tcp:www.youtube.com:443 via tcp:www.digitalocean.com:443 2021/08/01 16:07:28 [Info] app/dns: failed to lookup ip for domain ncsi.uu.netease.com at server UDP:114.114.114.114:53 > context deadline exceeded 2021/08/01 16:07:28 [Debug] app/dns: UDP:8.8.8.8:53 querying DNS for: ncsi.uu.netease.com. 2021/08/01 16:07:28 [Debug] transport/internet/udp: dispatch request to: udp:8.8.8.8:53 2021/08/01 16:07:28 [Info] transport/internet/udp: establishing new connection for udp:8.8.8.8:53 2021/08/01 16:07:28 [Info] app/dispatcher: taking detour [dns_out] for [udp:8.8.8.8:53] 2021/08/01 16:07:28 [Info] proxy/dns: handling DNS traffic to udp:8.8.8.8:53 2021/08/01 16:07:28 [Debug] transport/internet: dialing to udp:8.8.8.8:53 2021/08/01 16:07:28 [Debug] transport/internet/udp: dispatch request to: udp:8.8.8.8:53 2021/08/01 16:07:28 [Debug] transport/internet/udp: UDP original destination: udp:公网IP地址:51175 2021/08/01 16:07:28 [Debug] [1575538076] proxy/dokodemo: processing connection from: 8.8.8.8:53 2021/08/01 16:07:28 [Info] [1575538076] proxy/dokodemo: received request for 8.8.8.8:53 2021/08/01 16:07:28 [Info] [1575538076] app/proxyman/inbound: connection ends > fake: socket bind: address already in use 2021/08/01 16:07:28 [Info] [1575538076] app/dispatcher: default route for udp:公网IP地址:51175 2021/08/01 16:07:28 [Info] [1575538076] proxy/freedom: opening connection to udp:公网IP地址:51175 2021/08/01 16:07:28 [Debug] transport/internet: dialing to udp:公网IP地址:51175 2021/08/01 16:07:28 [Debug] transport/internet/udp: UDP original destination: udp:公网IP地址:51175 2021/08/01 16:07:28 [Debug] [532793603] proxy/dokodemo: processing connection from: 8.8.8.8:53 2021/08/01 16:07:28 [Info] [532793603] proxy/dokodemo: received request for 8.8.8.8:53 2021/08/01 16:07:28 [Info] [532793603] app/proxyman/inbound: connection ends > fake: socket bind: address already in use 2021/08/01 16:07:28 [Info] [532793603] app/dispatcher: default route for udp:公网IP地址:51175 2021/08/01 16:07:28 [Info] [532793603] proxy/freedom: opening connection to udp:公网IP地址:51175 2021/08/01 16:07:28 [Debug] transport/internet: dialing to udp:公网IP地址:51175 2021/08/01 16:07:29 [Debug] transport/internet/udp: UDP original destination: udp:216.58.200.234:443 2021/08/01 16:07:29 [Debug] [2600284104] proxy/dokodemo: processing connection from: 192.168.1.2:50330 2021/08/01 16:07:29 [Info] [2600284104] proxy/dokodemo: received request for 192.168.1.2:50330 2021/08/01 16:07:29 [Info] [2600284104] app/dispatcher: default route for udp:216.58.200.234:443 2021/08/01 16:07:29 [Info] [2600284104] proxy/freedom: opening connection to udp:216.58.200.234:443 2021/08/01 16:07:29 [Debug] transport/internet: dialing to udp:216.58.200.234:443 2021/08/01 16:07:29 [Debug] [772050547] proxy/dokodemo: processing connection from: 192.168.1.2:5793 2021/08/01 16:07:29 [Info] [772050547] proxy/dokodemo: received request for 192.168.1.2:5793 2021/08/01 16:07:29 [Info] [772050547] app/dispatcher: sniffed domain: content-autofill.googleapis.com 2021/08/01 16:07:29 [Info] [772050547] app/dispatcher: taking detour [vless_us_2] for [tcp:content-autofill.googleapis.com:443] 2021/08/01 16:07:29 [Info] [772050547] transport/internet/websocket: creating connection to tcp:www.digitalocean.com:443 2021/08/01 16:07:29 [Debug] transport/internet: dialing to tcp:www.digitalocean.com:443 2021/08/01 16:07:29 [Info] app/dns: returning 1 IPs for domain www.digitalocean.com 2021/08/01 16:07:29 [Info] transport/internet: replace destination with tcp:104.16.182.15:443 2021/08/01 16:07:29 [Debug] transport/internet/udp: UDP original destination: udp:192.168.1.1:53 2021/08/01 16:07:29 [Debug] transport/internet/udp: UDP original destination: udp:216.58.200.234:443 2021/08/01 16:07:29 [Debug] transport/internet/udp: UDP original destination: udp:192.168.1.1:53 2021/08/01 16:07:30 [Debug] transport/internet/udp: UDP original destination: udp:216.58.200.234:443 2021/08/01 16:07:30 [Debug] transport/internet/udp: UDP original destination: udp:223.5.5.5:53 2021/08/01 16:07:30 [Debug] transport/internet/udp: UDP original destination: udp:公网IP地址:43902 2021/08/01 16:07:30 [Debug] [1242270871] proxy/dokodemo: processing connection from: 223.5.5.5:53 2021/08/01 16:07:30 [Info] [1242270871] proxy/dokodemo: received request for 223.5.5.5:53 2021/08/01 16:07:30 [Info] [1242270871] app/proxyman/inbound: connection ends > fake: socket bind: address already in use 2021/08/01 16:07:30 [Info] [1242270871] app/dispatcher: default route for udp:公网IP地址:43902 2021/08/01 16:07:30 [Info] [1242270871] proxy/freedom: opening connection to udp:公网IP地址:43902 2021/08/01 16:07:30 [Debug] transport/internet: dialing to udp:公网IP地址:43902 2021/08/01 16:07:30 [Info] [772050547] proxy/vless/outbound: tunneling request to tcp:content-autofill.googleapis.com:443 via tcp:www.digitalocean.com:443 2021/08/01 16:07:31 [Debug] transport/internet/udp: UDP original destination: udp:216.58.200.234:443 2021/08/01 16:07:31 [Info] [3493052611] proxy/vless/outbound: tunneling request to tcp:www.youtube.com:443 via tcp:www.digitalocean.com:443 2021/08/01 16:07:31 [Debug] transport/internet/udp: UDP original destination: udp:114.114.114.114:53 2021/08/01 16:07:31 [Debug] transport/internet/udp: UDP original destination: udp:公网IP地址:43902 2021/08/01 16:07:31 [Debug] [3202085507] proxy/dokodemo: processing connection from: 114.114.114.114:53 2021/08/01 16:07:31 [Info] [3202085507] proxy/dokodemo: received request for 114.114.114.114:53 2021/08/01 16:07:31 [Info] [3202085507] app/proxyman/inbound: connection ends > fake: socket bind: address already in use 2021/08/01 16:07:31 [Info] [3202085507] app/dispatcher: default route for udp:公网IP地址:43902 2021/08/01 16:07:31 [Info] [3202085507] proxy/freedom: opening connection to udp:公网IP地址:43902 2021/08/01 16:07:31 [Debug] transport/internet: dialing to udp:公网IP地址:43902 2021/08/01 16:07:31 [Debug] transport/internet/udp: UDP original destination: udp:192.168.1.1:53 2021/08/01 16:07:32 [Debug] transport/internet/udp: UDP original destination: udp:192.168.1.1:53 2021/08/01 16:07:32 [Debug] [3353154132] proxy/dokodemo: processing connection from: 192.168.1.2:50334 2021/08/01 16:07:32 [Info] [3353154132] proxy/dokodemo: received request for 192.168.1.2:50334 2021/08/01 16:07:32 [Info] [3353154132] app/dispatcher: default route for udp:192.168.1.1:53 2021/08/01 16:07:32 [Info] [3353154132] proxy/freedom: opening connection to udp:192.168.1.1:53 2021/08/01 16:07:32 [Debug] transport/internet: dialing to udp:192.168.1.1:53 2021/08/01 16:07:32 [Info] app/dns: failed to lookup ip for domain ncsi.uu.netease.com at server UDP:8.8.8.8:53 > context deadline exceeded 2021/08/01 16:07:32 [Debug] app/dns: UDP:8.8.8.8:53 querying DNS for: ncsi.uu.netease.com. 2021/08/01 16:07:32 [Debug] transport/internet/udp: dispatch request to: udp:8.8.8.8:53 2021/08/01 16:07:32 [Info] transport/internet/udp: establishing new connection for udp:8.8.8.8:53 2021/08/01 16:07:32 [Debug] transport/internet/udp: dispatch request to: udp:8.8.8.8:53 2021/08/01 16:07:32 [Info] app/dispatcher: taking detour [dns_out] for [udp:8.8.8.8:53] 2021/08/01 16:07:32 [Info] proxy/dns: handling DNS traffic to udp:8.8.8.8:53 2021/08/01 16:07:32 [Debug] transport/internet: dialing to udp:8.8.8.8:53 2021/08/01 16:07:32 [Debug] transport/internet/udp: UDP original destination: udp:公网IP地址:56979 2021/08/01 16:07:32 [Debug] [2526282717] proxy/dokodemo: processing connection from: 8.8.8.8:53 2021/08/01 16:07:32 [Info] [2526282717] proxy/dokodemo: received request for 8.8.8.8:53 2021/08/01 16:07:32 [Info] [2526282717] app/proxyman/inbound: connection ends > fake: socket bind: address already in use 2021/08/01 16:07:32 [Info] [2526282717] app/dispatcher: default route for udp:公网IP地址:56979 2021/08/01 16:07:32 [Info] [2526282717] proxy/freedom: opening connection to udp:公网IP地址:56979 2021/08/01 16:07:32 [Debug] transport/internet: dialing to udp:公网IP地址:56979 2021/08/01 16:07:32 [Debug] transport/internet/udp: UDP original destination: udp:公网IP地址:56979 2021/08/01 16:07:32 [Debug] [514434495] proxy/dokodemo: processing connection from: 8.8.8.8:53 2021/08/01 16:07:32 [Info] [514434495] proxy/dokodemo: received request for 8.8.8.8:53 2021/08/01 16:07:32 [Info] [514434495] app/proxyman/inbound: connection ends > fake: socket bind: address already in use

kingwilliam commented 3 years ago

应该是 dead loop (无限循环), 通常出现在 dns.

看你的 config, router第一条是 dns-in -> dns-out 但 dns-out "domainStrategy": "UseIP" 又回到 dns-in

需然 router 第三条是 8.8.8.8 -> proxy, 但永远去不到

如想测试是否 router dns-in -> dns-out 出问题, 可先删除这行, 看看还有没有 address already in use

但 dns-out "domainStrategy" 好像放错位置

修改前:
    "outbounds": [
        {
            "tag": "direct",
            "protocol": "freedom",
            "settings": { "domainStrategy": "UseIP" },
            "streamSettings": { "sockopt": { "mark": 2 } }
        },
        {
            "tag": "dns_out",
            "protocol": "dns",
            "settings": { },
            "streamSettings": { "sockopt": { "mark": 2 , "domainStrategy": "UseIP" } }
        },
        .....
    ]

修改後:
    "outbounds": [
        {
            "tag": "direct",
            "protocol": "freedom",
            "settings": { "domainStrategy": "UseIP" },
            "streamSettings": { "sockopt": { "mark": 2 } }
        },
        {
            "tag": "dns_out",
            "protocol": "dns",
            "settings": { "domainStrategy": "UseIP" },
            "streamSettings": { "sockopt": { "mark": 2} }
        },
AlexAfterbeer commented 3 years ago

应该是 dead loop (无限循环), 通常出现在 dns.

看你的 config, router第一条是 dns-in -> dns-out 但 dns-out "domainStrategy": "UseIP" 又回到 dns-in

需然 router 第三条是 8.8.8.8 -> proxy, 但永远去不到

如想测试是否 router dns-in -> dns-out 出问题, 可先删除这行, 看看还有没有 address already in use

但 dns-out "domainStrategy" 好像放错位置

修改前:
  "outbounds": [
      {
          "tag": "direct",
          "protocol": "freedom",
          "settings": { "domainStrategy": "UseIP" },
          "streamSettings": { "sockopt": { "mark": 2 } }
      },
      {
          "tag": "dns_out",
          "protocol": "dns",
          "settings": { },
          "streamSettings": { "sockopt": { "mark": 2 , "domainStrategy": "UseIP" } }
      },
      .....
  ]

修改後:
  "outbounds": [
      {
          "tag": "direct",
          "protocol": "freedom",
          "settings": { "domainStrategy": "UseIP" },
          "streamSettings": { "sockopt": { "mark": 2 } }
      },
      {
          "tag": "dns_out",
          "protocol": "dns",
          "settings": { "domainStrategy": "UseIP" },
          "streamSettings": { "sockopt": { "mark": 2} }
      },

您好, 感谢你的回复, 这个dns_in > dns_out 确实是有问题 , 我按照您说的,把router的dns_in > dns_out删了, 又把dns_out的 domainStrategy也删了, 之后就正常跑起来了. 谢谢你

hmol233 commented 3 years ago

Assuming the problem has been solved.