Giter VIP home page Giter VIP logo

Comments (5)

nmav avatar nmav commented on June 27, 2024

That could be an issue in the script, as it should always be called on disconnection. I'll try to check it this week.

from openconnect-gui.

nielspeen avatar nielspeen commented on June 27, 2024

The script configures the TAP interface first, then sets up the direct route to the VPN gateway. Because the interface configuration automatically includes the new default gateway there is a brief moment where traffic loops and DTLS setup can fail.

After moving the direct route creation command up, to be executed prior to the interface configuration, my problem was solved.

from openconnect-gui.

nmav avatar nmav commented on June 27, 2024

Could you send your changes as a patch or pull request?

from openconnect-gui.

nielspeen avatar nielspeen commented on June 27, 2024
--- /tmp/vpnc-script-win.js     2014-09-10 03:04:29.000000000 +0800
+++ vpnc-script-win.js  2014-09-09 23:43:03.000000000 +0800
@@ -21,7 +21,7 @@
        return;
 }

-function exec(cmd)
+function run(cmd)
  {
        var s = "";
        log.WriteLine("executing: " + cmd);
@@ -42,9 +42,15 @@
        return s;
 }

+function exec(cmd)
+{
+       log.WriteLine("executing: " + cmd);
+       ws.Run(cmd, 7, true);
+}
+
 function getDefaultGateway()
 {
-       if (exec("route print").match(/0\.0\.0\.0 *(0|128)\.0\.0\.0 *([0-9\.]*)/)) {
+       if (run("route print").match(/0\.0\.0\.0 *(0|128)\.0\.0\.0 *([0-9\.]*)/)) {
                return (RegExp.$2);
        }
        return ("");
@@ -55,7 +61,7 @@
        for (var i = 0; i < 5; i++) {
                echo("Waiting for interface to come up...");
                WScript.Sleep(2000);
-               if (exec("route print").match(if_route)) {
+               if (run("route print").match(if_route)) {
                        return true;
                }
        }
@@ -99,6 +105,10 @@
        echo("Internal Gateway: " + internal_gw);
        echo("Interface: \"" + env("TUNDEV") + "\"");

+       // Add direct route for the VPN gateway to avoid routing loops
+       exec("route add " + env("VPNGATEWAY") +
+            " mask 255.255.255.255 " + gw);
+
        if (env("INTERNAL_IP4_MTU")) {
            echo("MTU: " + env("INTERNAL_IP4_MTU"));
            exec("netsh interface ipv4 set subinterface \"" + env("TUNDEV") +
@@ -125,9 +135,6 @@
                        env("INTERNAL_IP4_ADDRESS") + " " + env("INTERNAL_IP4_NETMASK") + " " + internal_gw + " 1");
        }

-       // Add direct route for the VPN gateway to avoid routing loops
-       exec("route add " + env("VPNGATEWAY") +
-            " mask 255.255.255.255 " + gw);

     if (env("INTERNAL_IP4_NBNS")) {
                var wins = env("INTERNAL_IP4_NBNS").split(/ /);

from openconnect-gui.

nielspeen avatar nielspeen commented on June 27, 2024

Hm. I think my patch will undo your own most recent patch as I based it on a version downloaded earlier today.

from openconnect-gui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.