Add configurable TUN IPv4/IPv6 addresses

https://github.com/2dust/v2rayN/issues/9810
This commit is contained in:
2dust
2026-07-24 10:13:08 +08:00
parent fd2c942231
commit e749b81ecf
13 changed files with 154 additions and 19 deletions
@@ -95,6 +95,8 @@ public class OptionSettingViewModel : MyReactiveObject, ICloseable
[Reactive] public string TunIcmpRouting { get; set; }
[Reactive] public bool TunEnableLegacyProtect { get; set; }
[Reactive] public string TunRouteExcludeAddress { get; set; }
[Reactive] public string TunIpv4Address { get; set; }
[Reactive] public string TunIpv6Address { get; set; }
#endregion Tun mode
@@ -214,6 +216,8 @@ public class OptionSettingViewModel : MyReactiveObject, ICloseable
TunIcmpRouting = _config.TunModeItem.IcmpRouting;
TunEnableLegacyProtect = _config.TunModeItem.EnableLegacyProtect;
TunRouteExcludeAddress = Utils.List2String(_config.TunModeItem.RouteExcludeAddress, true);
TunIpv4Address = _config.TunModeItem.Ipv4Address;
TunIpv6Address = _config.TunModeItem.Ipv6Address;
#endregion Tun mode
@@ -378,6 +382,8 @@ public class OptionSettingViewModel : MyReactiveObject, ICloseable
_config.TunModeItem.IcmpRouting = TunIcmpRouting;
_config.TunModeItem.EnableLegacyProtect = TunEnableLegacyProtect;
_config.TunModeItem.RouteExcludeAddress = Utils.String2List(TunRouteExcludeAddress);
_config.TunModeItem.Ipv4Address = TunIpv4Address;
_config.TunModeItem.Ipv6Address = TunIpv6Address;
//coreType
await SaveCoreType();