From f69624309a5b9ac9be9b8f8cd73fc1e21d4b2073 Mon Sep 17 00:00:00 2001 From: Srar Date: Wed, 23 May 2018 13:05:18 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0IPv6=E5=88=A0=E9=99=A4?= =?UTF-8?q?=E5=91=BD=E4=BB=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- test/test.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/test.ts b/test/test.ts index fa8a7fc..1f35336 100644 --- a/test/test.ts +++ b/test/test.ts @@ -119,9 +119,9 @@ async function main() { if (!TAPControl.checkAdapterIsInstalled()) { console.log("Installing driver..."); const result = TAPControl.installAdapter(path.join(process.cwd(), "driver/tapinstall.exe")); - if(result !== 0) { + if (result !== 0) { console.error(`Driver was not successfully installed. Exit code: ${result}.`); - if(result === 2) { + if (result === 2) { console.log(`Please run as administrator.`); } process.exit(-1); @@ -192,7 +192,10 @@ async function main() { if (argv.disablev6 === "true") { console.log("IPv6 has been disabled."); - initCommands.push(["netsh", "interface", "ipv6", "set", "int", tapInfo.index.toString(), "advertise=enable", "managed=enable"]); + initCommands.push( + ["netsh", "int", "ipv6", "delete", "route", "::/0", `interface=${tapInfo.index}`, `nexthop=${DeviceConfiguration.GATEWAY_IPV6_ADDRESS}`], + ["netsh", "int", "ipv6", "delete", "address", `interface=${tapInfo.index}`, `address=${DeviceConfiguration.LOCAL_IPV6_ADDRESS}`] + ); } else { initCommands.push( ["netsh", "interface", "ipv6", "set", "address", `interface=${tapInfo.index}`, `address=${DeviceConfiguration.LOCAL_IPV6_ADDRESS}`],