SagerNet / sing-box

The universal proxy platform
https://sing-box.sagernet.org/
Other
18.25k stars 2.18k forks source link

inbound TUN protocol not available #1333

Closed adiprasetya closed 7 months ago

adiprasetya commented 8 months ago

Operating system

Android

System version

11.0

Installation type

Original sing-box Command Line

If you are using a graphical client, please provide the version of the client.

No response

Version

sing-box version 1.8.0

Environment: go1.21.5 android/arm64
Tags: with_gvisor,with_quic,with_dhcp,with_wireguard,with_ech,with_utls,with_reality_server,with_acme,with_clash_api
Revision: 11bec79a06268f00e7c5a7d5509245855d6dd522
CGO: enabled

Description

since updating it to version 1.8.0 i got this error. version 1.7.8 working normally no problem. and SFA version 1.8.0 no issue.

Reproduction

updating it through termux repo, or using prebuild on git release.

config.json

{
  "log": {
    "level": "error",
    "timestamp": true
  },
  "dns": {
    "servers": [
      {
        "tag": "default",
        "address": "1.1.1.1",
        "detour": "PROXY"
      }
    ],
    "final": "default",
    "strategy": "ipv4_only"
  },
  "inbounds": [
    {
      "type": "tun",
      "interface_name": "tun0",
      "mtu": 9000,
      "inet4_address": "172.19.0.1/30",
      "auto_route": true,
      "inet4_route_address": [
        "0.0.0.0/1",
        "128.0.0.0/1"
      ],
      "stack": "system",
      "inet4_route_exclude_address": "192.168.0.0/16",
      "sniff": true,
      "domain_strategy": "ipv4_only"
    }
  ],
  "outbounds": [
    {
      "type": "selector",
      "tag": "PROXY",
      "outbounds": [
        "HTTPUpgrade",
        "Websocket"
      ]
    },
    {
      "type": "dns",
      "tag": "DNS"
    },
    {
      "type": "trojan",
      "tag": "Websocket",
      "connect_timeout": "3s",
      "server": "104.18.225.52",
      "server_port": 443,
      "password": "password",
      "tls": {
        "enabled": true,
        "server_name": "cdn-server.net",
        "utls": {
          "enabled": true
        }
      },
      "transport": {
        "type": "ws",
        "path": "/trojan",
        "headers": {
          "Host": "cdn-server.net"
        },
        "max_early_data": 2048,
        "early_data_header_name": "Sec-WebSocket-Protocol"
      }
    },
    {
      "type": "vless",
      "tag": "HTTPUpgrade",
      "connect_timeout": "3s",
      "server": "104.18.225.52",
      "server_port": 443,
      "uuid": "password",
      "tls": {
        "enabled": true,
        "server_name": "cdn-server.net",
        "utls": {
          "enabled": true
        }
      },
      "transport": {
        "type": "httpupgrade",
        "path": "/vless",
        "headers": {
          "Host": "cdn-server.net"
        }
      }
    }
  ],
  "route": {
    "rules": [
      {
        "protocol": "dns",
        "outbound": "DNS"
      },
    ],
    "final": "PROXY",
    "auto_detect_interface": true
  },
  "experimental": {
    "cache_file": {
      "enabled": true
    },
    "clash_api": {
      "external_controller": "0.0.0.0:9090",
      "external_ui": "dashboard",
      "external_ui_download_detour": "PROXY",
      "secret": "secret",
      "default_mode": "rule"
    }
  }
}

NB: "stack": "gvisor" same results.

Logs

