Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows使用wireguard endpoint出错 #2359

Open
4 of 5 tasks
izumi0004 opened this issue Dec 10, 2024 · 0 comments
Open
4 of 5 tasks

Windows使用wireguard endpoint出错 #2359

izumi0004 opened this issue Dec 10, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@izumi0004
Copy link

操作系统

Windows

系统版本

Windows 11 23H2 22631.4541

安装类型

sing-box 原始命令行程序

如果您使用图形客户端程序,请提供该程序版本。

No response

版本

sing-box version 1.11.0-beta.8

Environment: go1.23.3 windows/amd64
Tags: with_gvisor,with_quic,with_dhcp,with_wireguard,with_ech,with_utls,with_reality_server,with_acme,with_clash_api
Revision: 8a138e34ccac59295e90a3885e8225631aa26311
CGO: disabled

描述

配置wireguard endpoint后启动时报错,无论设置"system": true或false

重现方式

config.json

{
	"endpoints": [
        {
            "tag": "wireguard",
            "type": "wireguard",
            "system": true,
            "name": "wg",
            "mtu": 1408,
            "address": ["172.18.0.1/24"],
            "private_key": "wF3lI+nJtDQh97wAj/AQXwzatXLRBq/8KnAwpxVTd0g=",
            "listen_port": 51820,
            "peers": [
                {
                    "public_key": "fmSUnVC9yLRWwCK3UgoW3hDmxrvG9r2ot6sMBncIWGw=",
                    "allowed_ips": ["172.18.0.2/32"]
                }
            ],
            "workers": 4
        }
    ]
}

日志

INFO[0000] network: updated default interface WLAN, index 19
INFO[0000] endpoint/wireguard[wireguard]: started at wg
DEBUG[0000] endpoint/wireguard[wireguard]: uapi: updating private key
DEBUG[0000] endpoint/wireguard[wireguard]: uapi: updating listen port
DEBUG[0000] endpoint/wireguard[wireguard]: routine: decryption worker 3 - started
DEBUG[0000] endpoint/wireguard[wireguard]: routine: encryption worker 2 - started
DEBUG[0000] endpoint/wireguard[wireguard]: routine: decryption worker 1 - started
DEBUG[0000] endpoint/wireguard[wireguard]: routine: encryption worker 1 - started
DEBUG[0000] endpoint/wireguard[wireguard]: routine: handshake worker 1 - started
DEBUG[0000] endpoint/wireguard[wireguard]: routine: handshake worker 3 - started
DEBUG[0000] endpoint/wireguard[wireguard]: routine: decryption worker 2 - started
DEBUG[0000] endpoint/wireguard[wireguard]: routine: decryption worker 4 - started
DEBUG[0000] endpoint/wireguard[wireguard]: routine: tun reader - started
ERROR[0000] endpoint/wireguard[wireguard]: failed to read packet from tun device: invalid argument
DEBUG[0000] endpoint/wireguard[wireguard]: routine: event worker - started
DEBUG[0000] endpoint/wireguard[wireguard]: interface up requested
ERROR[0000] endpoint/wireguard[wireguard]: unable to update bind: listen udp6 :51820: SETSOCKOPT IP_MTU_DISCOVER IP_PMTUDISC_DO: An invalid argument was supplied.
DEBUG[0000] endpoint/wireguard[wireguard]: interface state was Down, requested Up, now Down
DEBUG[0000] endpoint/wireguard[wireguard]: routine: encryption worker 3 - started
DEBUG[0000] endpoint/wireguard[wireguard]: routine: handshake worker 4 - started
DEBUG[0000] endpoint/wireguard[wireguard]: routine: tun reader - stopped
DEBUG[0000] endpoint/wireguard[wireguard]: peer(fmSU…IWGw) - uapi: created
DEBUG[0000] endpoint/wireguard[wireguard]: peer(fmSU…IWGw) - uapi: adding allowedip
DEBUG[0000] endpoint/wireguard[wireguard]: routine: encryption worker 4 - started
DEBUG[0000] endpoint/wireguard[wireguard]: routine: handshake worker 2 - started
DEBUG[0000] endpoint/wireguard[wireguard]: device closing
DEBUG[0000] endpoint/wireguard[wireguard]: routine: event worker - stopped
INFO[0000] sing-box started (0.455s)
DEBUG[0000] endpoint/wireguard[wireguard]: device closed
DEBUG[0000] endpoint/wireguard[wireguard]: routine: handshake worker 1 - stopped
DEBUG[0000] endpoint/wireguard[wireguard]: routine: handshake worker 2 - stopped
DEBUG[0000] endpoint/wireguard[wireguard]: routine: handshake worker 4 - stopped
DEBUG[0000] endpoint/wireguard[wireguard]: routine: handshake worker 3 - stopped
DEBUG[0000] endpoint/wireguard[wireguard]: routine: encryption worker 4 - stopped
DEBUG[0000] endpoint/wireguard[wireguard]: routine: decryption worker 4 - stopped
DEBUG[0000] endpoint/wireguard[wireguard]: routine: decryption worker 1 - stopped
DEBUG[0000] endpoint/wireguard[wireguard]: routine: decryption worker 3 - stopped
DEBUG[0000] endpoint/wireguard[wireguard]: routine: encryption worker 2 - stopped
DEBUG[0000] endpoint/wireguard[wireguard]: routine: encryption worker 3 - stopped
DEBUG[0000] endpoint/wireguard[wireguard]: routine: encryption worker 1 - stopped
DEBUG[0000] endpoint/wireguard[wireguard]: routine: decryption worker 2 - stopped

