SagerNet / v2ray-core

A platform for building proxies to bypass network restrictions (for SagerNet :)
Other
230 stars 29 forks source link

WireGuard work? #5

Closed plusls closed 2 years ago

plusls commented 2 years ago

尝试性的写了一个配置

            "protocol": "wireguard",
            "settings": {
                "address": "xxxxx",
                "localAddresses": [
                    "192.168.36.2"
                ],
                "mtu": 1420,
                "peerPublicKey": "aaaaaa=",
                "port": 4444,
                "preSharedKey": "aaa+jdJiE=",
                "privateKey": "aaa="
            },
            "streamSettings": {
                "sockopt": {
                    "mark": 255
                }
            },
        }

但是在服务器的 udp 4444 端口并不能接收到 v2ray 的流量

plusls commented 2 years ago

而且如果我 address 填写一个域名,最后它的 ip 变成了 1.0.0.1

endpoint=1.0.0.1:4444
nekohasekai commented 2 years ago

尝试添加 "network": "udp" (settings)

nekohasekai commented 2 years ago

而且如果我 address 填写一个域名,最后它的 ip 变成了 1.0.0.1

endpoint=1.0.0.1:4444

用于占位。

plusls commented 2 years ago

用于占位。

还是一样,收不到数据

注:

在服务的使用 nc 来判断是否能收到数据,直接 nc 服务器是可以看到链接成功的,已经排除掉服务器本身接不到 udp 数据的可能性

nekohasekai commented 2 years ago

日志

plusls commented 2 years ago

在本地测了也是一样,nc拿不到数据

            "protocol": "wireguard",
            "settings": {
                "address": "127.0.0.1",
                "localAddresses": [
                    "192.168.36.2"
                ],
                "mtu": 1420,
                "peerPublicKey": "=",
                "port": 4444,
                "preSharedKey": "=",
                "privateKey": "=",
                "network": "udp"
            },

image

plusls commented 2 years ago

日志 md 刚说完就有数据了 闹鬼了

plusls commented 2 years ago

尝试添加 "network": "udp" (settings)

测了一下,是我自己配的有问题,不应该设置 Pre shared key

顺便,这个 network 的选项有相关文档么

nekohasekai commented 2 years ago

遗留问题,只填 udp。(以前实验留下的,后续会删除

plusls commented 2 years ago

遗留问题,只填 udp。(以前实验留下的,后续会删除

实际使用中没填写 network 也可以正常使用,如果不需要的话那我 qv2ray 插件就不写了