modules.services.nginx/xray: fix routing policy rule priority

This commit is contained in:
2025-11-12 12:21:33 +08:00
parent bef15a718b
commit db157e35d9
2 changed files with 6 additions and 6 deletions

View File

@@ -47,12 +47,12 @@ inputs:
ip = "${inputs.pkgs.iproute2}/bin/ip";
start = inputs.pkgs.writeShellScript "nginx-proxy.start"
''
${ip} rule add fwmark 2/2 table 200
${ip} rule add fwmark 2/2 table 200 priority 5001
${ip} route add local 0.0.0.0/0 dev lo table 200
'';
stop = inputs.pkgs.writeShellScript "nginx-proxy.stop"
''
${ip} rule del fwmark 2/2 table 200
${ip} rule del fwmark 2/2 table 200 priority 5001
${ip} route del local 0.0.0.0/0 dev lo table 200
'';
in
@@ -76,7 +76,7 @@ inputs:
{
matchConfig.Name = "lo";
routes = [{ Table = 200; Destination = "0.0.0.0/0"; Type = "local"; }];
routingPolicyRules = [{ FirewallMark = "2/2"; Table = 200; }];
routingPolicyRules = [{ FirewallMark = "2/2"; Table = 200; Priority = 5001; }];
};
};
};

View File

@@ -226,12 +226,12 @@ inputs:
RemainAfterExit = true;
ExecStart = inputs.pkgs.writeShellScript "v2ray-forwarder.start"
''
${ip} rule add fwmark 1/1 table 100
${ip} rule add fwmark 1/1 table 100 priority 5000
${ip} route add local 0.0.0.0/0 dev lo table 100
'';
ExecStop = inputs.pkgs.writeShellScript "v2ray-forwarder.stop"
''
${ip} rule del fwmark 1/1 table 100
${ip} rule del fwmark 1/1 table 100 priority 5000
${ip} route del local 0.0.0.0/0 dev lo table 100
'';
};
@@ -244,7 +244,7 @@ inputs:
{
matchConfig.Name = "lo";
routes = [{ Table = 100; Destination = "0.0.0.0/0"; Type = "local"; }];
routingPolicyRules = [{ FirewallMark = "1/1"; Table = 100; }];
routingPolicyRules = [{ FirewallMark = "1/1"; Table = 100; Priority = 5000; }];
};
};
};