Comments (5)
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.
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.
Could you send your changes as a patch or pull request?
from openconnect-gui.
--- /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.
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)
- Cannot find/resolve intranet site HOT 2
- Saving certificates causes app to hang HOT 3
- Opennconnect-gui crash on Mac after connect to a Jupiter connect HOT 1
- Program fail to run after upgrading system to Mac OS Mojave HOT 3
- Feature request: showing bit rates in addition to the amount of data received and transmitted
- Login prompts come up but PWs are invalid HOT 1
- vpnc-script adds an invalid route to Windows routing table
- Should disable system-wide proxy when connected
- version numbers broken on macOS
- Able to connect more than one connection at the time. HOT 1
- DNS Leak on Windows 10 HOT 7
- Windows 10 DNS option isn't reverted back to default after disconnecting.
- Hide from doc on macOS HOT 1
- An error occurred installing the TAP device driver HOT 4
- Does Your Product/Program Use a Certification named "srv-build-cd"? HOT 3
- crash after connection established on Mac OS HOT 7
- read the wrong CA cert form local when connecting to server
- Always need to type password to get root privileges when startup HOT 2
- Reconnect fails due to missing re-authentication HOT 6
- Using --no-dtls HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from openconnect-gui.