Skip to content

Instantly share code, notes, and snippets.

View mattfarina's full-sized avatar
┻━┻ ︵ヽ(`Д´)ノ︵ ┻━┻

Matt Farina mattfarina

┻━┻ ︵ヽ(`Д´)ノ︵ ┻━┻
View GitHub Profile

WSL 2 Cisco AnyConnect Networking Workaround

Overview

WSL 2 uses a Hyper-V Virtual Network adapter. Network connectivity works without any issue when a VPN is not in use. However when a Cisco AnyConnect VPN session is established Firewall Rules and Routes are added which breaks connectivity within the WSL 2 VM. This issue is tracked WSL/issues/4277

Below outline steps to automatically configure the Interface metric on VPN connect and update DNS settings (/etc/resolv.conf) on connect/disconnect.

Manual Configuration

Set Interface Metrics

#!/usr/bin/env bash
set -e
set -o pipefail
kubectl proxy &
proxy_pid="$!"
trap 'kill "$proxy_pid"' EXIT
for ns in $(kubectl get namespace --field-selector=status.phase=Terminating --output=jsonpath="{.items[*].metadata.name}"); do
@jollyroger
jollyroger / glide-support-common-make-vars.patch
Last active August 4, 2016 18:31
RPM SPEC file to build glie package manager for Golang
--- Makefile 2016-08-04 13:07:27.501588143 -0400
+++ Makefile 2016-08-04 13:07:35.035595718 -0400
@@ -1,13 +1,17 @@
GLIDE_GO_EXECUTABLE ?= go
-VERSION := $(shell git describe --tags)
+VERSION_GIT := $(shell git describe --tags)
+VERSION ?= ${VERSION_GIT}
DIST_DIRS := find * -type d -exec
+PREFIX ?= /usr/local
@RogWilco
RogWilco / kextload.virtualbox.sh
Created June 21, 2013 18:39
Loads the required OS X kernel extensions for VirtualBox. This is specifically useful in the developer preview of OS X 10.9 Mavericks, which for some reason does not seem to automatically load these kernel extensions (which, consequently, will prevent most VMs from successfully booting). Use launchd to have this script run on boot to ensure they…
#!/bin/bash
sudo kextload -r "/Library/Extensions/" "/Library/Extensions/VBoxDrv.kext"
sudo kextload -r "/Library/Extensions/" "/Library/Extensions/VBoxNetFlt.kext"
sudo kextload -r "/Library/Extensions/" "/Library/Extensions/VBoxNetAdp.kext"
sudo kextload -r "/Library/Extensions/" "/Library/Extensions/VBoxUSB.kext"