Comments (12)
首先 第二个outbound就算是炸了 也不会用第一个outbound 不知道你说的 “设定一个无效的outbound在第一行” 是干啥
其次 策略路由应该是不会回落的 有的话也是路由的问题不是core的问题
from xray-core.
我用一份配置解释清楚一点
{
"inbounds": [
{ "port": 9295, "protocol": "vless", "settings": { "decryption": "none",
"clients": [
{ "id": "id01", "flow": "xtls-rprx-vision", "email": "id01" },
{ "id": "id02", "flow": "xtls-rprx-vision", "email": "id02" },
{ "id": "id03", "flow": "xtls-rprx-vision", "email": "id03" },
] },
"streamSettings": { "network": "tcp", "security": "reality",
"realitySettings": { "show": false, "dest": "www.xxx.com:443", "xver": 0,
"serverNames": [ "www.xxx.com" ],
"privateKey": "customkey",
"shortIds": [ "a1", "a2", "a3" ]
} }
}
],
"outbounds": [
{ "protocol": "shadowsocks", "tag": "ss3", "settings": { "servers": [ { "address": "server3", "port": 3333, "method": "chacha20-poly1305", "password": "3333" } ] } },
{ "protocol": "shadowsocks", "tag": "ss1", "settings": { "servers": [ { "address": "server1", "port": 1111, "method": "chacha20-poly1305", "password": "1111" } ] } },
{ "protocol": "shadowsocks", "tag": "ss2", "settings": { "servers": [ { "address": "Mserver2", "port": 2222, "method": "chacha20-poly1305", "password": "2222" } ] } },
],
"routing": {
"domainStrategy": "IPOnDemand",
"strategy": "rules",
"rules": [
{ "type": "field", "user": [ "id01" ] , "outboundTag": "ss1" },
{ "type": "field", "user": [ "id02" ] , "outboundTag": "ss2" },
]
}
}
以上配置是不是id01会走ss1出口,id02走ss2出口,id03没标记路由规则 ,走默认第一行ss3出口。就算ss1,ss2出口挂了, id01和id02并不会走freedom,而是直接断网
假如我将配置改为下面的样子
{
"inbounds": [
{ "port": 9295, "protocol": "vless", "settings": { "decryption": "none",
"clients": [
{ "id": "id01", "flow": "xtls-rprx-vision", "email": "id01" },
{ "id": "id02", "flow": "xtls-rprx-vision", "email": "id02" },
{ "id": "id03", "flow": "xtls-rprx-vision", "email": "id03" },
] },
"streamSettings": { "network": "tcp", "security": "reality",
"realitySettings": { "show": false, "dest": "www.xxx.com:443", "xver": 0,
"serverNames": [ "www.xxx.com" ],
"privateKey": "customkey",
"shortIds": [ "a1", "a2", "a3" ]
} }
}
],
"outbounds": [
{ "protocol": "shadowsocks", "tag": "ss3", "settings": { "servers": [ { "address": "server3", "port": 3333, "method": "chacha20-poly1305", "password": "3333" } ] } }, //一个虚构的ss节点,为了让没指定路由规则的ID断网
{ "protocol": "freedom", "settings": { "domainStrategy": "UseIP" }, "streamSettings": { "sockopt": { "mark": 1001 } }, "tag": "ss1" },
{ "protocol": "freedom", "settings": { "domainStrategy": "UseIP" }, "streamSettings": { "sockopt": { "mark": 1002 } }, "tag": "ss2" },
],
"routing": {
"domainStrategy": "IPOnDemand",
"strategy": "rules",
"rules": [
{ "type": "field", "user": [ "id01" ] , "outboundTag": "ss1" },
{ "type": "field", "user": [ "id02" ] , "outboundTag": "ss2" },
]
}
}
这时理论上应该是id01走ss1, id02走ss2, id03走ss3,
但当我的pptp连接断开后,ss1和ss2出口不存在了,理应id01和id02会走ss3,直接断网才对。 我现在的结果是id01和id02在没有ss1和ss2出口后,不会走ss3出口,而是走了系统自身网卡出口。会变成有网络连接,返回的是vps自身的IP。
from xray-core.
xray内部没有失效这个概念 哪怕你配置文件写个错的如果没panic它也只是会连不上一直报错而已 你取的sss123只是出站的名字而已 为什么你就是觉得网卡掉线出站会消失。。。
麻烦你看清楚,我哪里说出口消失了呢?我只是说出口失效。消失的是网卡。ppp0和ppp1。
你搞不懂我在问什么的话,你可以不回答的。上面的那位xqzr就能理解我的意思,人家选择不回答。 你连理解都理解不了就一直在这里乱说一通。有意思吗?
凡是好好看一下上面两个配置都知道我要表达的是什么。
from xray-core.
失效了也一样啊 网卡掉了 出站在那还是走那两个出站 为什么
理应id01和id02会走ss3
到底谁在乱说一通啊。。。
from xray-core.
无效我用ip rule分流,还是用interface分流,在断开pptp连接后都无法走第一个outbound
from xray-core.
这是core的设计 在尝试bind到指定device失败后走系统默认 对于网卡可能掉线这样的复杂情况 建议设置mark然后使用策略路由指定网卡
from xray-core.
我一开始是用mark来指定的。掉线后也是会返回默认网卡的。不会返回到我指定的第一个outbound.
from xray-core.
你那个pptp掉线之后 ss1和ss2怎么可能消失 你为什么觉得它们会消失。。它们还是在的 会按照设置打上mark 再往后怎么走就是你自己路由的问题了
按照之前的interface的写法 情况和我说的一样 xray会尝试bind至指定interface 失败后在日志输出(然后你没填日志) 但是不会断开连接 会走默认
from xray-core.
你那个pptp掉线之后 ss1和ss2怎么可能消失 。。它们还是在的 会按照设置打上mark 再往后怎么走就是你自己路由的问题了 按照之前的interface的写法 情况和我说的一样 xray会尝试bind至指定interface 失败后在日志输出(然后你没填日志) 但是不会断开连接 会走默认
他说的 “消失” 应该是指 不可用
from xray-core.
你那个pptp掉线之后 ss1和ss2怎么可能消失 你为什么觉得它们会消失。。它们还是在的 会按照设置打上mark 再往后怎么走就是你自己路由的问题了 按照之前的interface的写法 情况和我说的一样 xray会尝试bind至指定interface 失败后在日志输出(然后你没填日志) 但是不会断开连接 会走默认
ss1就是ppp0网卡(pptp拨出来的) , ss2就是ppp1网卡 (pptp拨出来的)
当pptp意外断开后,这两个网卡就会消失。 就代表上面设置的ss1和ss2出口失效。。理论上所有Id会走s3(第一个默认outbound)
但实际运行的结果并不会。只会走系统eth0网卡
from xray-core.
xray内部没有失效这个概念 哪怕你配置文件写个错的如果没panic它也只是会连不上一直报错而已 你取的sss123只是出站的名字而已 为什么你就是觉得网卡掉线出站会消失。。。
from xray-core.
需求,预期行为,最简可复现配置,日志。是真的一个都没
from xray-core.
Related Issues (20)
- 在最新版本V1.8.11内使用wireguard出口导致xray崩溃 HOT 1
- 1.8.12 docker模式下kernelMode": false, wireguard出站错误 HOT 2
- Wireguard panic: runtime error: index out of range [-1] HOT 7
- Connecting to the server inbounds through multiple domains HOT 5
- Suggestion: flag to disable logging in a separate inbound/outbound. HOT 1
- 编译xray-core时出现错误:gvisortun/tun.go中 'pkt.IsNil undefined' 的问题 HOT 1
- stop xray core in wiregourd HOT 3
- Wireguard Inbound Panic when connecting via WiresockUI client HOT 2
- API: Stats of the user remains when the user got deleted through API HOT 9
- 获取ipv6地址失败后产生DNS泄露 HOT 4
- block specific users country HOT 2
- Bump up gvisor dependencies HOT 1
- Weird behaviour of reverse proxy HOT 3
- [Feature Request] Changing the order of ping checks when "enableConcurrency": false HOT 1
- maxTimeDiff for VMESS HOT 16
- [Feature Request] https h2 proxy HOT 16
- The filtering of the Reality protocol within an hour in version v1.8.13 in Iran by the Iranian firewall HOT 7
- Compatibility Issue with WireGuard for Streaming Services HOT 4
- Is now any available package for building IOS and Android client in Flutter or React Native HOT 1
- 2022 edition shadowsocks methods don't work for `clients` HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from xray-core.