mirror of
https://github.com/CHN-beta/nixos.git
synced 2026-01-12 01:29:24 +08:00
modules.services.nginx/xray: fix routing policy rule priority
This commit is contained in:
@@ -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; }];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
@@ -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; }];
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user