Skip to content

Instantly share code, notes, and snippets.

@p120ph37

p120ph37/vpnc-script.patch

Last active Oct 18, 2016
Embed
What would you like to do?
A patch to vpnc-script to support $SPLIT_DNS when used with openconnect and a Cisco AnyConnect server.
--- vpnc-script.orig 2016-10-18 16:13:30.000000000 -0500
+++ vpnc-script 2016-10-18 16:14:27.000000000 -0500
@@ -435,10 +435,10 @@
# DNS matching when available. When multiple DNS matching
# is present, anything reading the /etc/resolv.conf file
# directly will probably not work as intended.
- #if [ -z "$CISCO_DEF_DOMAIN" ]; then
+ if [ -z "$CISCO_DEF_DOMAIN" ]; then
# Cannot use multiple DNS matching without a domain
OVERRIDE_PRIMARY='d.add OverridePrimary # 1'
- #fi
+ fi
scutil >/dev/null 2>&1 <<-EOF
open
d.init
@@ -459,7 +459,7 @@
get State:/Network/Service/$TUNDEV/DNS
d.add DomainName $CISCO_DEF_DOMAIN
d.add SearchDomains * $CISCO_DEF_DOMAIN
- d.add SupplementalMatchDomains * $CISCO_DEF_DOMAIN
+ d.add SupplementalMatchDomains * $CISCO_DEF_DOMAIN $SPLIT_DNS
set State:/Network/Service/$TUNDEV/DNS
close
EOF
@p120ph37

This comment has been minimized.

Copy link
Owner Author

@p120ph37 p120ph37 commented Apr 17, 2014

To apply it to vpnc-script, use this command: patch -i vpnc-script.patch vpnc-script

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.