Delete a specific route/rule instead of flusing a whole table

This commit is contained in:
Valeriy Manzhos 2026-04-07 15:39:23 +03:00
parent 953e7825d4
commit 2ba4ee30b6
No known key found for this signature in database
GPG key ID: 6547CFC8E2EC3D90
2 changed files with 4 additions and 4 deletions

View file

@ -2,5 +2,5 @@
%v2rayn ALL = (v2rayn-core) NOPASSWD: /opt/v2rayn-core/hev-socks5-tunnel /opt/v2rayn-core/v2rayn-tun.yaml
%v2rayn ALL = (root) NOPASSWD: /sbin/ip rule add pref 5000 not uidrange 785-785 lookup 6418
%v2rayn ALL = (root) NOPASSWD: /sbin/ip route add table 6418 default via 198.18.0.1 dev v2rayn-tun
%v2rayn ALL = (root) NOPASSWD: /sbin/ip route flush table 6418
%v2rayn ALL = (root) NOPASSWD: /sbin/ip rule delete pref 5000
%v2rayn ALL = (root) NOPASSWD: /sbin/ip route delete table 6418 default via 198.18.0.1 dev v2rayn-tun
%v2rayn ALL = (root) NOPASSWD: /sbin/ip rule delete pref 5000 not uidrange 785-785 lookup 6418

View file

@ -240,7 +240,7 @@ public class CoreManager
{
var procService = new ProcessService(
fileName: "/usr/bin/sudo",
arguments: "/sbin/ip rule delete pref 5000",
arguments: "/sbin/ip rule delete pref 5000 not uidrange 785-785 lookup 6418",
workingDirectory: Utils.GetBinConfigPath(),
displayLog: true,
redirectInput: false,
@ -250,7 +250,7 @@ public class CoreManager
await procService.StartAsync(AppManager.Instance.LinuxSudoPwd);
var procService2 = new ProcessService(
fileName: "/usr/bin/sudo",
arguments: "/sbin/ip route flush table 6418",
arguments: "/sbin/ip route delete table 6418 default via 198.18.0.1 dev v2rayn-tun",
workingDirectory: Utils.GetBinConfigPath(),
displayLog: true,
redirectInput: false,