SagerNet / sing-box

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

endpoints 工作异常 ERROR[0013] [1326223602 2ms] connection: open outbound connection: dial tcp 192.168.123.1:22: route ip+net : no such network interface #2319

Open dashiell-zhang opened 2 days ago

dashiell-zhang commented 2 days ago

Operating system

Windows

System version

windows 11

Installation type

Original sing-box Command Line

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

sing-box version 1.11.0-beta.1

Version

INFO[0000] network: updated default interface 以太网, index 18
INFO[0000] endpoint/wireguard[out-proxy]: started at wg0
ERROR[0000] endpoint/wireguard[out-proxy]: unable to update bind: listen udp6 :51590: An invalid argument was supplied.
ERROR[0000] endpoint/wireguard[out-proxy]: failed to read packet from tun device: invalid argument
INFO[0001] network: updated default interface 以太网, index 18
INFO[0003] inbound/tun[0]: started at tun0
INFO[0003] sing-box started (3.633s)
INFO[0003] [2309393784 0ms] inbound/tun[0]: inbound packet connection from 192.168.150.1:55146
INFO[0003] [2309393784 1ms] inbound/tun[0]: inbound packet connection to 192.168.150.2:53
INFO[0003] [2309393784 5ms] outbound/direct[out-direct]: outbound packet connection
INFO[0003] [694508728 0ms] inbound/tun[0]: inbound packet connection from 192.168.150.1:51179
INFO[0003] [694508728 0ms] inbound/tun[0]: inbound packet connection to 192.168.150.2:53
INFO[0003] [694508728 0ms] outbound/direct[out-direct]: outbound packet connection
INFO[0004] network: updated default interface 以太网, index 18
INFO[0005] [813533979 0ms] inbound/tun[0]: inbound packet connection from 192.168.150.1:59861
INFO[0005] [813533979 0ms] inbound/tun[0]: inbound packet connection to 192.168.150.2:53
INFO[0005] [813533979 0ms] outbound/direct[out-direct]: outbound packet connection
INFO[0009] network: updated default interface 以太网, index 18
INFO[0011] [1570441567 0ms] inbound/tun[0]: inbound connection from 192.168.150.1:56255
INFO[0011] [1570441567 0ms] inbound/tun[0]: inbound connection to 192.168.123.1:22
INFO[0011] [1570441567 0ms] endpoint/wireguard[out-proxy]: outbound connection to 192.168.123.1:22
ERROR[0011] [1570441567 3ms] connection: open outbound connection: dial tcp 192.168.123.1:22: route ip+net : no such network interface
INFO[0012] [1016965818 0ms] inbound/tun[0]: inbound connection from 192.168.150.1:56255
INFO[0012] [1016965818 0ms] inbound/tun[0]: inbound connection to 192.168.123.1:22
INFO[0012] [1016965818 0ms] endpoint/wireguard[out-proxy]: outbound connection to 192.168.123.1:22
ERROR[0012] [1016965818 3ms] connection: open outbound connection: dial tcp 192.168.123.1:22: route ip+net : no such network interface

Description

我有使用 sing-box 连接一个 wireguard ,之前使用的是 outbound wireguard 功能一切正常,切换到最新的 endpoints 之后无法正常工作

{
  "log": {
    "disabled": false,
    "level": "info"
  },
  "dns": {
    "servers": [
      {
        "address": "udp://223.6.6.6"
      }
    ]
  },
  "inbounds": [
    {
      "type": "tun",
      "address": [
        "192.168.150.1/30"
      ],
      "auto_route": true,
      "route_address": [
        "192.168.123.0/24"
      ],
      "route_exclude_address": [
        "172.18.4.132/32"
      ],
      "stack": "gvisor"
    }
  ],
  "endpoints": [
    {
      "type": "wireguard",
      "tag": "out-proxy",
      "system": true,
      "name": "wg0",
      "mtu": 1100,
      "address": [
        "192.168.123.5/32"
      ],
      "private_key": "xxxxx",
      "peers": [
        {
          "address": "172.18.4.132",
          "port": 15703,
          "public_key": "xxxxxxx",
          "allowed_ips": [
            "0.0.0.0/0"
          ],
          "persistent_keepalive_interval": 30,
          "reserved": [ 0, 0, 0 ]
        }
      ]
    }
  ],
  "outbounds": [
    {
      "type": "direct",
      "tag": "out-direct"
    }
  ],
  "route": {
    "rules": [
      {
        "type": "logical",
        "mode": "and",
        "rules": [
          {
            "ip_cidr": [
              "192.168.123.0/24"
            ]
          }
        ],
        "outbound": "out-proxy"
      }
    ],

    "auto_detect_interface": true
  }
}

上面的配置文件搭配 sing-box 11 是不正常的,下面的配置文件搭配 sing-box 10 是可以正常工作的


{
  "log": {
    "disabled": false,
    "level": "info"
  },
  "dns": {
    "servers": [
      {
        "address": "udp://223.6.6.6"
      }
    ]
  },
  "inbounds": [
    {
      "type": "tun",
      "address": [
        "192.168.150.1/30"
      ],
      "auto_route": true,
      "route_address": [
        "192.168.123.0/24"
      ],
      "route_exclude_address": [
        "172.18.4.132/32"
      ],
      "stack": "gvisor"
    }
  ],

  "outbounds": [
    {
      "type": "direct",
      "tag": "out-direct"
    },
    {
      "type": "wireguard",
      "tag": "out-proxy",
      "server": "172.18.4.132",
      "server_port": 15703,
      "local_address": [
        "192.168.123.5/32"
      ],
      "private_key": "xxxxxx",
      "peer_public_key": "xxxxxx"
    }
  ],
  "route": {
    "rules": [
      {
        "type": "logical",
        "mode": "and",
        "rules": [
          {
            "ip_cidr": [
              "192.168.123.0/24"
            ]
          }
        ],
        "outbound": "out-proxy"
      }
    ],

    "auto_detect_interface": true
  }
}

Reproduction

./sing-box.exe -c sing-box.json run

Logs

No response

Supporter

Integrity requirements

dashiell-zhang commented 2 days ago
ERROR[0000] endpoint/wireguard[out-proxy]: unable to update bind: listen udp6 :53766: An invalid argument was supplied.
ERROR[0000] endpoint/wireguard[out-proxy]: peer(Wptl…7wSw) - failed to send handshake initiation: address family not supported by protocol

启动的时候就会有这个两个错误 连接的时候会有

INFO[0011] [1570441567 0ms] endpoint/wireguard[out-proxy]: outbound connection to 192.168.123.1:22
ERROR[0011] [1570441567 3ms] connection: open outbound connection: dial tcp 192.168.123.1:22: route ip+net : no such network interface

这样一个错误