+0000 2024-01-07 05:06:52 ERROR dns: exchange failed for mozilla.cloudflare-dns.com. IN A: dial tcp 104.18.225.52:443: protocol not available
+0000 2024-01-07 05:06:57 ERROR dns: exchange failed for mozilla.cloudflare-dns.com. IN A: dial tcp 104.18.225.52:443: protocol not available
+0000 2024-01-07 05:06:59 ERROR [1007683565 301ms] inbound/tun[0]: dial tcp 104.18.225.52:443: protocol not available
+0000 2024-01-07 05:07:00 ERROR [2911711018 301ms] inbound/tun[0]: dial tcp 104.18.225.52:443: protocol not available
+0000 2024-01-07 05:07:00 ERROR dns: exchange failed for g.whatsapp.net. IN A: dial tcp 104.18.225.52:443: protocol not available
+0000 2024-01-07 05:07:01 ERROR [166881842 301ms] inbound/tun[0]: dial tcp 104.18.225.52:443: protocol not available
+0000 2024-01-07 05:07:02 ERROR [2655158527 300ms] inbound/tun[0]: dial tcp 104.18.225.52:443: protocol not available
+0000 2024-01-07 05:07:02 ERROR dns: exchange failed for mozilla.cloudflare-dns.com. IN A: dial tcp 104.18.225.52:443: protocol not available
+0000 2024-01-07 05:07:02 ERROR [1424094908 301ms] inbound/tun[0]: dial tcp 104.18.225.52:443: protocol not available
+0000 2024-01-07 05:07:03 ERROR [2340929877 301ms] inbound/tun[0]: dial tcp 104.18.225.52:443: protocol not available
+0000 2024-01-07 05:07:04 ERROR [1001644763 301ms] inbound/tun[0]: dial tcp 104.18.225.52:443: protocol not available
+0000 2024-01-07 05:07:04 ERROR [3760477092 301ms] inbound/tun[0]: dial tcp 104.18.225.52:443: protocol not available
+0000 2024-01-07 05:07:05 ERROR [2428410374 301ms] inbound/tun[0]: dial tcp 104.18.225.52:443: protocol not available
+0000 2024-01-07 05:07:05 ERROR dns: exchange failed for g.whatsapp.net. IN A: dial tcp 104.18.225.52:443: protocol not available
+0000 2024-01-07 05:07:06 ERROR [3090417551 300ms] inbound/tun[0]: dial tcp 104.18.225.52:443: protocol not available
+0000 2024-01-07 05:07:07 ERROR [1458008489 300ms] inbound/tun[0]: dial tcp 104.18.225.52:443: protocol not available
+0000 2024-01-07 05:07:07 ERROR dns: exchange failed for mozilla.cloudflare-dns.com. IN A: dial tcp 104.18.225.52:443: protocol not available
+0000 2024-01-07 05:07:07 ERROR [876462427 301ms] inbound/tun[0]: dial tcp 104.18.225.52:443: protocol not available
+0000 2024-01-07 05:07:08 ERROR [1318850012 301ms] inbound/tun[0]: dial tcp 104.18.225.52:443: protocol not available
+0000 2024-01-07 05:07:09 ERROR [4205483517 301ms] inbound/tun[0]: dial tcp 104.18.225.52:443: protocol not available

Integrity requirements

juewuy commented 8 months ago

I have the same problem with 1.8.0 on OpenWrt,also it works well on 1.7.8! But,it also works well with 1.8.0 on Ubuntu-Wsl2 +0800 2024-01-10 10:46:32 INFO router: updated default interface pppoe-wan, index 16 +0800 2024-01-10 10:46:32 INFO router: loaded geoip database: 1 codes +0800 2024-01-10 10:46:32 INFO router: loaded geosite database: 2 codes +0800 2024-01-10 10:46:33 INFO outbound/direct[DIRECT]: outbound packet connection to ntp1.aliyun.com:123 +0800 2024-01-10 10:46:33 INFO outbound/direct[DIRECT]: outbound packet connection to 223.5.5.5:53 +0800 2024-01-10 10:46:33 INFO outbound/direct[DIRECT]: outbound packet connection to 223.5.5.5:53 +0800 2024-01-10 10:46:33 INFO outbound/direct[DIRECT]: outbound packet connection to 223.5.5.5:53 +0800 2024-01-10 10:46:33 INFO outbound/direct[DIRECT]: outbound packet connection to 223.5.5.5:53 +0800 2024-01-10 10:46:33 INFO outbound/direct[DIRECT]: outbound packet connection to 223.5.5.5:53 +0800 2024-01-10 10:46:33 INFO outbound/direct[DIRECT]: outbound packet connection to 223.5.5.5:53 FATAL[0000] start service: initialize time service: initialize time: exchange6: dial udp 223.5.5.5:53: protocol not available | exchange4: dial udp 223.5.5.5:53: protocol not available

dyhkwong commented 8 months ago

Please provide minimal and the simplest configuration to locally reproduce.

adiprasetya commented 8 months ago

Please provide minimal and the simplest configuration to locally reproduce.

simplest configuration that i can do. same results.

{
  "log": {
    "level": "error",
    "timestamp": true
  },
  "dns": {
    "servers": [
      {
        "tag": "default",
        "address": "1.1.1.1",
        "detour": "proxy"
      }
    ]
  },
  "inbounds": [
    {
      "type": "tun",
      "inet4_address": "172.19.0.1/30",
      "auto_route": true,
      "stack": "system",
      "sniff": true
    }
  ],
  "outbounds": [
    {
      "type": "dns",
      "tag": "dns"
    },
    {
      "type": "vless",
      "tag": "proxy",
      "connect_timeout": "3s",
      "server": "104.18.225.52",
      "server_port": 443,
      "uuid": "password",
      "tls": {
        "enabled": true,
        "server_name": "cdn-server.net",
        "utls": {
          "enabled": true
        }
      },
      "transport": {
        "type": "httpupgrade",
        "path": "/vless",
        "headers": {
          "Host": "cdn-server.net"
        }
      }
    }
  ],
  "route": {
    "rules": [
      {
        "protocol": "dns",
        "outbound": "dns"
      }
    ],
    "final": "proxy",
    "auto_detect_interface": true
  }
}
npwc commented 8 months ago

@adiprasetya your domain does not appear to be added to CloudFlare's DNS record.

adiprasetya commented 8 months ago

@npwc did you mean cdn-server.net? it is not my actually domain, it's just to censor it.

before using v1.8.0 it is working fine.

juewuy commented 7 months ago

Set '"auto_detect_interface": false' ,then problem solved . But , I don't know why.... ‘’updated default interface pppoe-wan, index 13” ,it works on 1.7.8 but not works on 1.8.0