You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What's your expectation?
: client with certain UUID defined with certain mark in outbound rules to be marked correctly regardless of definition position in outbound rules.
Please attach your configuration file.
Server config: (here, if I switch around the positions of the outbound rules, whichever rule is at the top gets applied while the other is ignored regardless of which UUID i use on the client side).
{
"log": {
"access": "/var/log/v2ray/access.log",
"error": "/var/log/v2ray/error.log",
"loglevel": "debug"
},
"inbounds": [
{
"tag": "vmess-in",
"port": 31352,
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "6be3e1b2-05e1-46a1-ad36-70aaabaa8d12"
},
{
"id": "0d425c79-025c-4604-8536-a4d29f0026eb"
}
]
},
"streamSettings":{
"sockopt": {
"mptcp": true
}
}
}
],
"routing": {
"domainStrategy": "IPifNonMatch",
"rules": [
{
"type": "field",
"inboundTag": ["vmess-in"],
"user": ["0d425c79-025c-4604-8536-a4d29f0026eb"],
"outboundTag": "client2-out"
},
{
"type": "field",
"inboundTag": ["vmess-in"],
"user": ["6be3e1b2-05e1-46a1-ad36-70aaabaa8d12"],
"outboundTag": "client1-out"
}
]
},
"outbounds": [
{
"tag": "client2-out",
"protocol": "freedom",
"settings": {},
"streamSettings": {
"sockopt": {
"mark": 101,
"mptcp": true,
"tcpFastOpen": true,
"transparent": true
}
}
},
{
"tag": "client1-out",
"protocol": "freedom",
"settings": {},
"streamSettings": {
"sockopt": {
"mark": 102,
"mptcp": true,
"tcpFastOpen": true,
"transparent": true
}
}
},
{
"tag": "direct",
"protocol": "freedom",
"settings": {}
}
]
}
What version of V2Ray are you using?
: V2Ray 5.17.1 (V2Fly, a community-driven edition of V2Ray.) Custom (go1.22.6 linux/amd64)
What's your scenario of using V2Ray?.
: to proxy mptcp streams from client to server.
What did you see?
: traffic marking is only being applied to the first defined outbound rule. Verified by adding these logging rules for traffic:
sudo iptables -t mangle -I OUTPUT 1 -m mark --mark 0x66 -j LOG --log-prefix "V2RAY_MARK_102: "
sudo iptables -t mangle -I OUTPUT 1 -m mark --mark 0x65 -j LOG --log-prefix "V2RAY_MARK_101: "
which for example results in:
Dec 2 10:04:31 mptcp001 kernel: [1022775.854596] V2RAY_MARK_101: IN= OUT=eth0 SRC=xxxxxx DST=xxxxxx LEN=61 TOS=0x00 PREC=0x00 TTL=64 ID=58153 DF PROTO=UDP SPT=36150 DPT=443 LEN=41 MARK=0x65
What's your expectation?
: client with certain UUID defined with certain mark in outbound rules to be marked correctly regardless of definition position in outbound rules.
Please attach your configuration file.
Server config: (here, if I switch around the positions of the outbound rules, whichever rule is at the top gets applied while the other is ignored regardless of which UUID i use on the client side).
{
"log": {
"access": "/var/log/v2ray/access.log",
"error": "/var/log/v2ray/error.log",
"loglevel": "debug"
},
"inbounds": [
{
"tag": "vmess-in",
"port": 31352,
"protocol": "vmess",
"settings": {
"clients": [
{
"id": "6be3e1b2-05e1-46a1-ad36-70aaabaa8d12"
},
{
"id": "0d425c79-025c-4604-8536-a4d29f0026eb"
}
]
},
"streamSettings":{
"sockopt": {
"mptcp": true
}
}
}
],
"routing": {
"domainStrategy": "IPifNonMatch",
"rules": [
{
"type": "field",
"inboundTag": ["vmess-in"],
"user": ["0d425c79-025c-4604-8536-a4d29f0026eb"],
"outboundTag": "client2-out"
},
{
"type": "field",
"inboundTag": ["vmess-in"],
"user": ["6be3e1b2-05e1-46a1-ad36-70aaabaa8d12"],
"outboundTag": "client1-out"
}
]
},
"outbounds": [
{
"tag": "client2-out",
"protocol": "freedom",
"settings": {},
"streamSettings": {
"sockopt": {
"mark": 101,
"mptcp": true,
"tcpFastOpen": true,
"transparent": true
}
}
},
{
"tag": "client1-out",
"protocol": "freedom",
"settings": {},
"streamSettings": {
"sockopt": {
"mark": 102,
"mptcp": true,
"tcpFastOpen": true,
"transparent": true
}
}
},
{
"tag": "direct",
"protocol": "freedom",
"settings": {}
}
]
}
Client config:
{
"inbounds": [
{
"port": 12345,
"listen": "127.0.0.1",
"protocol": "dokodemo-door",
"settings": {
"network": "tcp,udp",
"followRedirect": true
},
"streamSettings": {
"sockopt": {
"tproxy": "tproxy"
}
}
}
],
"outbounds": [
{
"protocol": "vmess",
"settings": {
"vnext": [
{
"address": "xxxxxxxx",
"port": 31352,
"users": [
{
"id": "0d425c79-025c-4604-8536-a4d29f0026eb", // tested with both UUIDS current server config applies mark 101 regardless of UUID
"security": "zero"
}
]
}
]
},
"streamSettings": {
"sockopt": {
"mark": 2,
"mptcp": true
}
}
}
]
}
No errors
Please attach access log. Access log is usually at '/var/log/v2ray/access.log' on Linux.
with client2-out (mark 101) as the first outbound rule:
2024/12/02 10:02:52 xxxxx:7006 accepted tcp:xxxxx:443 [client2-out]
2024/12/02 10:02:52 xxxxx:7007 accepted tcp:xxxxx:443 [client2-out]
2024/12/02 10:02:52 xxxxx:7690 accepted tcp:xxxxx:443 [client2-out]
2024/12/02 10:02:52 xxxxx:7691 accepted tcp:xxxxx:443 [client2-out]
with client1-out (mark 102) as the first outbound rule:
2024/12/02 10:01:38 xxxxx:6994 accepted tcp:xxxxx:443 [client1-out]
2024/12/02 10:01:50 xxxxx:6995 accepted tcp:xxxxx:443 [client1-out]
2024/12/02 10:01:56 xxxxx:6996 accepted udp:xxxxx:443 [client1-out]
2024/12/02 10:02:01 xxxxx:6997 accepted tcp:xxxxx:443 [client1-out]
note these results dont change based on client UUID in use, it changes based on outbound rule position in the server config file.
The text was updated successfully, but these errors were encountered: