Skip to content
This repository has been archived by the owner on Feb 1, 2024. It is now read-only.

DNS settings remain set after TAP use #180

Closed
Curley-Joe opened this issue Jul 11, 2017 · 1 comment
Closed

DNS settings remain set after TAP use #180

Curley-Joe opened this issue Jul 11, 2017 · 1 comment

Comments

@Curley-Joe
Copy link

Description of the Issue

OpenConnect-GUI sets the DNS server(s) as static entries in the TAP driver's IP4 settings, and does not restore the TAP driver settings when it is done using the TAP driver. This causes problems with other apps that use the TAP driver, because they will inherit the incorrect DNS servers set by OpenConnect-GUI.

Specifications

  • Version: 1.5.1.0
  • Platform: Windows 7 64-bit, English

Steps to Reproduce the Issue

  1. Connect to a Cisco VPN server using OpenConnect-GUI
  2. Disconnect
  3. Look in the TAP driver's IP4 settings an notice that the DNS servers are still there
  4. Run another app that uses TAP, such as OpenVPN, and notice that it uses the DNS servers that OpenConnect-GUI left there.

Expected Behavior

I think OpenConnect-GUI should leave the TAP driver settings the way it found them.

Actual Behavior

OpenConnect-GUI changes the TAP driver's settings.

Other Information

@Curley-Joe
Copy link
Author

I think I may have posted this to the wrong place, since the issue seems to be in vpnc-script.js.

Anyway, if anybody is interested, I think the fix is something like this:

case "disconnect":
// Delete direct route for the VPN gateway
exec("route delete " + env("VPNGATEWAY") + " mask 255.255.255.255");
// Return to default state (DHCP)
var tundevid = getInterfaceId(env("TUNDEV"))
exec("netsh interface ip set dns "" + tundevid + "" source=dhcp");
exec("netsh interface ip set winsservers "" + tundevid + "" source=dhcp");
exec("netsh interface ip set address "" + tundevid + "" source=dhcp");

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants