diff --git a/v2rayN/ServiceLib/Manager/CoreManager.cs b/v2rayN/ServiceLib/Manager/CoreManager.cs index 724bf411..db382685 100644 --- a/v2rayN/ServiceLib/Manager/CoreManager.cs +++ b/v2rayN/ServiceLib/Manager/CoreManager.cs @@ -88,6 +88,12 @@ public class CoreManager await WindowsUtils.RemoveTunDevice(); } + if (Utils.IsLinux() && !_config.TunModeItem.EnableTun) + { + await DeleteTUNRoutes(); + await KillTUNProcess(); + } + await CoreStart(mainContext); await CoreStartPreService(preContext); diff --git a/v2rayN/ServiceLib/ViewModels/StatusBarViewModel.cs b/v2rayN/ServiceLib/ViewModels/StatusBarViewModel.cs index b8154c16..c794d4ed 100644 --- a/v2rayN/ServiceLib/ViewModels/StatusBarViewModel.cs +++ b/v2rayN/ServiceLib/ViewModels/StatusBarViewModel.cs @@ -480,6 +480,10 @@ public class StatusBarViewModel : MyReactiveObject await AppManager.Instance.RebootAsAdmin(); return; } + else if (Utils.IsLinux()) { + await CoreManager.StartTUNProcess(); + await CoreManager.CreateTUNRoutes(); + } else { bool? passwordResult = await _updateView?.Invoke(EViewAction.PasswordInput, null); @@ -502,7 +506,7 @@ public class StatusBarViewModel : MyReactiveObject } else if (Utils.IsLinux()) { - return AppManager.Instance.LinuxSudoPwd.IsNotEmpty(); + return false; } else if (Utils.IsMacOS()) {