mirror of
https://github.com/netchx/netch.git
synced 2026-03-18 18:13:21 +08:00
Update TUNController (tun2socks.bin)
This commit is contained in:
@@ -13,17 +13,18 @@ namespace Netch.Models
|
||||
public TunAdapter()
|
||||
{
|
||||
AdapterId = AdapterUtils.GetAdapterId(ComponentIdWintun) ?? throw new Exception("wintun adapter not found");
|
||||
|
||||
NetworkInterface = NetworkInterface.GetAllNetworkInterfaces().First(i => i.Id == AdapterId);
|
||||
InterfaceIndex = NetworkInterface.GetIPProperties().GetIPv4Properties().Index;
|
||||
Logging.Info($"TAP 适配器:{NetworkInterface.Name} {NetworkInterface.Id} {NetworkInterface.Description}, index: {InterfaceIndex}");
|
||||
Gateway = IPAddress.Parse(Global.Settings.WinTUN.Gateway);
|
||||
|
||||
Logging.Info($"WinTUN 适配器:{NetworkInterface.Name} {NetworkInterface.Id} {NetworkInterface.Description}, index: {InterfaceIndex}");
|
||||
}
|
||||
|
||||
public string AdapterId { get; set; }
|
||||
|
||||
public int InterfaceIndex { get; }
|
||||
|
||||
public IPAddress Gateway { get; } = IPAddress.Parse("100.64.0.1");
|
||||
public IPAddress Gateway { get; }
|
||||
|
||||
public NetworkInterface NetworkInterface { get; }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user