设置"system": false时:
INFO[0000] network: updated default interface WLAN, index 19
DEBUG[0000] endpoint/wireguard[wireguard]: uapi: updating private key
DEBUG[0000] endpoint/wireguard[wireguard]: routine: decryption worker 2 - started
DEBUG[0000] endpoint/wireguard[wireguard]: routine: encryption worker 1 - started
DEBUG[0000] endpoint/wireguard[wireguard]: routine: encryption worker 2 - started
DEBUG[0000] endpoint/wireguard[wireguard]: routine: decryption worker 1 - started
DEBUG[0000] endpoint/wireguard[wireguard]: routine: handshake worker 3 - started
DEBUG[0000] endpoint/wireguard[wireguard]: routine: handshake worker 2 - started
DEBUG[0000] endpoint/wireguard[wireguard]: routine: encryption worker 3 - started
DEBUG[0000] endpoint/wireguard[wireguard]: routine: decryption worker 3 - started
DEBUG[0000] endpoint/wireguard[wireguard]: routine: decryption worker 4 - started
DEBUG[0000] endpoint/wireguard[wireguard]: routine: encryption worker 4 - started
DEBUG[0000] endpoint/wireguard[wireguard]: routine: handshake worker 4 - started
DEBUG[0000] endpoint/wireguard[wireguard]: routine: tun reader - started
DEBUG[0000] endpoint/wireguard[wireguard]: routine: event worker - started
DEBUG[0000] endpoint/wireguard[wireguard]: interface up requested
DEBUG[0000] endpoint/wireguard[wireguard]: uapi: updating listen port
DEBUG[0000] endpoint/wireguard[wireguard]: routine: handshake worker 1 - started
ERROR[0000] endpoint/wireguard[wireguard]: unable to update bind: listen udp6 :65080: SETSOCKOPT IP_MTU_DISCOVER IP_PMTUDISC_DO: An invalid argument was supplied.
DEBUG[0000] endpoint/wireguard[wireguard]: interface state was Down, requested Up, now Down
ERROR[0000] endpoint/wireguard[wireguard]: IPC error -98: failed to set listen_port: listen udp6 :51820: SETSOCKOPT IP_MTU_DISCOVER IP_PMTUDISC_DO: An invalid argument was supplied.
FATAL[0000] start service: start outbound/wireguard[wireguard]: setup wireguard:
private_key=c05de523e9c9b43421f7bc008ff0105f0cdab572d106affc2a7030a715537748
listen_port=51820
public_key=7e64949d50bdc8b456c022b7520a16de10e6c6bbc6f6bda8b7ab0c067708586c
allowed_ip=172.18.0.2/32: IPC error -98: failed to set listen_port: listen udp6 :51820: SETSOCKOPT IP_MTU_DISCOVER IP_PMTUDISC_DO: An invalid argument was supplied.

支持我们

完整性要求

  • 我保证阅读了文档,了解所有我编写的配置文件项的含义,而不是大量堆砌看似有用的选项或默认值。
  • 我保证提供了可以在本地重现该问题的服务器、客户端配置文件与流程,而不是一个脱敏的复杂客户端配置文件。
  • 我保证提供了可用于重现我报告的错误的最简配置,而不是依赖远程服务器、TUN、图形界面客户端或者其他闭源软件。
  • 我保证提供了完整的配置文件与日志,而不是出于对自身智力的自信而仅提供了部分认为有用的部分。
@nekohasekai nekohasekai added the bug Something isn't working label Dec 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants