Xray-core
Xray-core copied to clipboard
服务端outbounds存在两个wireguard出站时,只有先使用的wireguard出站能够正常连接
版本 1.8.6
服务端配置中有两个wireguard出站(以下简称wg),路由配置为访问eu网站时,使用tag为eu的wg出站,访问us网站时,使用tag为us的wg出站
两个wg出站都是可用的,但是如果客户端先访问了eu网站,会导致us网站无法访问,重启服务端后,如果先访问us网站,就会反过来导致eu网站无法访问
题外话:我知道tls套tls现在不安全,但是我的使用场景特殊
{
"inbounds": [
{
"port": 443,
"protocol": "vless",
"settings": {
"clients": [
{
"id": "null"
}
],
"decryption": "none"
},
"streamSettings": {
"network": "tcp",
"security": "tls",
"tlsSettings": {
"certificates": [
{
"certificateFile": "null",
"keyFile": "null"
}
]
}
}
}
],
"routing": {
"rules": [
{
"type": "field",
"domain": [
"domain:site.eu"
],
"outboundTag": "eu"
},
{
"type": "field",
"domain": [
"domain:site.us"
],
"outboundTag": "us"
}
]
},
"outbounds": [
{
"protocol": "freedom"
},
{
"protocol": "wireguard",
"tag": "eu",
"settings": {
"secretKey": "null",
"peers": [
{
"publicKey": "null",
"endpoint": "null"
}
]
}
},
{
"protocol": "wireguard",
"tag": "us",
"settings": {
"secretKey": "null",
"peers": [
{
"publicKey": "null",
"endpoint": "null"
}
]
}
}
]
}
在两个wg出站里配置里都加上"kernelMode": false 再试试看
在两个wg出站里配置里都加上"kernelMode": false 再试试看
已测试,不行
不太懂golang,我猜测是wireguard需要创建虚拟网卡,但xray只能创建一张。 https://github.com/XTLS/Xray-core/blob/38b175d53e9043aa4fcda8fef9263d9ec313fbc1/proxy/wireguard/gvisortun/tun.go#L54
在en切换到us时,服务器有这么一行日志吗?
CreateNIC: duplicate nic id
试下把服务器的配置文件拆分成两个,比如一个vless(443)->wireguard(en),另一个vless(444)->wireguard(us),然后开两个xray-core看能不能通过不同端口访问en和us?
@yomnxkcs 回答问题1:没有此日志 回答问题2:已测试,不能